GetRequiredInputTensor
Function Usage
Obtains the pointer to a required input tensor based on the input index in the operator prototype definition.
Prototype
1 | const Tensor *GetRequiredInputTensor(const size_t ir_index) const |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
ir_index |
Input |
Input index in the operator IR prototype definition, starting from 0. |
Returns
Input tensor pointer. If the ir_index is invalid, a null pointer is returned.
For details about the definition of the tensor type, see Tensor.
Examples
1 2 3 4 5 | ge::graphStatus InferFormatForXXX(InferFormatContext *context) { const auto data = context->GetRequiredInputTensor(1U)->GetData<uint8_t>(); EXPECT_EQ(data[0], 85); // ... } |
Parent topic: InferFormatContext