提交 1a2dc300 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fixed bug in scalar.zeros_like where it didn't get translated into

tensor.zeros_like for elemwise ops
上级 353755c6
......@@ -491,7 +491,8 @@ class _scalar_py_operators:
def __rpow__(self,other): return pow(other,self)
def zeros_like(self):
return ScalarConstant(Scalar(str(self.type.dtype)), 0)
# The second is needed for Elemwise ops to work right
return second(self, ScalarConstant(Scalar(str(self.type.dtype)), 0))
def astype(self, dtype):
return cast(self, dtype)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论