Overview
InferShapeContext is inherited from ExtendedKernelContext. It is a context class used for shape inference. It provides the necessary input and output shapes and input tensor access APIs during operator output shape inference. For operators (such as Slice and Pad) that depend on the input tensor values during shape inference, this class provides APIs such as GetInputTensor to obtain the actual input data.
The following figure shows the inheritance relationship of InferShapeContext.
Header Files to Be Included
1 | #include <infer_shape_context.h> |
Public Member Functions
const Shape *GetInputShape(const size_t index) const const Tensor *GetInputTensor(const size_t index) const const Shape *GetOptionalInputShape(const size_t ir_index) const const Tensor *GetOptionalInputTensor(const size_t ir_index) const const Shape *GetDynamicInputShape(const size_t ir_index, const size_t relative_index) const const Tensor *GetDynamicInputTensor(const size_t ir_index, const size_t relative_index) const const Shape *GetRequiredInputShape(const size_t ir_index) const const Tensor *GetRequiredInputTensor(const size_t ir_index) const Shape *GetOutputShape(const size_t index)
Parent topic: InferShapeContext