File indexing completed on 2025-02-22 10:42:44
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <cmath>
0008 #include <vector>
0009
0010 #include "onnx/defs/schema.h"
0011 #include "onnx/defs/tensor_proto_util.h"
0012
0013 namespace ONNX_NAMESPACE {
0014
0015 void resizeShapeInference(InferenceContext& ctx);
0016
0017 void gridSampleShapeInference(InferenceContext& ctx);
0018
0019 void resizeShapeInferenceHelper(
0020 const TensorShapeProto& input_shape,
0021 const std::vector<float>& scales_data,
0022 TensorShapeProto* output_shape);
0023
0024 void resizeShapeInferenceHelper(
0025 const TensorShapeProto& input_shape,
0026 const std::vector<int64_t>& sizes_data,
0027 TensorShapeProto* output_shape);
0028
0029
0030 void resizeShapeInference_opset7_to_10(InferenceContext& ctx);
0031 void resizeShapeInference_opset11_to_12(InferenceContext& ctx);
0032 void resizeShapeInference_opset13_to_18(InferenceContext& ctx);
0033 void resizeShapeInference_opset18_to_19(InferenceContext& ctx);
0034
0035 void resizeShapeInferenceHelper_opset7_to_10(
0036 const TensorShapeProto& input_shape,
0037 const std::vector<float>& scales_data,
0038 TensorShapeProto* output_shape);
0039
0040 enum class KeepAspectRatioPolicy {
0041 STRETCH,
0042 NOT_LARGER,
0043 NOT_SMALLER,
0044 };
0045
0046 void KeepAspectRatioHelper(
0047 KeepAspectRatioPolicy policy,
0048 const TensorShapeProto& input_shape,
0049 const std::vector<int64_t>& axes,
0050 std::vector<int64_t>& sizes_data);
0051
0052 extern const char* NonZero_ver9_doc;
0053
0054 std::function<void(OpSchema&)> PadDocGenerator(const char* description, const char* mode_description);
0055 }