提交 8eac84d9 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

implemented scalar astype

上级 15cf3bc8
...@@ -493,6 +493,9 @@ class _scalar_py_operators: ...@@ -493,6 +493,9 @@ class _scalar_py_operators:
def zeros_like(self): def zeros_like(self):
return ScalarConstant(Scalar(str(self.type.dtype)), 0) return ScalarConstant(Scalar(str(self.type.dtype)), 0)
def astype(self, dtype):
return cast(self, dtype)
class ScalarVariable(_scalar_py_operators, Variable): class ScalarVariable(_scalar_py_operators, Variable):
pass pass
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论