GetDataType

Description

Obtains the data type of an aclTensor.

Prototype

op::DataType GetDataType()

Parameters

None.

Returns

op::DataType (ge::DataType), which indicates the data type of elements in aclTensor, such as float16 or float32.

For details about ge::DataType, see ge::DataType in Basic Data Structures and APIs.

Constraints

None.

Example

1
2
3
4
// Obtain the data type of the input.
void Func(const aclTensor *input) {
    op::DataType dataType = input->GetDataType();
}