MCPcopy Create free account
hub / github.com/apache/singa / copy_from

Method copy_from

python/singa/tensor.py:390–402  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 '''

Callers 15

stepMethod · 0.45
stepMethod · 0.45
stepMethod · 0.45
stepMethod · 0.45
stepMethod · 0.45
eyeFunction · 0.45
orthogonalFunction · 0.45
set_paramsMethod · 0.45
set_paramsMethod · 0.45
set_paramsMethod · 0.45
set_paramsMethod · 0.45
set_paramsMethod · 0.45

Calls 2

copy_dataMethod · 0.95
copy_from_numpyMethod · 0.95

Tested by

no test coverage detected