nn/utils.h#

Neural-network schema helpers, including onnx::getConvPoolStrides() and onnx::AttentionPropagateElemTypeFromInputToOutput().

Declares shared neural-network operator helpers.

This header provides utility APIs used by NN operator schemas, including Conv/Pool stride extraction, Attention type propagation, and function-body construction helpers.

namespace ONNX_LIGHT_NAMESPACE

Functions

std::vector<int64_t> getConvPoolStrides(InferenceContext &ctx, size_t n_input_dims)#

Reads and validates the ‘strides’ attribute for Conv/Pool shape inference. Returns the attribute value or a default value if the attribute is not present.

void AttentionPropagateElemTypeFromInputToOutput(InferenceContext &ctx)#

Implements shape and type propagation for Attention (23-).

bool AttentionAppendFunctionCausalMask(const FunctionBodyBuildContext &ctx, FunctionBuilder &builder, bool padding)#

Implements CausalMask for Attention.