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

Method copy_data

examples/model_selection/Trails/singa_pkg_code/tensor.py:349–357  ·  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

347 print('Not implemented yet for ', dt)
348
349 def copy_data(self, t):
350 '''Copy data from other Tensor instance.
351
352 Args:
353 t (Tensor): source Tensor.
354 '''
355 assert (t.size() == self.size()), "tensor shape should be the same"
356 assert isinstance(t, Tensor), 't must be a singa Tensor instance'
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

Callers 3

copy_fromMethod · 0.95
forwardMethod · 0.45
forwardMethod · 0.45

Calls 2

sizeMethod · 0.95
CopyDataMethod · 0.80

Tested by

no test coverage detected