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

Function TensorDeviceToString

oneflow/core/functional/impl/binary_functor.cpp:50–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48} // namespace
49
50std::string TensorDeviceToString(const std::shared_ptr<Tensor>& tensor) {
51 if (tensor->is_global()) { return CHECK_JUST(tensor->parallel_desc())->device_tag(); }
52 return CHECK_JUST(tensor->device())->ToString();
53}
54
55Maybe<void> CastDeviceForCPUScalarTensor(std::shared_ptr<Tensor>& tensor,
56 std::shared_ptr<Tensor>& other, bool inplace) {

Callers 2

IsCPUScalarTensorFunction · 0.85

Calls 4

is_globalMethod · 0.45
parallel_descMethod · 0.45
ToStringMethod · 0.45
deviceMethod · 0.45

Tested by

no test coverage detected