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

Function copy_data_to_from

python/singa/tensor.py:863–874  ·  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

861
862
863def copy_data_to_from(dst, src, size, dst_offset=0, src_offset=0):
864 '''Copy the data between two Tensor instances which could be on different
865 devices.
866
867 Args:
868 dst (Tensor): destination Tensor
869 src (Tensor): source Tensor
870 size (int) : number of elements to copy
871 dst_offset (int): offset in terms of elements to the start of dst
872 src_offset (int): offset in terms of elements to the start of src
873 '''
874 singa.CopyDataToFrom(dst.data, src.data, size, dst_offset, src_offset)
875
876
877def from_numpy(np_array, dev=None):

Callers

nothing calls this directly

Calls 1

CopyDataToFromMethod · 0.45

Tested by

no test coverage detected