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)
| 861 | |
| 862 | |
| 863 | def 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 | |
| 877 | def from_numpy(np_array, dev=None): |
nothing calls this directly
no test coverage detected