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

merge

...@@ -584,6 +584,8 @@ class _tensor_py_operators: ...@@ -584,6 +584,8 @@ class _tensor_py_operators:
T = property(lambda self: transpose(self)) T = property(lambda self: transpose(self))
shape = property(lambda self: shape(self)) shape = property(lambda self: shape(self))
def reshape(self, shape, ndim=None):
return reshape(self, shape, ndim=ndim)
#SLICING #SLICING
# def __getitem__(self, args): return Subtensor.from_idxs(self, # def __getitem__(self, args): return Subtensor.from_idxs(self,
......
...@@ -1854,6 +1854,10 @@ def test_smallest(): ...@@ -1854,6 +1854,10 @@ def test_smallest():
assert -4 == inplace_func([sx,sy], smallest(sx,sy))(-4.0, -2.0) assert -4 == inplace_func([sx,sy], smallest(sx,sy))(-4.0, -2.0)
def test_reshape_member_fn():
x = dmatrix()
y = x.reshape((4,5,6))
assert y.owner.op == Reshape(3)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论