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)
| 830 | |
| 831 | |
| 832 | def 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 | |
| 846 | def from_numpy(np_array, dev=None): |
nothing calls this directly
no test coverage detected