MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / device

Method device

oneflow/api/cpp/framework/tensor.cpp:62–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62Device Tensor::device() const {
63 const auto device_ = tensor_->device().GetOrThrow();
64 return Device(device_->type(), device_->device_id());
65}
66
67DType Tensor::dtype() const { return static_cast<DType>(tensor_->dtype()->data_type()); }
68

Callers 12

PyTensorObject_type_asFunction · 0.45
PyTensorObject_newFunction · 0.45
PyTensorObject_setitemFunction · 0.45
PyTensorObject_typeFunction · 0.45
PyTensorObject_deviceFunction · 0.45
EagerLocalTensorToNumpyFunction · 0.45
toDLPackFunction · 0.45
operator()Method · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 4

DeviceClass · 0.70
GetOrThrowMethod · 0.45
typeMethod · 0.45
device_idMethod · 0.45

Tested by 2

TESTFunction · 0.36
TESTFunction · 0.36