GetDataType

Description

Obtains the data type of a tensor.

Prototype

ge::DataType GetDataType() const

Parameters

None

Returns

Data type in a tensor.

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

Restrictions

None

Example

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