// Copyright (c) ONNX Project Contributors // // SPDX-License-Identifier: Apache-2.0 #pragma once #include #include "onnx/common/assertions.h" #include "onnx/defs/function.h" #include "onnx/defs/schema.h" namespace ONNX_NAMESPACE::defs::nn::utils { /** * 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. */ std::vector getConvPoolStrides(InferenceContext& ctx, size_t n_input_dims); /** Implements shape and type propagation for Attention (23-). */ void AttentionPropagateElemTypeFromInputToOutput(InferenceContext& ctx); /** Implements CausalMask for Attention. */ bool AttentionAppendFunctionCausalMask( const FunctionBodyBuildContext& ctx, FunctionBuilder& builder, bool padding, bool cast_mask_to_bias = false); } // namespace ONNX_NAMESPACE::defs::nn::utils