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

Method to_device

examples/model_selection/Trails/singa_pkg_code/tensor.py:283–290  ·  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

281 return t
282
283 def to_device(self, device):
284 '''Move the tensor data onto a given device.
285
286 Args:
287 device: a swig Device converted from CudaGPU or CppCPU or OpenclGPU
288 '''
289 self.data.ToDevice(device)
290 self.device = device
291
292 def to_host(self):
293 '''Move the tensor data onto the default host CppCPU device.

Callers 10

from_numpyFunction · 0.95
trainFunction · 0.45
trainFunction · 0.45
reset_statesMethod · 0.45
numpy2tensorsFunction · 0.45
sampleFunction · 0.45
bert-squad.pyFile · 0.45
reset_statesMethod · 0.45
numpy2tensorsFunction · 0.45
sampleFunction · 0.45

Calls 1

ToDeviceMethod · 0.45

Tested by

no test coverage detected