目录

GetDataType

Function Description

Obtains the data type of a tensor.

Function Prototype

ge::DataType GetDataType() const

Parameters

None

Return Value

Data type of a tensor.

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

Restrictions

None

Calling Example

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