File indexing completed on 2025-02-22 10:42:44
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <cmath>
0008
0009 #include "onnx/defs/schema.h"
0010 #include "onnx/defs/tensor_proto_util.h"
0011
0012 namespace ONNX_NAMESPACE {
0013
0014
0015 constexpr const char* EMPTY_ZERO = "0";
0016 constexpr const char* EMPTY_ONE = "1";
0017 constexpr const char* EMPTY_UNDEFINED = "undefined";
0018 constexpr const char* EMPTY_MIN =
0019 "minus infinity (if supported by the datatype) or the minimum value of the data type otherwise";
0020 constexpr const char* EMPTY_MAX =
0021 "plus infinity (if supported by the datatype) or the maximum value of the data type otherwise";
0022 constexpr const char* EMPTY_MINUS_INF = "minus infinity (if supported by the datatype) or undefined otherwise";
0023
0024 std::function<void(OpSchema&)> ReduceOpGenerator(
0025 const char* name,
0026 const char* empty_value,
0027 bool supports_8bit_datatypes = false,
0028 bool axes_input = false,
0029 const char* func_body = nullptr,
0030 ContextDependentFunctionBodyBuilder function_builder = nullptr,
0031 bool supports_boolean_datatype = false);
0032
0033 inline std::function<void(OpSchema&)> ReduceOpDynamicAxes(const char* name, const char* empty_value) {
0034 return ReduceOpGenerator(name, empty_value, false, true, nullptr, nullptr, false);
0035 }
0036
0037 inline std::function<void(OpSchema&)>
0038 ReduceFunctionOp(const char* name, const char* empty_value, const char* func_body) {
0039 return ReduceOpGenerator(name, empty_value, false, true, func_body);
0040 }
0041
0042 }