SetFormat

Applicability

Product

Supported or Not

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

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 format of a TensorHolder.

Prototype

1
EsTensorHolder &SetFormat(const ge::Format format)

Parameters

Parameter

Input/Output

Description

format

Input

Tensor format. For details, see Format.

Returns

Parameter

Type

Description

-

EsTensorHolder &

Reference to the current object, which supports chain calls.

Constraints

None

Examples

1
2
3
4
//1. Create a graph builder (EsGraphBuilder).
EsGraphBuilder builder("graph_name");
// 2. Add an input node.
EsTensorHolder data0 = builder.CreateInput(0).SeFormat(FORMAT_NCHW); // Set the format of the output tensor of the input node.