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)
| 357 | self.data.CopyData(t.data) |
| 358 | |
| 359 | def copy_from(self, t, offset=0): |
| 360 | ''' Copy the data from the numpy array or other Tensor instance |
| 361 | |
| 362 | Args: |
| 363 | t (Tensor or np array): source Tensor or numpy array |
| 364 | offset (int): destination offset |
| 365 | ''' |
| 366 | if isinstance(t, Tensor): |
| 367 | self.copy_data(t) |
| 368 | elif isinstance(t, np.ndarray): |
| 369 | self.copy_from_numpy(t) |
| 370 | else: |
| 371 | raise ValueError("t should be Tensor or numpy array.") |
| 372 | |
| 373 | def clone(self): |
| 374 | ''' |
no test coverage detected