Overview

Constructs a common KernelContext object, which is used as the input context of the operator Host in the actual execution phase.

The following figure shows the inheritance relationship of OpKernelContextBuilder.

This class is inherited from the OpContextBuilderBase class. Before the ContextHolder object construction, it is necessary to call OpType, OpName, and IONum (or IOInstanceNum) of OpContextBuilderBase to respectively set the operator type, name, and numbers of inputs and outputs, and to call the AppendAttr API to set operator attributes.

Header Files to Be Included

1
#include "base/context_builder/op_kernel_run_context_builder.h"

Public Member Functions

OpKernelContextBuilder &InputTensorDesc(size_t index, ge::DataType dtype, ge::Format origin_format, ge::Format storage_format, const gert::ExpandDimsType &expand_dims_type = {})
OpKernelContextBuilder &OutputTensorDesc(size_t index, ge::DataType dtype, ge::Format origin_format, ge::Format storage_format, const gert::ExpandDimsType &expand_dims_type = {})
OpKernelContextBuilder &Inputs(std::vector<void *> inputs)
OpKernelContextBuilder &Outputs(std::vector<void *> outputs)
ContextHolder<KernelContext> Build()