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

Method is_cpu

oneflow/core/framework/tensor.cpp:118–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118bool LocalTensor::is_cpu() const { return CHECK_JUST(device())->type() == "cpu"; }
119bool LocalTensor::is_cuda() const { return CHECK_JUST(device())->type() == "cuda"; }
120
121Maybe<Tensor> LocalTensor::detach() const {

Callers 2

PyTensorObject_is_cpuFunction · 0.45

Calls 2

typeMethod · 0.45
device_typeMethod · 0.45

Tested by

no test coverage detected