(x)
| 71 | |
| 72 | def _prep_data_for_feed_input(data, batch_size, layout, device_id=None): |
| 73 | def to_numpy(x): |
| 74 | import numpy as np |
| 75 | |
| 76 | if _types._is_mxnet_array(x): |
| 77 | return x.asnumpy() |
| 78 | elif _types._is_torch_tensor(x): |
| 79 | return x.numpy() |
| 80 | else: |
| 81 | return np.asarray(x) |
| 82 | |
| 83 | # __cuda_array_interface__ doesn't provide any way to pass the information about the device |
| 84 | # where the memory is located. It is assumed that the current device is the one that |
no outgoing calls
no test coverage detected