operator
Classes
Conv2DOperator
Conv2DOperator(op: AirOperator, model: AirModel, platform: SocPlatform, prefix: str = 'aot', attributes: dict[str, str] = {})
CONV_2D operator.
This operator performs 2D convolution on the input tensor with the given filter tensor.
Parameters:
-
(opAirOperator) –The AIR operator to wrap.
-
(modelAirModel) –The AIR model.
-
(platformSocPlatform) –The target platform for code generation.
-
(prefixstr, default:'aot') –Prefix for generated code files. Defaults to "aot".
-
(attributesdict[str, str], default:{}) –Attributes for template values. Defaults to {}.
Functions
ctx_buf_required
Whether the selected convolution kernel dereferences a context buf.
Keyed on the kernel actually chosen in :meth:on_resolve, because
CONV_2D's dispatch table mixes kernels that require an im2col buffer,
kernels that require only the weight-sum buffer, and kernels that
ignore the context entirely. Two independent conditions:
- :data:
_CTX_BUF_KERNELS-- the kernel's entry point hard-requiresctx->buf. - :data:
_WEIGHT_SUM_BUF_KERNELS_MVE-- the kernel ignoresctxbut forwardsweight_sum_ctx->bufinto a routine that indexes it unchecked under MVE.
Both are satisfied by the same any-of backing check, since
:attr:CTX_BUF_BACKING_TENSOR_NAMES covers both tensor roles.
Returns:
compute_values
emit
Generate the source code for the operator.
Parameters:
-
(save_pathPath) –Path to save the generated code.