Function Description
Obtains the pointer to a required input tensor based on the input index in the operator prototype definition.
Function Prototype
const Tensor *GetRequiredInputTensor(const size_t ir_index) const;
Parameters
| Parameter | Input/Output | Description |
| ir_index | Input | Index of the required input in the operator IR prototype definition, starting from 0. |
Return Value
Pointer to a specified input tensor. If the input ir_index is invalid, a null pointer is returned.
For details about the definition of the Tensor type, see Tensor.
Restrictions
If the input is not set as a data dependency, when this API is called to obtain the tensor, only the correct shape, format, and data type information can be obtained from the tensor. The actual tensor data address cannot be obtained (the obtained address is nullptr).
Calling Example
ge::graphStatus InferShape4ConcatD(TilingContext* context) {
auto in_tensor = context->GetRequiredInputTensor(0U);
// ...
}