Copy data from other Tensor instance. Args: t (Tensor): source Tensor.
(self, t)
| 378 | raise NotImplementedError('Not implemented yet for ', dt) |
| 379 | |
| 380 | def copy_data(self, t): |
| 381 | '''Copy data from other Tensor instance. |
| 382 | |
| 383 | Args: |
| 384 | t (Tensor): source Tensor. |
| 385 | ''' |
| 386 | assert (t.size() == self.size()), "tensor shape should be the same" |
| 387 | assert isinstance(t, Tensor), 't must be a singa Tensor instance' |
| 388 | self.data.CopyData(t.data) |
| 389 | |
| 390 | def copy_from(self, t, offset=0): |
| 391 | ''' Copy the data from the numpy array or other Tensor instance |