GetDataType

Function Usage

Obtains the data type of a tensor.

Prototype

1
ge::DataType GetDataType() const

Parameters

None

Returns

Data type of a tensor.

For details about the definition of ge::DataType, see DataType.

Constraints

None

Examples

1
2
3
StorageShape sh({1, 2, 3}, {1, 2, 3});
TensorV2 t = {sh, {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}}, kOnHost, ge::DT_FLOAT, nullptr};
auto dt = t.GetDataType(); //  ge::DT_FLOAT