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

Method copy_data

python/singa/tensor.py:380–388  ·  view source on GitHub ↗

Copy data from other Tensor instance. Args: t (Tensor): source Tensor.

(self, t)

Source from the content-addressed store, hash-verified

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

Callers 1

copy_fromMethod · 0.95

Calls 2

sizeMethod · 0.95
CopyDataMethod · 0.80

Tested by

no test coverage detected