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

Added .astype method to TensorVariable interface

It's a shortcut to cast. It's used in the GEMM unittests.
上级 e096f644
...@@ -1225,6 +1225,10 @@ class _tensor_py_operators: ...@@ -1225,6 +1225,10 @@ class _tensor_py_operators:
def flatten(self, ndim=1): def flatten(self, ndim=1):
return flatten(self, ndim) return flatten(self, ndim)
# CASTING
def astype(self, dtype):
return cast(self, dtype)
#SLICING #SLICING
# def __getitem__(self, args): return Subtensor.from_idxs(self, # def __getitem__(self, args): return Subtensor.from_idxs(self,
# args).outputs[0] # args).outputs[0]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论