Copy the data from the numpy array or other Tensor instance Args: t (Tensor or np array): source Tensor or numpy array offset (int): destination offset
(self, t, offset=0)
| 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 |
| 392 | |
| 393 | Args: |
| 394 | t (Tensor or np array): source Tensor or numpy array |
| 395 | offset (int): destination offset |
| 396 | ''' |
| 397 | if isinstance(t, Tensor): |
| 398 | self.copy_data(t) |
| 399 | elif isinstance(t, np.ndarray): |
| 400 | self.copy_from_numpy(t) |
| 401 | else: |
| 402 | raise ValueError("t should be Tensor or numpy array.") |
| 403 | |
| 404 | def clone(self): |
| 405 | ''' |
no test coverage detected