GetRequiredInputDesc
Description
Obtains the description of a mandatory input tensor based on the input index in the operator prototype definition.
Prototype
const CompileTimeTensorDesc *GetRequiredInputDesc(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
Pointer to CompileTimeTensorDesc. If index is invalid, a null pointer is returned.
For details about the definition of CompileTimeTensorDesc, see CompileTimeTensorDesc.
Restrictions
None
Example
// Assume that KernelContext *context already exists. auto extend_context = reinterpret_cast<ExtendedKernelContext *>(context); // Assume that input 0 of the IR prototype of an operator is a common input and there is actually one input. auto optional_input_td = extend_context->GetRequiredInputDesc(0); // Obtain the tensor description of input 0.
Parent topic: ExtendedKernelContext