目录

SetDataType

Function Description

Sets the data type of a tensor.

Function Prototype

void SetDataType(const ge::DataType data_type)

Parameters

Parameter Input/Output Description
data_type Input

Data type of a tensor to be set.

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

Return Value

None

Restrictions

None

Calling Example

StorageShape sh({1, 2, 3}, {1, 2, 3});
Tensor t = {sh, {}, {}, ge::DT_FLOAT, nullptr};
t.SetDataType(ge::DT_DOUBLE);