提交 e80036df authored 作者: James Bergstra's avatar James Bergstra

added c implementation for complex abs

上级 bbd941f1
......@@ -644,6 +644,8 @@ class Abs(UnaryScalarOp):
return "%(z)s = abs(%(x)s);" % locals()
if type in float_types:
return "%(z)s = fabs(%(x)s);" % locals()
if type in complex_types:
return "%(z)s = sqrt(%(x)s.real*%(x)s.real + %(x)s.imag*%(x)s.imag);" % locals()
#complex, other?
raise NotImplementedError('type not supported', type)
abs_ = Abs(same_out)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论