提交 37ce26a3 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Add dtype arg to ScalarVariable.zeros_like

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