GetDataType

Function Usage

Obtains the data type of a tensor.

Prototype

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

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