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

Method to_device

python/singa/tensor.py:312–319  ·  view source on GitHub ↗

Move the tensor data onto a given device. Args: device: a swig Device converted from CudaGPU or CppCPU or OpenclGPU

(self, device)

Source from the content-addressed store, hash-verified

310 return self
311
312 def to_device(self, device):
313 '''Move the tensor data onto a given device.
314
315 Args:
316 device: a swig Device converted from CudaGPU or CppCPU or OpenclGPU
317 '''
318 self.data.ToDevice(device)
319 self.device = device
320
321 def to_host(self):
322 '''Move the tensor data onto the default host CppCPU device.

Callers 15

from_numpyFunction · 0.95
device_checkMethod · 0.45
forwardMethod · 0.45
backwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
device_checkMethod · 0.45
run_nodeMethod · 0.45
to_input_tensorMethod · 0.45
runMethod · 0.45

Calls 1

ToDeviceMethod · 0.45

Tested by 15

assertTensorEqualFunction · 0.36
_relu_helperMethod · 0.36
_softmax_helperMethod · 0.36
_sigmoid_helperMethod · 0.36
_add_helperMethod · 0.36
_concat_helperMethod · 0.36
_matmul_helperMethod · 0.36
_batch_norm_helperMethod · 0.36
_gemm_helperMethod · 0.36
_reshape_helperMethod · 0.36
_SeLu_helperMethod · 0.36
_ELu_helperMethod · 0.36