SetDataType

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <ge/es_tensor_holder.h>
  • Library files: libeager_style_graph_builder_base.so and libeager_style_graph_builder_base_static.a

Function Usage

Sets the data type of a TensorHolder.

Prototype

1
EsTensorHolder &SetDataType(const ge::DataType data_type)

Parameters

Parameter

Input/Output

Description

data_type

Input

Data type. For details about the data type, see DataType.

Returns

Parameter

Type

Description

-

EsTensorHolder &

Reference to the current object, which supports chain calls.

Restrictions

None

Example

1
2
3
4
//1. Create a graph builder (EsGraphBuilder).
EsGraphBuilder builder("graph_name");
// 2. Add an input node.
EsTensorHolder data0 = builder.CreateInput(0).SetDataType(DT_INT32); // Set the data type of the output tensor for the input node.