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

Function copy_data_to_from

examples/model_selection/Trails/singa_pkg_code/tensor.py:832–843  ·  view source on GitHub ↗

Copy the data between two Tensor instances which could be on different devices. Args: dst (Tensor): destination Tensor src (Tensor): source Tensor size (int) : number of elements to copy dst_offset (int): offset in terms of elements to the start of dst

(dst, src, size, dst_offset=0, src_offset=0)

Source from the content-addressed store, hash-verified

830
831
832def copy_data_to_from(dst, src, size, dst_offset=0, src_offset=0):
833 '''Copy the data between two Tensor instances which could be on different
834 devices.
835
836 Args:
837 dst (Tensor): destination Tensor
838 src (Tensor): source Tensor
839 size (int) : number of elements to copy
840 dst_offset (int): offset in terms of elements to the start of dst
841 src_offset (int): offset in terms of elements to the start of src
842 '''
843 singa.CopyDataToFrom(dst.data, src.data, size, dst_offset, src_offset)
844
845
846def from_numpy(np_array, dev=None):

Callers

nothing calls this directly

Calls 1

CopyDataToFromMethod · 0.45

Tested by

no test coverage detected