OutputTensorDesc

Function Usage

Sets the description of the output Tensor. It is used to construct ComputeNodeInfo in the base class ExtendedKernelContext of InferDataTypeContext. You do not need to set the output data type, which is inferred by the operator based on the input data type.

Prototype

1
OpInferDataTypeContextBuilder &OutputTensorDesc(size_t index, ge::Format origin_format, ge::Format storage_format, const gert::ExpandDimsType &expand_dims_type = {})

Parameters

Parameter

Input/Output

Description

index

Input

Index of the operator output instance.

origin_format

Input

Original format of the output Tensor.

storage_format

Input

Storage format of the output Tensor.

expand_dims_type

Input

ExpandDimsType of a dimension expansion rule for the output Tensor. The default value is {}.

Returns

A reference to the OpInferDataTypeContextBuilder object. It is used for chaining method calls.

Constraints

This API must be called before the Build method call. Otherwise, the constructed InferDataTypeContext will contain undefined data.