GetPlacement

Function Usage

Obtains the placement of a tensor, that is, the location of the device where the tensor data is located.

Prototype

1
TensorPlacement GetPlacement() const

Parameters

None

Returns

Tensor placement. For details about the definition of the TensorPlacement type, see TensorPlacement.

Constraints

None

Examples

1
2
3
auto addr = reinterpret_cast<void *>(0x10);
TensorData td(addr, HostAddrManager, 100U, kOnHost);
auto td_place = td.GetPlacement(); // kOnHost