Reshape the input tensor with the given shape and the original tensor is not changed Args: tensor (Tensor): the tensor to be changed shape (list ): the new shape, which should have the same volumn as the old shape. Returns: the new Tensor
(tensor, shape)
| 832 | |
| 833 | |
| 834 | def reshape(tensor, shape): |
| 835 | '''Reshape the input tensor with the given shape and |
| 836 | the original tensor is not changed |
| 837 | |
| 838 | Args: |
| 839 | tensor (Tensor): the tensor to be changed |
| 840 | shape (list<int>): the new shape, which should have the same volumn as the |
| 841 | old shape. |
| 842 | |
| 843 | Returns: |
| 844 | the new Tensor |
| 845 | ''' |
| 846 | return _call_singa_func(singa.Reshape, tensor.data, shape) |
| 847 | |
| 848 | |
| 849 | def transpose(t, axes=None): |
no test coverage detected