[MO] Sqrt operation implementation (#9950)
* Add sqrt extender * Update check to not use default infer in infer was set before * Update comment * Fix comment * Remove Sqrt extender * Remove unnecessary changes * Add MO implementation of SQRT operation
This commit is contained in:
committed by
GitHub
parent
863c74471f
commit
f9eaaa9ff6
@@ -234,3 +234,14 @@ class Negative(UnaryElementwise):
|
||||
op = 'Negative'
|
||||
op_type = 'Negative'
|
||||
operation = staticmethod(lambda a: -a)
|
||||
|
||||
|
||||
class Sqrt(UnaryElementwise):
|
||||
op = 'Sqrt'
|
||||
op_type = 'Sqrt'
|
||||
|
||||
@staticmethod
|
||||
def operation(a):
|
||||
if np.issubdtype(a.dtype, np.signedinteger):
|
||||
return float32_array(a.astype(np.float32) ** 0.5)
|
||||
return a ** 0.5
|
||||
|
||||
Reference in New Issue
Block a user