Overview

InferFormatContext is inherited from ExtendedKernelContext and is a context class used for format derivation. It provides the necessary input and output formats, input and output shapes, and input tensor access APIs during operator output format inference. InferFormatContext is the input parameter of the format inference function. For details about the function, see InferFormat.

The following figure shows the inheritance relationship of InferFormatContext.

KernelContext Class

Header Files to Be Included

1
#include <infer_format_context.h>

Public Member Functions

StorageFormat *GetInputFormat(const size_t index)
StorageFormat *GetRequiredInputFormat(const size_t ir_index)
StorageFormat *GetOptionalInputFormat(const size_t ir_index)
StorageFormat *GetDynamicInputFormat(const size_t ir_index, const size_t relative_index)
const Shape *GetInputShape(const size_t index) const
const Shape *GetRequiredInputShape(const size_t ir_index) const
const Shape *GetOptionalInputShape(const size_t ir_index) const
const Shape *GetDynamicInputShape(const size_t ir_index, const size_t relative_index) const
const Tensor *GetInputTensor(const size_t index) const
const Tensor *GetRequiredInputTensor(const size_t ir_index) const
const Tensor *GetOptionalInputTensor(const size_t ir_index) const
const Tensor *GetDynamicInputTensor(const size_t ir_index, const size_t relative_index) const
StorageFormat *GetOutputFormat(const size_t index)
StorageFormat *GetRequiredOutputFormat(const size_t ir_index)
StorageFormat *GetDynamicOutputFormat(const size_t ir_index, const size_t relative_index)