diff --git a/tmva/sofie/test/CMakeLists.txt b/tmva/sofie/test/CMakeLists.txt index 2a2d730a432a2..02242e5037536 100644 --- a/tmva/sofie/test/CMakeLists.txt +++ b/tmva/sofie/test/CMakeLists.txt @@ -10,56 +10,107 @@ ############################################################################ +# Look for needed Python modules +ROOT_FIND_PYTHON_MODULE(torch) + +# onnx 1.19.0 has a bug that makes this version unusable: +# https://github.com/onnx/onnx/issues/7249 +# 1.19.1 instead could be used +# In that case, we have to disable the "TestSofieModels" test, +# which imports onnx indirectly via torch.onnx +ROOT_FIND_PYTHON_MODULE(onnx) +if (ROOT_ONNX_FOUND AND DEFINED ROOT_ONNX_VERSION) + if(ROOT_ONNX_VERSION VERSION_EQUAL "1.19.0") + message(WARNING "Found broken onnx version ${ROOT_ONNX_VERSION} (see https://github.com/onnx/onnx/issues/7249). Some TMVA SOFIE tests will be disabled.") + set(broken_onnx TRUE) + endif() +endif() + +# The ONNX input models are not checked into the repository: they are created +# by generate_input_models.py, which runs as the SofieGenerateModels_ONNX test +# that the other ONNX tests depend on. Set ONNX_MODELS_DIR to use pre-existing +# models from a custom directory instead. if (NOT ONNX_MODELS_DIR) - set(ONNX_MODELS_DIR input_models) + if (ROOT_ONNX_FOUND AND NOT broken_onnx) + set(ONNX_MODELS_DIR ${CMAKE_CURRENT_BINARY_DIR}/input_models) + set(generate_onnx_models TRUE) + # Get the model names from the generator script (--list does not require + # the onnx module, only a Python interpreter). + execute_process( + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_input_models.py --list + OUTPUT_VARIABLE _onnx_model_names + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE _onnx_list_status) + if (NOT _onnx_list_status EQUAL 0) + message(FATAL_ERROR "Failed to list the SOFIE ONNX test models with generate_input_models.py") + endif() + string(REPLACE "\n" ";" ONNX_MODEL_NAMES "${_onnx_model_names}") + else() + message(WARNING "The onnx Python module is not usable: the ONNX input models for the TMVA SOFIE tests cannot be generated and the corresponding tests are disabled.") + endif() +else() + get_filename_component(ONNX_MODELS_DIR ${ONNX_MODELS_DIR} ABSOLUTE) + file(GLOB ONNX_FILES "${ONNX_MODELS_DIR}/*.onnx") + set(ONNX_MODEL_NAMES "") + foreach(onnx_file ${ONNX_FILES}) + get_filename_component(fname ${onnx_file} NAME_WE) + list(APPEND ONNX_MODEL_NAMES ${fname}) + endforeach() endif() -# Finding .onnx files to be parsed and creating the appropriate code to -# parse all file. It is much faster to combine all parsing in a single executable -# which will avoid initialization time (especially when using ROOT) -set(CAPTURE_STR "EmitModel( \"@1\", \"@2\");") -set(ALL_CAPTURES "") -# Finding .onnx files to be parsed and creating the appropriate command -file(GLOB ONNX_FILES "${ONNX_MODELS_DIR}/*.onnx") -foreach(onnx_file ${ONNX_FILES}) - get_filename_component(fname ${onnx_file} NAME_WE) - get_filename_component(fdir ${onnx_file} DIRECTORY) - string(REPLACE "@1" ${onnx_file} cap ${CAPTURE_STR}) - string(REPLACE "@2" ${fname} cap ${cap}) - list(APPEND ALL_CAPTURES ${cap}) -endforeach() -string(REPLACE ";" ";\n" EMIT_CAPTURES "${ALL_CAPTURES}") -configure_file(EmitFromONNX.cxx.in EmitFromONNX_all.cxx @ONLY) - -ROOTTEST_GENERATE_EXECUTABLE(emitFromONNX EmitFromONNX_all.cxx - LIBRARIES protobuf::libprotobuf ROOTTMVASofie ROOTTMVASofieParser - FIXTURES_SETUP sofie-compile-models-onnx-build) - -# silence protobuf warnings seen in version 3.0 and 3.6. Not needed from protobuf version 3.17 -target_compile_options(emitFromONNX PRIVATE -Wno-unused-parameter -Wno-array-bounds) - -ROOTTEST_ADD_TEST(SofieCompileModels_ONNX - COMMAND ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ./emitFromONNX ${onnx_file} ${CMAKE_CURRENT_BINARY_DIR}/${fname} - FIXTURES_REQUIRED sofie-compile-models-onnx-build - FIXTURES_SETUP sofie-compile-models-onnx -) - -# Creating a Google Test -if (BLAS_FOUND) # we need BLAS for compiling the models - ROOT_EXECUTABLE(TestCustomModelsFromONNX TestCustomModelsFromONNX.cxx - LIBRARIES Core GTest::gtest GTest::gtest_main +if (ONNX_MODELS_DIR) + # Creating the appropriate code to parse all ONNX model files. It is much + # faster to combine all parsing in a single executable which will avoid + # initialization time (especially when using ROOT) + set(CAPTURE_STR "EmitModel( \"@1\", \"@2\");") + set(ALL_CAPTURES "") + foreach(fname ${ONNX_MODEL_NAMES}) + string(REPLACE "@1" ${ONNX_MODELS_DIR}/${fname}.onnx cap ${CAPTURE_STR}) + string(REPLACE "@2" ${fname} cap ${cap}) + list(APPEND ALL_CAPTURES ${cap}) + endforeach() + string(REPLACE ";" ";\n" EMIT_CAPTURES "${ALL_CAPTURES}") + configure_file(EmitFromONNX.cxx.in EmitFromONNX_all.cxx @ONLY) + + ROOTTEST_GENERATE_EXECUTABLE(emitFromONNX EmitFromONNX_all.cxx + LIBRARIES protobuf::libprotobuf ROOTTMVASofie ROOTTMVASofieParser + FIXTURES_SETUP sofie-compile-models-onnx-build) + + # silence protobuf warnings seen in version 3.0 and 3.6. Not needed from protobuf version 3.17 + target_compile_options(emitFromONNX PRIVATE -Wno-unused-parameter -Wno-array-bounds) + + set(compile_models_fixtures sofie-compile-models-onnx-build) + if (generate_onnx_models) + ROOTTEST_ADD_TEST(SofieGenerateModels_ONNX + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_input_models.py --outdir ${ONNX_MODELS_DIR} + FIXTURES_SETUP sofie-generate-models-onnx + ) + list(APPEND compile_models_fixtures sofie-generate-models-onnx) + endif() + + ROOTTEST_ADD_TEST(SofieCompileModels_ONNX + COMMAND ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ./emitFromONNX + FIXTURES_REQUIRED ${compile_models_fixtures} + FIXTURES_SETUP sofie-compile-models-onnx ) - ROOTTEST_ADD_TEST(TestCustomModelsFromONNX - EXEC ./TestCustomModelsFromONNX - FIXTURES_REQUIRED sofie-compile-models-onnx) - if (clad) - ROOT_EXECUTABLE(TestCladAutodiff TestCladAutodiff.cxx + # Creating a Google Test + if (BLAS_FOUND) # we need BLAS for compiling the models + ROOT_EXECUTABLE(TestCustomModelsFromONNX TestCustomModelsFromONNX.cxx LIBRARIES Core GTest::gtest GTest::gtest_main ) - ROOTTEST_ADD_TEST(TestCladAutodiff - EXEC ./TestCladAutodiff + ROOTTEST_ADD_TEST(TestCustomModelsFromONNX + EXEC ./TestCustomModelsFromONNX FIXTURES_REQUIRED sofie-compile-models-onnx) + + if (clad) + ROOT_EXECUTABLE(TestCladAutodiff TestCladAutodiff.cxx + LIBRARIES Core GTest::gtest GTest::gtest_main + ) + ROOTTEST_ADD_TEST(TestCladAutodiff + EXEC ./TestCladAutodiff + FIXTURES_REQUIRED sofie-compile-models-onnx) + endif() endif() endif() @@ -70,22 +121,6 @@ if (BLAS_FOUND) endif() endif() -# Look for needed Python modules -ROOT_FIND_PYTHON_MODULE(torch) - -# onnx 1.19.0 has a bug that makes this version unusable: -# https://github.com/onnx/onnx/issues/7249 -# 1.19.1 instead could be used -# In that case, we have to disable the "TestSofieModels" test, -# which imports onnx indirectly via torch.onnx -ROOT_FIND_PYTHON_MODULE(onnx) -if (ROOT_ONNX_FOUND AND DEFINED ROOT_ONNX_VERSION) - if(ROOT_ONNX_VERSION VERSION_EQUAL "1.19.0") - message(WARNING "Found broken onnx version ${ROOT_ONNX_VERSION} (see https://github.com/onnx/onnx/issues/7249). Some TMVA SOFIE tests will be disabled.") - set(broken_onnx TRUE) - endif() -endif() - if (ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND NOT broken_onnx) configure_file(Conv1dModelGenerator.py Conv1dModelGenerator.py COPYONLY) configure_file(Conv2dModelGenerator.py Conv2dModelGenerator.py COPYONLY) diff --git a/tmva/sofie/test/TestCladAutodiff.cxx b/tmva/sofie/test/TestCladAutodiff.cxx index fd6c5fda2adfd..5ce6e4904b30a 100644 --- a/tmva/sofie/test/TestCladAutodiff.cxx +++ b/tmva/sofie/test/TestCladAutodiff.cxx @@ -2,8 +2,6 @@ constexpr auto modelHeaderSuffix = "_FromONNX_unoptimized.hxx"; constexpr auto modelDataSuffix = "_FromONNX_unoptimized.dat"; #include "test_helpers.h" -#include "input_models/references/Linear_16.ref.hxx" - #include "gtest/gtest.h" // Test differentiating a fully-connected neural network with Clad. @@ -12,9 +10,9 @@ TEST(ONNXClad, Linear16) { constexpr float TOLERANCE = DEFAULT_TOLERANCE; - // Preparing the standard all-ones input - std::vector input(1600); - std::fill_n(input.data(), input.size(), 1.0f); + SofieReference ref = readReference("Linear_16"); + // Mutable copy: the numeric differentiation below perturbs the input values + std::vector input = ref.f32("input0"); ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_16", input); @@ -135,13 +133,5 @@ float Linear_16_wrapper_num_diff(TMVA_SOFIE_Linear_16::Session const &session, f ADD_FAILURE() << "Further mismatches suppressed (total mismatches: " << mismatchCount << ")"; } - // Checking output size - EXPECT_EQ(output.size(), sizeof(Linear_16_ExpectedOutput::all_ones) / sizeof(float)); - - float *correct = Linear_16_ExpectedOutput::all_ones; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), TOLERANCE); } diff --git a/tmva/sofie/test/TestCustomModelsFromONNX.cxx b/tmva/sofie/test/TestCustomModelsFromONNX.cxx index 40aa1603fa731..02cc1762ad877 100644 --- a/tmva/sofie/test/TestCustomModelsFromONNX.cxx +++ b/tmva/sofie/test/TestCustomModelsFromONNX.cxx @@ -2,800 +2,282 @@ constexpr auto modelHeaderSuffix = "_FromONNX.hxx"; constexpr auto modelDataSuffix = "_FromONNX.dat"; #include "test_helpers.h" -#include "input_models/references/Linear_16.ref.hxx" -#include "input_models/references/Linear_32.ref.hxx" -#include "input_models/references/Linear_64.ref.hxx" -#include "input_models/references/LinearWithSelu.ref.hxx" -#include "input_models/references/Sub.ref.hxx" -#include "input_models/references/Add.ref.hxx" -#include "input_models/references/Mul.ref.hxx" -#include "input_models/references/Div.ref.hxx" -#include "input_models/references/Cast.ref.hxx" -#include "input_models/references/ReduceMean.ref.hxx" -#include "input_models/references/ReduceProd.ref.hxx" -#include "input_models/references/Shape.ref.hxx" -#include "input_models/references/Constant.ref.hxx" -#include "input_models/references/TopK.ref.hxx" -#include "input_models/references/ComplexTopK.ref.hxx" -#include "input_models/references/LinearWithLeakyRelu.ref.hxx" -#include "input_models/references/Tanh.ref.hxx" -#include "input_models/references/Erf.ref.hxx" -#include "input_models/references/LinearWithSigmoid.ref.hxx" -#include "input_models/references/ConvWithPadding.ref.hxx" -#include "input_models/references/ConvWithDilation.ref.hxx" -#include "input_models/references/ConvWithoutPadding.ref.hxx" -#include "input_models/references/ConvWithAutopadSameLower.ref.hxx" -#include "input_models/references/ConvWithAutopadSameUpper.ref.hxx" -#include "input_models/references/ConvWithStridesPadding.ref.hxx" -#include "input_models/references/ConvWithStridesNoPadding.ref.hxx" -#include "input_models/references/ConvWithAsymmetricPadding.ref.hxx" -#include "input_models/references/ConvAddRelu.ref.hxx" -#include "input_models/references/MaxPool1d.ref.hxx" -#include "input_models/references/MaxPool2d.ref.hxx" -#include "input_models/references/MaxPool2d_CeilMode.ref.hxx" -#include "input_models/references/MaxPool3d.ref.hxx" -#include "input_models/references/MaxPool2d_AsymPad.ref.hxx" -#include "input_models/references/Max.ref.hxx" -#include "input_models/references/MaxMultidirectionalBroadcast.ref.hxx" -#include "input_models/references/MinMultidirectionalBroadcast.ref.hxx" -#include "input_models/references/MeanMultidirectionalBroadcast.ref.hxx" -#include "input_models/references/SumMultidirectionalBroadcast.ref.hxx" -#include "input_models/references/AvgPool.ref.hxx" -#include "input_models/references/Pow.ref.hxx" -#include "input_models/references/Pow_broadcast.ref.hxx" -#include "input_models/references/RNNBatchwise.ref.hxx" -#include "input_models/references/RNNBidirectional.ref.hxx" -#include "input_models/references/RNNBidirectionalBatchwise.ref.hxx" -#include "input_models/references/RNNDefaults.ref.hxx" -#include "input_models/references/RNNSeqLength.ref.hxx" -#include "input_models/references/RNNSequence.ref.hxx" -#include "input_models/references/RNNSequenceBatchwise.ref.hxx" -#include "input_models/references/LSTMBatchwise.ref.hxx" -#include "input_models/references/LSTMBidirectional.ref.hxx" -#include "input_models/references/LSTMDefaults.ref.hxx" -#include "input_models/references/LSTMInitialBias.ref.hxx" -#include "input_models/references/LSTMPeepholes.ref.hxx" -#include "input_models/references/GRUBatchwise.ref.hxx" -#include "input_models/references/GRUBidirectional.ref.hxx" -#include "input_models/references/GRUDefaults.ref.hxx" -#include "input_models/references/GRUInitialBias.ref.hxx" -#include "input_models/references/GRUSeqLength.ref.hxx" -#include "input_models/references/Softmax1d.ref.hxx" -#include "input_models/references/Softmax2d.ref.hxx" -#include "input_models/references/Softmax3d.ref.hxx" -#include "input_models/references/Softmax4d.ref.hxx" -#include "input_models/references/ConvTranspose1d.ref.hxx" -#include "input_models/references/ConvTranspose2d.ref.hxx" -// #include "input_models/references/ConvTranspose3d.ref.hxx" -#include "input_models/references/ConvTransposeBias2d.ref.hxx" -#include "input_models/references/ConvTransposeBias2dBatched.ref.hxx" -#include "input_models/references/Sqrt.ref.hxx" -#include "input_models/references/Reciprocal.ref.hxx" -#include "input_models/references/Neg.ref.hxx" -#include "input_models/references/Exp.ref.hxx" -#include "input_models/references/AddBroadcast1.ref.hxx" -#include "input_models/references/AddBroadcast2.ref.hxx" -#include "input_models/references/AddBroadcast3.ref.hxx" -#include "input_models/references/AddBroadcast4.ref.hxx" -#include "input_models/references/AddBroadcast5.ref.hxx" -#include "input_models/references/AddBroadcast6.ref.hxx" -#include "input_models/references/AddBroadcast7.ref.hxx" -#include "input_models/references/LayerNormalization2d.hxx" -#include "input_models/references/LayerNormalization4d.hxx" -#include "input_models/references/ExpandSameSize.ref.hxx" -#include "input_models/references/ExpandDiffSize.ref.hxx" -#include "input_models/references/GatherAxis0.ref.hxx" -#include "input_models/references/GatherAxis1.ref.hxx" -#include "input_models/references/GatherAxis2.ref.hxx" -#include "input_models/references/GatherAxis3.ref.hxx" -#include "input_models/references/Gather2d.ref.hxx" -#include "input_models/references/GatherNegativeIndices.ref.hxx" -#include "input_models/references/Slice.ref.hxx" -#include "input_models/references/Slice_Default_Axis.ref.hxx" -#include "input_models/references/Slice_Default_Steps.ref.hxx" -#include "input_models/references/Slice_Neg.ref.hxx" -#include "input_models/references/Log.ref.hxx" -#include "input_models/references/Elu.ref.hxx" -#include "input_models/references/Gelu.ref.hxx" -#include "input_models/references/HardSigmoid.ref.hxx" -#include "input_models/references/HardSwish.ref.hxx" -#include "input_models/references/Equal.ref.hxx" -#include "input_models/references/EluAlpha.ref.hxx" -#include "input_models/references/LessOrEqual.ref.hxx" -#include "input_models/references/GreaterOrEqual.ref.hxx" -#include "input_models/references/Less.ref.hxx" -#include "input_models/references/Greater.ref.hxx" -#include "input_models/references/EyeLike.ref.hxx" -#include "input_models/references/RangeFloat.ref.hxx" -#include "input_models/references/RangeInt.ref.hxx" -#include "input_models/references/Tile5D.ref.hxx" -#include "input_models/references/Swish.ref.hxx" - #include "gtest/gtest.h" TEST(ONNX, Linear16) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(1600); - std::fill_n(input.data(), input.size(), 1.0f); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_16", input); + SofieReference ref = readReference("Linear_16"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Linear_16_ExpectedOutput::all_ones)); - - float *correct = Linear_16_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_16", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } /*TEST(ONNX, Linear32RootFeature) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(3200); - std::fill_n(input.data(), input.size(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_32", input); + SofieReference ref = readReference("Linear_32"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Linear_32_ExpectedOutput::all_ones)); - - float *correct = Linear_32_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_32", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); }*/ TEST(ONNX, Linear32) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(3200); - std::fill_n(input.data(), input.size(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_32", input); + SofieReference ref = readReference("Linear_32"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Linear_32_ExpectedOutput::all_ones)); - - float *correct = Linear_32_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_32", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, Sub) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input1({ - 1, 2 - }); - std::vector input2({ - 0, 1 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Sub", input1, input2); - - // Checking output size - EXPECT_EQ(output.size(), std::size(Sub_ExpectedOutput::outputs)); +{ + SofieReference ref = readReference("Sub"); - float *correct = Sub_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Sub", ref.f32("input0"), ref.f32("input1")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} TEST(ONNX, Add) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input1({ - 1, 2 - }); - std::vector input2({ - 0, 1 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Add", input1, input2); - - // Checking output size - EXPECT_EQ(output.size(), std::size(Add_ExpectedOutput::outputs)); +{ + SofieReference ref = readReference("Add"); - float *correct = Add_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Add", ref.f32("input0"), ref.f32("input1")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} TEST(ONNX, Mul) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input1({ - 1, 2 - }); - std::vector input2({ - 0, 1 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Mul", input1, input2); - - // Checking output size - EXPECT_EQ(output.size(), std::size(Mul_ExpectedOutput::outputs)); +{ + SofieReference ref = readReference("Mul"); - float *correct = Mul_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Mul", ref.f32("input0"), ref.f32("input1")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} TEST(ONNX, Div) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input1({ - 4, 2 - }); - std::vector input2({ - 2, 2 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Div", input1, input2); - - // Checking output size - EXPECT_EQ(output.size(), std::size(Div_ExpectedOutput::outputs)); +{ + SofieReference ref = readReference("Div"); - float *correct = Div_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Div", ref.f32("input0"), ref.f32("input1")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} TEST(ONNX, Neg) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - -1.9100, 1.8811, -1.7269, -0.1094, -0.0145, 0.2509, 0.5893, -2.2733, - -0.7077, 1.0645, -0.8607, 0.2085 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Neg", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(Neg_ExpectedOutput::outputs)); +{ + SofieReference ref = readReference("Neg"); - float *correct = Neg_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Neg", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} TEST(ONNX, Elu) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - 1.0, -2.0, 3.0, 0.5, -1.0, 2.0 - }); +{ + SofieReference ref = readReference("Elu"); - ASSERT_INCLUDE_AND_RUN(std::vector, "Elu", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "Elu", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output.size(), std::size(Elu_ExpectedOutput::outputs)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} +TEST(ONNX, EluAlpha) +{ + SofieReference ref = readReference("EluAlpha"); - float *correct = Elu_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "EluAlpha", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } -TEST(ONNX, EluAlpha) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - // Regression test for alpha != 1.0 (fixes #21539) - std::vector input({ - 1.0, -2.0, 3.0, 0.5, -1.0, 2.0 - }); - ASSERT_INCLUDE_AND_RUN(std::vector, "EluAlpha", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(EluAlpha_ExpectedOutput::outputs)); - float *correct = EluAlpha_ExpectedOutput::outputs; - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} TEST(ONNX, Constant) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input (none for Constant Op) + SofieReference ref = readReference("Constant"); ASSERT_INCLUDE_AND_RUN_0(std::vector, "Constant"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Constant_ExpectedOutput::outputs)); - - float *correct = Constant_ExpectedOutput::outputs; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ComplexTopK) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input({ - 9.0000, 8.0000, 4.5000, 1.7000, 2.9000, 3.2000, 4.0000, 2.6000, 7.4000, - 3.5000, 5.6000, 7.1000, 9.8000, 1.1000, 3.3000, 6.2000, 8.4000, 0.7000, - 2.2000, 3.3000, 4.4000, 5.5000, 6.6000, 7.7000, 8.8000, 9.9000, 1.0000, - - 1.0000, 2.0000, 3.0000, 4.0000, 5.0000, 6.0000, 7.0000, 8.0000, 9.0000, - 9.0000, 8.0000, 7.0000, 6.0000, 5.0000, 4.0000, 3.0000, 2.0000, 1.0000, - 5.0000, 4.0000, 3.0000, 2.0000, 1.0000, 6.0000, 7.0000, 8.0000, 9.0000 }); - - ASSERT_INCLUDE_AND_RUN(TupleFloatInt64_t, "ComplexTopK", input); - std::vector values = std::get<0>(output); - std::vector indexes = std::get<1>(output); - - // Checking output size - EXPECT_EQ(values.size(), std::size(ComplexTopK_ExpectedOutput::values)); + SofieReference ref = readReference("ComplexTopK"); -float *correct_values = ComplexTopK_ExpectedOutput::values; - -// Checking every output value, one by one -for (size_t i = 0; i < values.size(); ++i) { - EXPECT_LE(std::abs(values[i] - correct_values[i]), TOLERANCE); -} - - -// Checking output size -EXPECT_EQ(indexes.size(), std::size(ComplexTopK_ExpectedOutput::indexes)); - -float *correct_indexes = ComplexTopK_ExpectedOutput::indexes; - -// Checking every output value, one by one -for (size_t i = 0; i < indexes.size(); ++i) { - EXPECT_LE(std::abs(indexes[i] - correct_indexes[i]), TOLERANCE); -} + ASSERT_INCLUDE_AND_RUN(TupleFloatInt64_t, "ComplexTopK", ref.f32("input0")); + expectNear(std::get<0>(output), ref.f32("output0"), DEFAULT_TOLERANCE); + expectEqual(std::get<1>(output), ref.i64("output1")); } TEST(ONNX, TopK) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("TopK"); - // Preparing the standard all-ones input - std::vector input({9.0, 8.0, 4.5, 1.7, 2.9, 3.2, 4, 2.6, 7.4}); + ASSERT_INCLUDE_AND_RUN(TupleFloatInt64_t, "TopK", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(TupleFloatInt64_t, "TopK", input); - std::vector values = std::get<0>(output); - std::vector indexes = std::get<1>(output); - - // Checking output size - EXPECT_EQ(values.size(), std::size(TopK_ExpectedOutput::values)); - - float *correct_values = TopK_ExpectedOutput::values; - - // Checking every output value, one by one - for (size_t i = 0; i < values.size(); ++i) { - EXPECT_LE(std::abs(values[i] - correct_values[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(indexes.size(), std::size(TopK_ExpectedOutput::indexes)); - - float *correct_indexes= TopK_ExpectedOutput::indexes; - - // Checking every output value, one by one - for (size_t i = 0; i < indexes.size(); ++i) { - EXPECT_LE(std::abs(indexes[i] - correct_indexes[i]), TOLERANCE); - } + expectNear(std::get<0>(output), ref.f32("output0"), DEFAULT_TOLERANCE); + expectEqual(std::get<1>(output), ref.i64("output1")); } TEST(ONNX, EyeLike) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "EyeLike", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(EyeLike_ExpectedOutput::output)); +{ + SofieReference ref = readReference("EyeLike"); - float *correct = EyeLike_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector, "EyeLike", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} TEST(ONNX, Cast) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - 1,2,3,4,5,6 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Cast", input); + SofieReference ref = readReference("Cast"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Cast_ExpectedOutput::outputs)); - - float *correct = Cast_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Cast", ref.i64("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f64("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, Linear64) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(6400); - std::fill_n(input.data(), input.size(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_64", input); + SofieReference ref = readReference("Linear_64"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Linear_64_ExpectedOutput::all_ones)); - - float *correct = Linear_64_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "Linear_64", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, LinearWithSelu) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(48); - std::fill_n(input.data(), input.size(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "LinearWithSelu", input); + SofieReference ref = readReference("LinearWithSelu"); - // Checking output size - EXPECT_EQ(output.size(), std::size(LinearWithSelu_ExpectedOutput::all_ones)); - - float *correct = LinearWithSelu_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "LinearWithSelu", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, Tanh) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the random input - std::vector input({ - -0.3896, -0.3521, 0.0363, 1.0962, 0.5085, -0.8523, -0.6766, 0.2421, - 1.5971, 1.3873, -0.2112, -0.6895, -0.5069, -2.1395, -0.7087, 1.1658, - 1.3493, 0.8132, 1.7156, -0.8637, -0.1971, 0.0411, -0.5662, -0.2516 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Tanh", input); + SofieReference ref = readReference("Tanh"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Tanh_ExpectedOutput::outputs)); - - float *correct = Tanh_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Tanh", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, Erf) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the random input - std::vector input({ - -1.0412, 0.1918, 0.9985, -0.5959, 0.6842, -2.4718, 0.1804, 0.6851, - 1.5646, -1.4981, 0.4248, -0.8504 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Erf", input); + SofieReference ref = readReference("Erf"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Erf_ExpectedOutput::outputs)); - - float *correct = Erf_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Erf", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, Log) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the random input - std::vector input({ - 1, 2, 3, 4 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Log", input); + SofieReference ref = readReference("Log"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Log_ExpectedOutput::outputs)); - - float *correct = Log_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Log", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, LinearWithLeakyRelu) { - constexpr float TOLERANCE = 1; - - // Preparing the standard all-ones input - std::vector input({ - 0.4369, -0.6882, 1.0309, -1.0263, -0.1519, 1.2237, -0.7054, -0.1762, - -0.6811, -2.2597, 1.0388, -0.7993, 0.1468, 1.3257, -0.4714, -0.0958, - 0.7057, -0.3749, -0.3310, 0.0986, -0.1370, 0.0832, -1.6465, -0.2793 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "LinearWithLeakyRelu", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(LinearWithLeakyRelu_ExpectedOutput::outputs)); + SofieReference ref = readReference("LinearWithLeakyRelu"); - float *correct = LinearWithLeakyRelu_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "LinearWithLeakyRelu", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), 1); } TEST(ONNX, LinearWithSigmoid) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(48); - std::fill_n(input.data(), input.size(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "LinearWithSigmoid", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(LinearWithSigmoid_ExpectedOutput::all_ones)); + SofieReference ref = readReference("LinearWithSigmoid"); - float *correct = LinearWithSigmoid_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "LinearWithSigmoid", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithPadding) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(25); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithPadding", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvWithPadding_ExpectedOutput::all_ones)); + SofieReference ref = readReference("ConvWithPadding"); - float *correct = ConvWithPadding_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithPadding", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithoutPadding) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(25); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithoutPadding", input); + SofieReference ref = readReference("ConvWithoutPadding"); - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvWithoutPadding_ExpectedOutput::all_ones)); - - float *correct = ConvWithoutPadding_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithoutPadding", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithAutopadSameLower) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(25); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithAutopadSameLower", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvWithAutopadSameLower_ExpectedOutput::all_ones)); + SofieReference ref = readReference("ConvWithAutopadSameLower"); - float *correct = ConvWithAutopadSameLower_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithAutopadSameLower", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithAutopadSameUpper) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("ConvWithAutopadSameUpper"); - // Input (1,1,5,5) with values 0..24; kernel (1,1,3,3) all-ones, auto_pad=SAME_UPPER, stride=1 - // Odd kernel: total_pad=2 per dim, begin=1 end=1 (symmetric); output shape (1,1,5,5) - std::vector input(25); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithAutopadSameUpper", input); - - // Checking output size - EXPECT_EQ(output.size(), sizeof(ConvWithAutopadSameUpper_ExpectedOutput::output) / sizeof(float)); - - float *correct = ConvWithAutopadSameUpper_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithAutopadSameUpper", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithStridesPadding) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(35); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithStridesPadding", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvWithStridesPadding_ExpectedOutput::all_ones)); + SofieReference ref = readReference("ConvWithStridesPadding"); - float *correct = ConvWithStridesPadding_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithStridesPadding", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithDilation) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(49); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithDilation", input); + SofieReference ref = readReference("ConvWithDilation"); - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvWithDilation_ExpectedOutput::all_ones)); - - float *correct = ConvWithDilation_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithDilation", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithStridesNoPadding) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("ConvWithStridesNoPadding"); - // Preparing the standard all-ones input - std::vector input(35); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithStridesNoPadding", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithStridesNoPadding", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvWithStridesNoPadding_ExpectedOutput::all_ones)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - float *correct = ConvWithStridesNoPadding_ExpectedOutput::all_ones; +TEST(ONNX, ConvAddRelu) +{ + SofieReference ref = readReference("ConvAddRelu"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, ConvAddRelu) -{ - // Regression test for the fusion of Conv and Add into a single Conv - // operator with bias: the parser used to mark the Add node as fused - // without creating the fused operator, so the type of the Add output was - // never registered and parsing the following Relu node failed. + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvAddRelu", ref.f32("input0")); - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing a ramp input starting at -7, so that the Relu clips part of - // the fused Conv+Add output - std::vector input(16); - std::iota(input.begin(), input.end(), -7.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvAddRelu", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvAddRelu_ExpectedOutput::outputs)); - - float *correct = ConvAddRelu_ExpectedOutput::outputs; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ConvWithDynShapeStride) @@ -823,228 +305,83 @@ TEST(ONNX, ConvWithDynShapeStride) // Disables test (asymmetric padding not supported) TEST(DISABLED_ONNX, ConvWithAsymmetricPadding) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(35); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithAsymmetricPadding", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvWithAsymmetricPadding_ExpectedOutput::all_ones)); + SofieReference ref = readReference("ConvWithAsymmetricPadding"); - float *correct = ConvWithAsymmetricPadding_ExpectedOutput::all_ones; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvWithAsymmetricPadding", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, MaxPool1d){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({0.0907, 0.1029, 0.8143, 1.4497, -0.7785, 0.3825, -0.3764, - 1.5785, -0.0835, 0.1622, - 1.5867, 0.9823, -0.8821, 0.4439, -0.1378, -0.2273, -0.0198, - -2.0230, 0.0905, 0.6674, - -1.4290, -1.3100, -0.9439, -0.0833, -0.1919, 0.6886, 0.9389, - -1.2914, -1.3584, -2.0341, - -0.3269, 0.1704, 1.1776, 1.3972, -1.8874, -1.5334, 1.1541, - 0.3011, 0.6569, -2.3504, - 0.4033, 0.1142, 2.2846, -1.3948, -0.8573, 0.5756, -1.0864, - 0.2283, 0.8947, 1.7627, - -0.1657, 0.0649, -1.6066, 0.4162, -1.1525, -0.8184, 1.1324, - -1.1086, 0.1061, 1.0071}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool1d", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(MaxPool1d_ExpectedOutput::output)); - - float *correct = MaxPool1d_ExpectedOutput::output; +TEST(ONNX, MaxPool1d) +{ + SofieReference ref = readReference("MaxPool1d"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool1d", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, MaxPool2d){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - 0.6266, 0.1656, 0.2753, -0.4558, -1.4592, 0.9285, -1.3410, - 1.3223, -0.5936, -1.3648, - -0.2989, 0.5901, -0.8845, -0.0433, 0.8314, -1.7159, -0.5765, - 0.8678, 1.0257, 0.7847, - -0.3421, -1.2364, -0.5805, 0.4421, 1.2184, 0.5043, 1.6823, - -1.0483, -2.2798, -1.8927, - 0.7716, 0.0405, 0.3121, -0.3011, -0.3266, -1.9660, 1.0837, - 0.2317, 0.9084, -0.3285, - -0.9398, -0.2065, -0.9499, -0.9739, -0.1288, -0.1375, -1.2612, - 0.8810, 0.8506, 0.4455 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool2d", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(MaxPool2d_ExpectedOutput::output)); - - float *correct = MaxPool2d_ExpectedOutput::output; +TEST(ONNX, MaxPool2d) +{ + SofieReference ref = readReference("MaxPool2d"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool2d", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, MaxPool2d_AsymPad) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // 1x1x4x4 input with values 0..15 - std::vector input({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}); + SofieReference ref = readReference("MaxPool2d_AsymPad"); - ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool2d_AsymPad", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool2d_AsymPad", ref.f32("input0")); - // pads=[0,1,0,1] (width padded, height not) gives a 1x1x3x5 output; - // the pre-fix code mis-read the pads and produced a 4x4 grid instead - EXPECT_EQ(output.size(), std::size(MaxPool2d_AsymPad_ExpectedOutput::output)); - - float *correct = MaxPool2d_AsymPad_ExpectedOutput::output; - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, MaxPool2d_CeilMode) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // 1x1x5x5 input: values 0..24; MaxPool kernel=2x2 stride=2 ceil_mode=1 -> 1x1x3x3 output - std::vector input(25); - for (int i = 0; i < 25; i++) - input[i] = static_cast(i); + SofieReference ref = readReference("MaxPool2d_CeilMode"); - ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool2d_CeilMode", input); - EXPECT_EQ(output.size(), std::size(MaxPool2d_CeilMode_ExpectedOutput::output)); + ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool2d_CeilMode", ref.f32("input0")); - float *correct = MaxPool2d_CeilMode_ExpectedOutput::output; - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, MaxPool3d){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - -2.6496, 1.0476, -0.5153, - 0.3771, 0.4129, -0.3077, - -0.8717, -0.8040, -0.3525, - - -0.1765, -0.3364, 0.8737, - -0.2381, -0.8297, 0.4666, - 0.6984, -0.6760, 0.6298, - - 1.3833, 0.1101, 0.2039, - -0.5477, 0.2341, 0.9181, - 0.3842, 0.2428, 1.7924 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool3d", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(MaxPool3d_ExpectedOutput::output)); - - float *correct = MaxPool3d_ExpectedOutput::output; +TEST(ONNX, MaxPool3d) +{ + SofieReference ref = readReference("MaxPool3d"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "MaxPool3d", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, AvgPool){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - 0.4764, -0.1976, 1.6506, -0.2421, 0.6412, 1.9985, 0.3938, - 0.1347, 0.2204, -0.7503, - 0.2139, 0.7285, -0.0210, -0.4585, -1.5333, -0.4772, 0.5560, - 0.6323, -2.5372, 1.4906, - -1.1062, -0.9703, 0.2366, -0.9184, 0.3014, 0.7985, -0.6841, - -2.2854, -2.7728, -1.2806, - -1.0947, -0.5990, -0.3033, -1.9042, -0.5403, 0.2332, 0.9215, - -0.1549, 0.0557, -0.5567, - -1.4971, 0.5386, -0.2922, 0.4860, -0.3973, -0.4624, 0.4514, - 0.2385, 0.3783, -1.0500 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AvgPool", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(AvgPool_ExpectedOutput::output)); - - float *correct = AvgPool_ExpectedOutput::output; +TEST(ONNX, AvgPool) +{ + SofieReference ref = readReference("AvgPool"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "AvgPool", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Pow){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input1({ - 1, 2, 3 - }); - std::vector input2({ - 4, 5, 6 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Pow", input1, input2); - // Checking output size - EXPECT_EQ(output.size(), std::size(Pow_ExpectedOutput::outputs)); - - float *correct = Pow_ExpectedOutput::outputs; +TEST(ONNX, Pow) +{ + SofieReference ref = readReference("Pow"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "Pow", ref.f32("input0"), ref.f32("input1")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Pow_broadcast){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input1({ - 1, 2, 3, 3, 4, 5 - }); - std::vector input2({ - 2, 3, 4, 2, 3, 4 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Pow_broadcast", input1, input2); - // Checking output size - EXPECT_EQ(output.size(), std::size(Pow_broadcast_ExpectedOutput::outputs)); - - float *correct = Pow_broadcast_ExpectedOutput::outputs; +TEST(ONNX, Pow_broadcast) +{ + SofieReference ref = readReference("Pow_broadcast"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "Pow_broadcast", ref.f32("input0"), ref.f32("input1")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, FMod_ConstantFolding) @@ -1069,26 +406,13 @@ TEST(ONNX, Mod_ConstantFolding) EXPECT_EQ(output[i], correct_output[i]); } - TEST(ONNX, ReduceMean){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - 5, 2, 3, - 5, 5, 4 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "ReduceMean", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(ReduceMean_ExpectedOutput::output)); - - float *correct = ReduceMean_ExpectedOutput::output; + TEST(ONNX, ReduceMean) +{ + SofieReference ref = readReference("ReduceMean"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "ReduceMean", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ReduceMean_kFirst) @@ -1106,26 +430,13 @@ TEST(ONNX, ReduceMean_kFirst) } } - TEST(ONNX, ReduceProd){ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input({ - 5, 2, 3, - 5, 5, 4 - }); - - ASSERT_INCLUDE_AND_RUN(std::vector, "ReduceProd", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(ReduceProd_ExpectedOutput::output)); - - float *correct = ReduceProd_ExpectedOutput::output; + TEST(ONNX, ReduceProd) +{ + SofieReference ref = readReference("ReduceProd"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "ReduceProd", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ReduceSum){ @@ -1181,1364 +492,437 @@ TEST(ONNX, ReduceSumSquare){ } TEST(ONNX, Max) - { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +{ + SofieReference ref = readReference("Max"); - // Preparing the standard input - std::vector input1({ - 1.0, 2.0, -1.0 - }); - std::vector input2({ - 3.0, 0.0, 4.0 - }); + ASSERT_INCLUDE_AND_RUN(std::vector, "Max", ref.f32("input0"), ref.f32("input1")); - ASSERT_INCLUDE_AND_RUN(std::vector, "Max", input1, input2); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - // Checking output size - EXPECT_EQ(output.size(), std::size(Max_ExpectedOutput::outputs)); +TEST(ONNX, MaxMultidirectionalBroadcast) +{ + SofieReference ref = readReference("MaxMultidirectionalBroadcast"); - float *correct = Max_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN( + std::vector, + "MaxMultidirectionalBroadcast", + ref.f32("input0"), + ref.f32("input1"), + ref.f32("input2")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} -TEST(ONNX, MaxMultidirectionalBroadcast) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, MinMultidirectionalBroadcast) +{ + SofieReference ref = readReference("MinMultidirectionalBroadcast"); - std::vector a({0.35974154, -2.20873388, 0.95746274}); - std::vector b({0.75901985, -0.46544461, -0.34920575, -0.1460754 , 0.08269051, -0.70045695}); - std::vector c({-0.41468981, -0.46591926, 0.56172534, 0.05616931}); + ASSERT_INCLUDE_AND_RUN( + std::vector, + "MinMultidirectionalBroadcast", + ref.f32("input0"), + ref.f32("input1"), + ref.f32("input2")); - ASSERT_INCLUDE_AND_RUN(std::vector, "MaxMultidirectionalBroadcast", a, b, c); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - EXPECT_EQ(output.size(), std::size(MaxMultidirectionalBroadcast_ExpectedOutput::output)); +TEST(ONNX, MeanMultidirectionalBroadcast) +{ + SofieReference ref = readReference("MeanMultidirectionalBroadcast"); - float* correct = MaxMultidirectionalBroadcast_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN( + std::vector, + "MeanMultidirectionalBroadcast", + ref.f32("input0"), + ref.f32("input1"), + ref.f32("input2")); - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, MinMultidirectionalBroadcast) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, SumMultidirectionalBroadcast) +{ + SofieReference ref = readReference("SumMultidirectionalBroadcast"); - std::vector a({0.35974154, -2.20873388, 0.95746274}); - std::vector b({0.75901985, -0.46544461, -0.34920575, -0.1460754 , 0.08269051, -0.70045695}); - std::vector c({-0.41468981, -0.46591926, 0.56172534, 0.05616931}); + ASSERT_INCLUDE_AND_RUN( + std::vector, + "SumMultidirectionalBroadcast", + ref.f32("input0"), + ref.f32("input1"), + ref.f32("input2")); - ASSERT_INCLUDE_AND_RUN(std::vector, "MinMultidirectionalBroadcast", a, b, c); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - EXPECT_EQ(output.size(), std::size(MinMultidirectionalBroadcast_ExpectedOutput::output)); +TEST(ONNX, Shape) +{ + SofieReference ref = readReference("Shape"); - float* correct = MinMultidirectionalBroadcast_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector, "Shape", ref.f32("input0")); - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, MeanMultidirectionalBroadcast) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, RNNBatchwise) +{ + SofieReference ref = readReference("RNNBatchwise"); - std::vector a({0.35974154, -2.20873388, 0.95746274}); - std::vector b({0.75901985, -0.46544461, -0.34920575, -0.1460754 , 0.08269051, -0.70045695}); - std::vector c({-0.41468981, -0.46591926, 0.56172534, 0.05616931}); + ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNBatchwise", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "MeanMultidirectionalBroadcast", a, b, c); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} - EXPECT_EQ(output.size(), std::size(MeanMultidirectionalBroadcast_ExpectedOutput::output)); +TEST(ONNX, RNNBidirectional) +{ + SofieReference ref = readReference("RNNBidirectional"); - float* correct = MeanMultidirectionalBroadcast_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNBidirectional", ref.f32("input0")); - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); } -TEST(ONNX, SumMultidirectionalBroadcast) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, RNNBidirectionalBatchwise) +{ + SofieReference ref = readReference("RNNBidirectionalBatchwise"); - std::vector a({0.35974154, -2.20873388, 0.95746274}); - std::vector b({0.75901985, -0.46544461, -0.34920575, -0.1460754 , 0.08269051, -0.70045695}); - std::vector c({-0.41468981, -0.46591926, 0.56172534, 0.05616931}); + ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNBidirectionalBatchwise", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "SumMultidirectionalBroadcast", a, b, c); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} - EXPECT_EQ(output.size(), std::size(SumMultidirectionalBroadcast_ExpectedOutput::output)); +TEST(ONNX, RNNDefaults) +{ + SofieReference ref = readReference("RNNDefaults"); - float* correct = SumMultidirectionalBroadcast_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNDefaults", ref.f32("input0")); - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); } -TEST(ONNX, Shape){ - // test of Shape. Use shape operator to get shape and create a tensor equal to input shape and multiply the two - // Avoid test directly Shape otherwise get a compilation warning for the input that is not used in infer function - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, RNNSeqLength) +{ + SofieReference ref = readReference("RNNSeqLength"); - // Preparing the input ( a tensor of shape [1,2,3]) - std::vector input( {1,2,3,4,5,6} ); + ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNSeqLength", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "Shape", input); - // Checking output size - EXPECT_EQ(output.size(), std::size(Shape_ExpectedOutput::outputs)); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} - float *correct = Shape_ExpectedOutput::outputs; +TEST(ONNX, RNNSequence) +{ + SofieReference ref = readReference("RNNSequence"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNSequence", ref.f32("input0")); + + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); } -TEST(ONNX, RNNBatchwise) +TEST(ONNX, RNNSequenceBatchwise) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("RNNSequenceBatchwise"); - // Preparing the standard all-ones input - std::vector input(6); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNBatchwise", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; + ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNSequenceBatchwise", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output_y.size(), std::size(RNNBatchwise_ExpectedOutput::all_ones)); - EXPECT_EQ(output_yh.size(), std::size(RNNBatchwise_ExpectedOutput::all_ones)); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} - float *correct = RNNBatchwise_ExpectedOutput::all_ones; +TEST(ONNX, LSTMBatchwise) +{ + SofieReference ref = readReference("LSTMBatchwise"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct[i]), TOLERANCE); - EXPECT_LE(std::abs(output_yh[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMBatchwise", ref.f32("input0")); + + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); } -TEST(ONNX, RNNBidirectional) +TEST(ONNX, LSTMBidirectional) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("LSTMBidirectional"); - // Preparing the standard all-ones input - std::vector input({0., 0.01, 0.02, 0.03, 0.04, 0.05, - 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, - 0.12, 0.13, 0.14, 0.15, 0.16, 0.17}); - ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNBidirectional", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; + ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMBidirectional", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output_y.size(), std::size(RNNBidirectional_ExpectedOutput::all_ones_y)); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); + expectNear(output[2], ref.f32("output2"), DEFAULT_TOLERANCE); +} - float *correct_y = RNNBidirectional_ExpectedOutput::all_ones_y; +TEST(ONNX, LSTMDefaults) +{ + SofieReference ref = readReference("LSTMDefaults"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMDefaults", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(RNNBidirectional_ExpectedOutput::all_ones_yh)); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} + +TEST(ONNX, LSTMInitialBias) +{ + SofieReference ref = readReference("LSTMInitialBias"); - float *correct_yh = RNNBidirectional_ExpectedOutput::all_ones_yh; + ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMInitialBias", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); } -TEST(ONNX, RNNBidirectionalBatchwise) +TEST(ONNX, LSTMPeepholes) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("LSTMPeepholes"); - // Preparing the standard all-ones input - std::vector input({ - 0, 0.01, 0.06, 0.07, 0.12, 0.13, - 0.02, 0.03, 0.08, 0.09, 0.14, 0.15, - 0.04, 0.05, 0.1, 0.11, 0.16, 0.17}); - ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNBidirectionalBatchwise", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; + ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMPeepholes", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output_y.size(), std::size(RNNBidirectionalBatchwise_ExpectedOutput::all_ones_y)); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} + +// GRU tests +TEST(ONNX, GRUBatchwise) +{ + SofieReference ref = readReference("GRUBatchwise"); - float *correct_y = RNNBidirectionalBatchwise_ExpectedOutput::all_ones_y; + ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUBatchwise", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(RNNBidirectionalBatchwise_ExpectedOutput::all_ones_yh)); +TEST(ONNX, GRUBidirectional) +{ + SofieReference ref = readReference("GRUBidirectional"); - float *correct_yh = RNNBidirectionalBatchwise_ExpectedOutput::all_ones_yh; + ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUBidirectional", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); } -TEST(ONNX, RNNDefaults) +TEST(ONNX, GRUDefaults) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("GRUDefaults"); - // Preparing the standard all-ones input - std::vector input(9); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNDefaults", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; + ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUDefaults", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output_y.size(), std::size(RNNDefaults_ExpectedOutput::all_ones_y)); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} - float *correct_y = RNNDefaults_ExpectedOutput::all_ones_y; +TEST(ONNX, GRUInitialBias) +{ + SofieReference ref = readReference("GRUInitialBias"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUInitialBias", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(RNNDefaults_ExpectedOutput::all_ones_yh)); + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); +} - float *correct_yh = RNNDefaults_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } -} - -TEST(ONNX, RNNSeqLength) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(18); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNSeqLength", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(RNNSeqLength_ExpectedOutput::all_ones_y)); - - float *correct_y = RNNSeqLength_ExpectedOutput::all_ones_y; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(RNNSeqLength_ExpectedOutput::all_ones_yh)); - - float *correct_yh = RNNSeqLength_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } -} - -TEST(ONNX, RNNSequence) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input({ - 0.01, -0.01, 0.08, 0.09, 0.001, - 0.09, -0.7, -0.35, 0.0, 0.001, - 0.16, -0.19, 0.003, 0.0, 0.0001, - 0.05, -0.09, 0.013, 0.5, 0.005, - 0.2, -0.05, 0.062, -0.04, -0.04, - 0.0, 0.0, 0.0, 0.0, 0.0, - 0.06, 0.087, 0.01, 0.3, -0.001, - 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0}); - ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNSequence", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(RNNSequence_ExpectedOutput::all_ones_y)); - - float *correct_y = RNNSequence_ExpectedOutput::all_ones_y; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(RNNSequence_ExpectedOutput::all_ones_yh)); - - float *correct_yh = RNNSequence_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } -} - -TEST(ONNX, RNNSequenceBatchwise) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input({ - 0.01, -0.01, 0.08, 0.09, 0.001, - 0.05, -0.09, 0.013, 0.5, 0.005, - 0.06, 0.087, 0.01, 0.3, -0.001, - 0.09, -0.7, -0.35, 0.0, 0.001, - 0.2, -0.05, 0.062, -0.04, -0.04, - 0.0, 0.0, 0.0, 0.0, 0.0, - 0.16, -0.19, 0.003, 0.0, 0.0001, - 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0}); - ASSERT_INCLUDE_AND_RUN(std::vector>, "RNNSequenceBatchwise", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(RNNSequenceBatchwise_ExpectedOutput::all_ones_y)); - - float *correct_y = RNNSequenceBatchwise_ExpectedOutput::all_ones_y; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(RNNSequenceBatchwise_ExpectedOutput::all_ones_yh)); - - float *correct_yh = RNNSequenceBatchwise_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } -} - -TEST(ONNX, LSTMBatchwise) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(6); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMBatchwise", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(LSTMBatchwise_ExpectedOutput::all_ones)); - - float *correct = LSTMBatchwise_ExpectedOutput::all_ones; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(LSTMBatchwise_ExpectedOutput::all_ones)); - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, LSTMBidirectional) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(6); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMBidirectional", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - std::vector output_yc = output[2]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(LSTMBidirectional_ExpectedOutput::all_ones_y)); - - float *correct_y = LSTMBidirectional_ExpectedOutput::all_ones_y; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(LSTMBidirectional_ExpectedOutput::all_ones_yh)); - - float *correct_yh = LSTMBidirectional_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yc.size(), std::size(LSTMBidirectional_ExpectedOutput::all_ones_yc)); - - float *correct_yc = LSTMBidirectional_ExpectedOutput::all_ones_yc; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yc[i] - correct_yc[i]), TOLERANCE); - } -} - -TEST(ONNX, LSTMDefaults) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(6); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMDefaults", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(LSTMDefaults_ExpectedOutput::all_ones_y)); - - float *correct_y = LSTMDefaults_ExpectedOutput::all_ones_y; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(LSTMDefaults_ExpectedOutput::all_ones_yh)); - - float *correct_yh = LSTMDefaults_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } -} - -TEST(ONNX, LSTMInitialBias) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(9); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMInitialBias", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(LSTMInitialBias_ExpectedOutput::all_ones_y)); - - float *correct_y = LSTMInitialBias_ExpectedOutput::all_ones_y; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(LSTMInitialBias_ExpectedOutput::all_ones_yh)); - - float *correct_yh = LSTMInitialBias_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } -} - -TEST(ONNX, LSTMPeepholes) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(8); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "LSTMPeepholes", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(LSTMPeepholes_ExpectedOutput::all_ones)); - - float *correct = LSTMPeepholes_ExpectedOutput::all_ones; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(LSTMPeepholes_ExpectedOutput::all_ones)); - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct[i]), TOLERANCE); - } -} - -// GRU tests -TEST(ONNX, GRUBatchwise) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(6); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUBatchwise", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(GRUBatchwise_ExpectedOutput::all_ones)); - - float *correct = GRUBatchwise_ExpectedOutput::all_ones; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(GRUBatchwise_ExpectedOutput::all_ones)); - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, GRUBidirectional) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(6); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUBidirectional", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(GRUBidirectional_ExpectedOutput::all_ones)); - - float *correct = GRUBidirectional_ExpectedOutput::all_ones; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(GRUBidirectional_ExpectedOutput::all_ones)); - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, GRUDefaults) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(6); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUDefaults", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(GRUDefaults_ExpectedOutput::all_ones)); - - float *correct = GRUDefaults_ExpectedOutput::all_ones; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(GRUDefaults_ExpectedOutput::all_ones)); - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, GRUInitialBias) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(9); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUInitialBias", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(GRUInitialBias_ExpectedOutput::all_ones)); - - float *correct = GRUInitialBias_ExpectedOutput::all_ones; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(GRUInitialBias_ExpectedOutput::all_ones)); - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, GRUSeqLength) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(18); - std::iota(input.begin(), input.end(), 1.0f); - ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUSeqLength", input); - std::vector output_y = output[0]; - std::vector output_yh = output[1]; - - // Checking output size - EXPECT_EQ(output_y.size(), std::size(GRUSeqLength_ExpectedOutput::all_ones_y)); - - float *correct_y = GRUSeqLength_ExpectedOutput::all_ones_y; - - // Checking every output value, one by one - for (size_t i = 0; i < output_y.size(); ++i) { - EXPECT_LE(std::abs(output_y[i] - correct_y[i]), TOLERANCE); - } - - // Checking output size - EXPECT_EQ(output_yh.size(), std::size(GRUSeqLength_ExpectedOutput::all_ones_yh)); - - float *correct_yh = GRUSeqLength_ExpectedOutput::all_ones_yh; - - // Checking every output value, one by one - for (size_t i = 0; i < output_yh.size(); ++i) { - EXPECT_LE(std::abs(output_yh[i] - correct_yh[i]), TOLERANCE); - } -} - -TEST(ONNX, Softmax1d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - std::vector input({-1., 0., 1.}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax1d", input); - - EXPECT_EQ(output.size(), std::size(Softmax1d_ExpectedOutput::output)); - - float *correct = Softmax1d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, Softmax2d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - std::vector input({-1., 0., 1.}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax2d", input); - - EXPECT_EQ(output.size(), std::size(Softmax2d_ExpectedOutput::output)); - - float *correct = Softmax2d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, Softmax3d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - std::vector input({ - -0.8939, -0.3674, 0.1763, 1.5804, -0.4687, 1.2253, -1.3488, -0.1000, - -0.1262, 0.4962, 1.0870, 0.6905, -0.3451, -1.6981, -0.4688, 0.4468, - -0.5479, 0.0650, 1.0446, -1.6249, -0.7190, -1.7520, 3.7753, -1.4939}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax3d", input); - - EXPECT_EQ(output.size(), std::size(Softmax3d_ExpectedOutput::output)); - - float *correct = Softmax3d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, Softmax4d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - std::vector input({ - -0.5869, -1.4272, -0.1546, 0.0096, 0.1706, 0.0388, -0.3484, -0.7829, - 1.1138, -0.5644, -0.6264, -1.1890, 1.6741, -0.7130, 0.9592, 1.7477, - -0.4775, 1.3407, -0.3882, -0.4560, 1.0385, -0.1669, 0.5540, -1.0790, - -0.6153, -0.6274, -1.2304, -0.6757, 1.0178, -0.2379, -0.7912, -0.0165, - -0.5423, 0.1459, 1.3585, -0.5005, -0.2187, -1.8181, -0.6642, 0.0287, - -1.9103, 0.7984, -0.7860, 1.5134, 1.3873, -0.6462, -0.6354, -0.1335}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax4d", input); - - EXPECT_EQ(output.size(), std::size(Softmax4d_ExpectedOutput::output)); - - float *correct = Softmax4d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, ConvTranspose1d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(3); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTranspose1d", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvTranspose1d_ExpectedOutput::output)); - - float *correct = ConvTranspose1d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, ConvTranspose2d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(9); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTranspose2d", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvTranspose2d_ExpectedOutput::output)); - - float *correct = ConvTranspose2d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -/* -TEST(ONNX, ConvTranspose3d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(8); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTranspose3d", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvTranspose3d_ExpectedOutput::output)); - - float *correct = ConvTranspose3d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} -*/ - -TEST(ONNX, ConvTransposeBias2d) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(9); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTransposeBias2d", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvTransposeBias2d_ExpectedOutput::output)); - - float *correct = ConvTransposeBias2d_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, ConvTransposeBias2dBatched) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard all-ones input - std::vector input(18); - std::iota(input.begin(), input.end(), 0.0f); - ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTransposeBias2dBatched", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(ConvTransposeBias2dBatched_ExpectedOutput::output)); - - float *correct = ConvTransposeBias2dBatched_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, Sqrt) -{ - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - std::vector input({0.8344, 0.4716, 0.6226, 0.8448, 0.2483, 0.9467}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Sqrt", input); - - EXPECT_EQ(output.size(), std::size(Sqrt_ExpectedOutput::output)); - - float* correct = Sqrt_ExpectedOutput::output; - - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, Reciprocal) +TEST(ONNX, GRUSeqLength) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - std::vector input({1.2691, -1.2160, 0.6393, -0.4438, 0.8065, 0.2011}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Reciprocal", input); - - EXPECT_EQ(output.size(), std::size(Reciprocal_ExpectedOutput::output)); + SofieReference ref = readReference("GRUSeqLength"); - float* correct = Reciprocal_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector>, "GRUSeqLength", ref.f32("input0")); - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output[0], ref.f32("output0"), DEFAULT_TOLERANCE); + expectNear(output[1], ref.f32("output1"), DEFAULT_TOLERANCE); } -TEST(ONNX, Exp) +TEST(ONNX, Softmax1d) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - std::vector input({1.46566453, 0.63334515, 2.4048165 , 0.54468453, - -1.41271672, -0.18609187, 0.2754482 , 1.10615209, 0.88474389, 0.47531232}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Exp", input); - - EXPECT_EQ(output.size(), std::size(Exp_ExpectedOutput::output)); - - float* correct = Exp_ExpectedOutput::output; - - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, AddBroadcast1) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // input - // The shape of A is {5} - std::vector A({-0.78023305, -1.34029483, -3.01482951, 0.53641361, - -1.22594789}); - // The shape of B is {4, 5} - std::vector B({1.0626695, 0.43842875, 1.22476468, 0.79763274, 0.98688211, - 0.25267614, 0.44874883, 0.31516773, -0.78771195, 0.64565664, - 0.50450593, -0.41265227, -0.22474539, -0.22362374, 0.00509674, - 0.16927211, 1.06756969, -0.81634773, 0.88467744, 0.78902059}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast1", A, B); - - // Checking the output size - EXPECT_EQ(output.size(), std::size(AddBroadcast1_ExpectedOutput::output)); - - float* correct = AddBroadcast1_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, AddBroadcast2) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // input - // The shape of A is {5} - std::vector A({0.60081805, 0.56575772, -0.58408511, -1.50827751, 1.2396254}); - // The shape of B is {2, 3, 4, 5} - std::vector B({ - -1.22516739e+00, -2.50373737e+00, -6.14517347e-01, 4.43165956e-01, - 4.09232228e-03, 1.43520073e+00, -8.37526920e-01, 1.18762642e+00, - -1.42122220e+00, 3.77123343e-01, -6.16450821e-01, 1.96641319e+00, - -2.03568224e+00, -5.36703377e-01, -2.22149348e+00, -1.58297075e+00, - -1.25149214e+00, 6.50629098e-01, 2.06339687e+00, 6.02281648e-01, - -5.39034004e-01, -1.26280821e+00, 7.87767451e-01, 1.08251530e-01, - 2.32829794e+00, -1.50890004e+00, -5.95592927e-01, -9.20059053e-02, - 1.63228625e+00, 1.94686070e+00, 7.45655684e-01, 3.86955114e-01, - -1.83205116e+00, -1.15734817e+00, 3.80085814e-02, -2.16949162e-01, - -2.35165487e-01, 2.18171406e-01, 6.13588954e-02, -8.57086260e-01, - -2.01864267e+00, -1.61373575e+00, -2.02050258e+00, -3.25052069e-01, - -1.07114643e-01, 4.68470099e-01, 1.99557999e-01, -1.94637668e+00, - 2.47900553e-01, 7.76198825e-01, -1.98736855e-01, -2.00884998e+00, - 1.46847865e+00, 9.61028795e-01, -8.14965358e-03, 4.63333332e-01, - -1.11316244e-01, 1.82046921e+00, -1.00519072e-01, 2.40577520e+00, - 2.57814258e+00, -1.51412865e+00, -6.48090386e-02, 9.22939224e-01, - -1.31486041e+00, 3.67387151e-01, -2.17020478e-03, -4.74744054e-01, - -6.28942699e-01, -1.31704730e+00, -6.20633846e-01, -4.90250204e-01, - -2.12485120e-01, -2.36786681e-02, 2.88809968e-02, -7.44777791e-01, - 1.30091804e-02, -1.68105549e+00, 8.22247057e-02, -1.14939503e+00, - -1.57565418e+00, -7.99386689e-01, -4.06411097e-01, 1.09358391e+00, - 1.58323366e+00, -8.15174970e-02, -9.09925044e-02, 2.35596716e+00, - -6.85364818e-02, 4.12883924e-01, 5.00495425e-01, -1.48442647e+00, - -5.19349052e-01, 3.81025828e-01, -1.06188597e-01, 2.83921542e-01, - 1.13215001e+00, 1.21558052e+00, -1.04667496e+00, -9.41151099e-01, - -4.04363040e-02, 1.45554304e+00, 1.64025681e-01, -3.34693361e-01, - 1.27701314e+00, 8.64744621e-01, 1.09621430e+00, -1.06563435e+00, - -1.55637568e+00, 2.14343040e+00, 4.69610352e-01, 9.09135609e-01, - -6.20603382e-01, -1.04235434e+00, -1.32974691e+00, -1.35968049e-01, - 9.62438348e-01, 1.13413513e+00, -9.24612219e-01, -2.26132356e+00}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast2", A, B); - - // Checking the output size - EXPECT_EQ(output.size(), std::size(AddBroadcast2_ExpectedOutput::output)); - - float* correct = AddBroadcast2_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, AddBroadcast3) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // input - // The shape of A is {2, 1, 1, 5} - std::vector A({0.13225244, -0.47801406, -1.47034622, 0.87786363, -0.51388502, - 0.77012016, 0.99407484, -0.41014198, 1.76506248, 1.24142803}); - // The shape of B is {2, 3, 4, 5} - std::vector B({ - -0.79900037, 1.26774471, 0.10287351, -0.00704713, 0.19927171, - 1.77125926, 0.23393901, -0.75160577, -0.40987021, 0.02957325, - 2.48770369, 2.72426688, 0.16116267, 0.13580884, -1.34550983, - 1.08341747, -0.57232679, -0.27434247, 2.29759196, 0.72506479, - -0.35984264, -1.47553974, 0.46544721, 0.45304508, 0.39350919, - 0.25335039, -2.15455262, 0.58592831, 0.0907586, 1.32830358, - 2.16876532, -1.31509165, -0.77901816, 1.72970744, 0.89410519, - 1.18891089, 0.58372505, -0.6117035, -0.83829228, 0.63917945, - 0.66626077, -1.07667629, 0.01411519, -0.67082652, -0.04556866, - -0.04949148, -1.87075929, 0.25587637, 0.14715114, -0.74584515, - -1.19373527, -1.52142058, -0.92522942, -0.98126531, -0.07535746, - -1.4692508, -0.08861242, 0.64951867, -0.16918995, 0.87015361, - 0.57688991, 1.36293834, 1.28256834, 0.39245538, 0.43308474, - 0.84529828, -0.56686547, -0.84791844, -0.11286944, 0.60857973, - -0.79519511, -0.20491925, -1.52951743, -0.39030064, -2.76160767, - 0.09055906, -0.99142034, 0.33480785, -1.09999883, 1.36149355, - 0.18557576, 0.55407001, 1.23164067, -0.23469015, -1.37274723, - 1.80717934, 1.42966758, 0.72077395, -0.09774939, 1.12065382, - -0.51515613, -0.9527945, 0.87646967, -0.59440101, -0.12440208, - -0.71096692, -0.6301275, 0.51726169, 1.23726643, 1.56255466, - -0.94469759, -0.38114756, -0.42021761, -0.58921487, -0.71439637, - 0.04793575, -2.04214516, -0.45765407, -1.12307202, 0.90727137, - 0.96272832, 0.54303206, -0.84973033, 0.28780329, 0.17027854, - -0.11893711, -1.22414638, -1.62747593, 0.53264501, 0.53483601}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast3", A, B); - - // Checking the output size - EXPECT_EQ(output.size(), std::size(AddBroadcast3_ExpectedOutput::output)); - - float* correct = AddBroadcast3_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, AddBroadcast4) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("Softmax1d"); - // input - // The shape of A is {2, 1} - std::vector A({1.94301397, 0.40606817}); - // The shape of B is {2, 4} - std::vector B({0.50898894, -0.27829921, -0.68761628, 0.33186382, 0.57915535, - 0.406858 , 1.4203833 , 0.19857093}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast4", A, B); - - // Checking the output size - EXPECT_EQ(output.size(), std::size(AddBroadcast4_ExpectedOutput::output)); - - float* correct = AddBroadcast4_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, AddBroadcast5) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // input - // The shape of A is {2, 1, 4} - std::vector A({-0.45616139, -0.05853134, 1.09564217, 0.95880315, 0.94995322, - -0.35864105, 1.08570897, 0.6028053}); - // The shape of B is {2, 3, 4} - std::vector B({1.69787452, 1.10641673, 2.19755165, 0.06709206, 0.04572308, - -2.14504366, -0.47730702, 0.15205423, -0.25159224, -0.07529807, - 0.5174367 , 0.08267595, 0.34015625, 0.09460231, -1.16608969, - -0.23466058, -0.5520268 , -0.13844847, 0.53055759, 0.17068648, - -0.49491276, -1.4246271 , -0.99973914, -0.2571329}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast5", A, B); - - // Checking the output size - EXPECT_EQ(output.size(), std::size(AddBroadcast5_ExpectedOutput::output)); - - float* correct = AddBroadcast5_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, AddBroadcast6) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // input - // The shape of A is {2, 1, 3, 1, 2} - std::vector A({1.05498675, -1.64311041, 0.11925147, -1.59755778, -0.01445313, - -0.69440541, -0.12011281, 0.00539323, -0.16923531, 2.34533598, - 1.30268048, 0.45699443}); - // The shape of B is {2, 2, 3, 2, 2} - std::vector B({ - 0.03162163, 1.36340443, -0.34736459, -0.71856324, 0.40669968, - -0.37595741, 0.22234952, 1.69563792, 0.91459166, -0.02081215, - -1.64894217, -0.01189261, 0.58031339, -0.11880191, 0.70099317, - -0.37424243, -0.23980527, -0.03178407, -0.27969109, 0.01895688, - 1.32111755, 0.02113906, 0.51450298, -1.41760768, -0.19220553, - 0.23529522, 0.95199908, -1.38971445, -0.75836965, -0.90956958, - -0.13006828, -0.64390454, -0.0808229 , 0.79134757, 1.00684867, - -1.43818087, -0.14550621, -0.33635512, -0.6185612 , -0.49281407, - -1.12947258, 1.61818821, -0.05826431, -1.47802183, 0.25637381, - -0.1547858 , 2.50788792, 0.30898059}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast6", A, B); - - // Checking the output size - EXPECT_EQ(output.size(), std::size(AddBroadcast6_ExpectedOutput::output)); - - float* correct = AddBroadcast6_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, AddBroadcast7) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // input - // The shape of A is {2, 1, 3, 1} - std::vector A({-0.42164834, -0.61767078, -0.68778897, -1.14175916, 0.63204375, - -0.60630317}); - // The shae of B is {1, 1, 3, 4} - std::vector B({1.40519865e+00, -2.87660856e-01, 7.49375999e-02, 1.22074840e+00, - -4.86212681e-01, -6.88210109e-01, -6.77434705e-01, 3.67088873e-01, - 8.05744026e-04, -2.08031088e-01, 9.69779132e-01, 7.58373863e-01}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast7", A, B); - - // Checking the output size - EXPECT_EQ(output.size(), std::size(AddBroadcast7_ExpectedOutput::output)); - - float* correct = AddBroadcast7_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } -} - -TEST(ONNX, Concat0D) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // input - std::vector input({1.40519865e+00, -2.87660856e-01}); - std::vector expected_output({1.40519865e+00, -2.87660856e-01, 1.40519865e+00, -2.87660856e-01}); - ASSERT_INCLUDE_AND_RUN(std::vector, "Concat_0D", input); - - // Checking the output size - EXPECT_EQ(expected_output.size(), expected_output.size()); - - float* correct = expected_output.data(); + ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax1d", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, LayerNormalization2d) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, Softmax2d) +{ + SofieReference ref = readReference("Softmax2d"); - // input - std::vector x(12); - std::iota(x.begin(), x.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "LayerNormalization2d", x); + ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax2d", ref.f32("input0")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(LayerNormalization2d_ExpectedOutput::output)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - float* correct = LayerNormalization2d_ExpectedOutput::output; +TEST(ONNX, Softmax3d) +{ + SofieReference ref = readReference("Softmax3d"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax3d", ref.f32("input0")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, LayerNormalization4d) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, Softmax4d) +{ + SofieReference ref = readReference("Softmax4d"); - // input - std::vector x(120); - std::iota(x.begin(), x.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "LayerNormalization4d", x); + ASSERT_INCLUDE_AND_RUN(std::vector, "Softmax4d", ref.f32("input0")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(LayerNormalization4d_ExpectedOutput::output)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} + +TEST(ONNX, ConvTranspose1d) +{ + SofieReference ref = readReference("ConvTranspose1d"); - float* correct = LayerNormalization4d_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTranspose1d", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Equal){ - constexpr float TOLERANCE = 0; +TEST(ONNX, ConvTranspose2d) +{ + SofieReference ref = readReference("ConvTranspose2d"); - // Preparing the standard input - std::vector input1({ - 1.0, 2.0, 3.0 - }); - std::vector input2({ - 4.0, 2.0, 6.0 - }); + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTranspose2d", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "Equal", input1, input2); - // Checking output size - EXPECT_EQ(output.size(), std::size(Equal_ExpectedOutput::outputs)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - bool *correct = Equal_ExpectedOutput::outputs; +/* ConvTranspose3d is not supported yet; a ConvTranspose3d model would have + to be added to generate_input_models.py to enable this test. +TEST(ONNX, ConvTranspose3d) +{ + SofieReference ref = readReference("ConvTranspose3d"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(((correct[i]==output[i])?0:1), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTranspose3d", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } +*/ -TEST(ONNX, LessOrEqual){ - constexpr float TOLERANCE = 0; +TEST(ONNX, ConvTransposeBias2d) +{ + SofieReference ref = readReference("ConvTransposeBias2d"); - // Preparing the standard input - std::vector input1({ - 1.0, 2.0, 3.0 - }); - std::vector input2({ - 4.0, 2.0, 6.0 - }); + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTransposeBias2d", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "LessOrEqual", input1, input2); - // Checking output size - EXPECT_EQ(output.size(), std::size(LessOrEqual_ExpectedOutput::outputs)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - bool *correct = LessOrEqual_ExpectedOutput::outputs; +TEST(ONNX, ConvTransposeBias2dBatched) +{ + SofieReference ref = readReference("ConvTransposeBias2dBatched"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(((correct[i]==output[i])?0:1), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "ConvTransposeBias2dBatched", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, GreaterOrEqual){ - constexpr float TOLERANCE = 0; +TEST(ONNX, Sqrt) +{ + SofieReference ref = readReference("Sqrt"); - // Preparing the standard input - std::vector input1({ - 1.0, 2.0, 3.0 - }); - std::vector input2({ - 4.0, 2.0, 6.0 - }); + ASSERT_INCLUDE_AND_RUN(std::vector, "Sqrt", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "GreaterOrEqual", input1, input2); - // Checking output size - EXPECT_EQ(output.size(), std::size(GreaterOrEqual_ExpectedOutput::outputs)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - bool *correct = GreaterOrEqual_ExpectedOutput::outputs; +TEST(ONNX, Reciprocal) +{ + SofieReference ref = readReference("Reciprocal"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(((correct[i]==output[i])?0:1), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "Reciprocal", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Greater){ - constexpr float TOLERANCE = 0; +TEST(ONNX, Exp) +{ + SofieReference ref = readReference("Exp"); - // Preparing the standard input - std::vector input1({ - 1.0, 2.0, 3.0 - }); - std::vector input2({ - 4.0, 2.0, 6.0 - }); + ASSERT_INCLUDE_AND_RUN(std::vector, "Exp", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "Greater", input1, input2); - // Checking output size - EXPECT_EQ(output.size(), std::size(Greater_ExpectedOutput::outputs)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - bool *correct = Greater_ExpectedOutput::outputs; +TEST(ONNX, AddBroadcast1) +{ + SofieReference ref = readReference("AddBroadcast1"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(((correct[i]==output[i])?0:1), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast1", ref.f32("input0"), ref.f32("input1")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Less){ - constexpr float TOLERANCE = 0; +TEST(ONNX, AddBroadcast2) +{ + SofieReference ref = readReference("AddBroadcast2"); - // Preparing the standard input - std::vector input1({ - 1.0, 2.0, 3.0 - }); - std::vector input2({ - 4.0, 2.0, 6.0 - }); + ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast2", ref.f32("input0"), ref.f32("input1")); - ASSERT_INCLUDE_AND_RUN(std::vector, "Less", input1, input2); - // Checking output size - EXPECT_EQ(output.size(), std::size(Less_ExpectedOutput::outputs)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - bool *correct = Less_ExpectedOutput::outputs; +TEST(ONNX, AddBroadcast3) +{ + SofieReference ref = readReference("AddBroadcast3"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(((correct[i]==output[i])?0:1), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast3", ref.f32("input0"), ref.f32("input1")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, ExpandSameSize) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, AddBroadcast4) +{ + SofieReference ref = readReference("AddBroadcast4"); - // input - std::vector input({0., 1., 2.}); - ASSERT_INCLUDE_AND_RUN(std::vector, "ExpandSameSize", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast4", ref.f32("input0"), ref.f32("input1")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(ExpandSameSize_ExpectedOutput::output)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - float* correct = ExpandSameSize_ExpectedOutput::output; +TEST(ONNX, AddBroadcast5) +{ + SofieReference ref = readReference("AddBroadcast5"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast5", ref.f32("input0"), ref.f32("input1")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, ExpandDiffSize) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, AddBroadcast6) +{ + SofieReference ref = readReference("AddBroadcast6"); - // input - std::vector input({0., 1., 2.}); - ASSERT_INCLUDE_AND_RUN(std::vector, "ExpandDiffSize", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast6", ref.f32("input0"), ref.f32("input1")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(ExpandDiffSize_ExpectedOutput::output)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - float* correct = ExpandDiffSize_ExpectedOutput::output; +TEST(ONNX, AddBroadcast7) +{ + SofieReference ref = readReference("AddBroadcast7"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "AddBroadcast7", ref.f32("input0"), ref.f32("input1")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, GatherAxis0) { +TEST(ONNX, Concat0D) { constexpr float TOLERANCE = DEFAULT_TOLERANCE; // input - std::vector input(120); - std::iota(input.begin(), input.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "GatherAxis0", input); + std::vector input({1.40519865e+00, -2.87660856e-01}); + std::vector expected_output({1.40519865e+00, -2.87660856e-01, 1.40519865e+00, -2.87660856e-01}); + ASSERT_INCLUDE_AND_RUN(std::vector, "Concat_0D", input); // Checking the output size - EXPECT_EQ(output.size(), std::size(GatherAxis0_ExpectedOutput::output)); + EXPECT_EQ(expected_output.size(), expected_output.size()); - float* correct = GatherAxis0_ExpectedOutput::output; + float* correct = expected_output.data(); // Checking every output value, one by one for (size_t i = 0; i < output.size(); i++) { @@ -2546,232 +930,212 @@ TEST(ONNX, GatherAxis0) { } } -TEST(ONNX, GatherAxis1) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, LayerNormalization2d) +{ + SofieReference ref = readReference("LayerNormalization2d"); - // input - std::vector input(120); - std::iota(input.begin(), input.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "GatherAxis1", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "LayerNormalization2d", ref.f32("input0")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(GatherAxis1_ExpectedOutput::output)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - float* correct = GatherAxis1_ExpectedOutput::output; +TEST(ONNX, LayerNormalization4d) +{ + SofieReference ref = readReference("LayerNormalization4d"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "LayerNormalization4d", ref.f32("input0")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, GatherAxis2) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, Equal) +{ + SofieReference ref = readReference("Equal"); - // input - std::vector input(120); - std::iota(input.begin(), input.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "GatherAxis2", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "Equal", ref.f32("input0"), ref.f32("input1")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(GatherAxis2_ExpectedOutput::output)); + expectEqual(output, ref.u8("output0")); +} - float* correct = GatherAxis2_ExpectedOutput::output; +TEST(ONNX, LessOrEqual) +{ + SofieReference ref = readReference("LessOrEqual"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "LessOrEqual", ref.f32("input0"), ref.f32("input1")); + + expectEqual(output, ref.u8("output0")); } -TEST(ONNX, GatherAxis3) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, GreaterOrEqual) +{ + SofieReference ref = readReference("GreaterOrEqual"); - // input - std::vector input(120); - std::iota(input.begin(), input.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "GatherAxis3", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "GreaterOrEqual", ref.f32("input0"), ref.f32("input1")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(GatherAxis3_ExpectedOutput::output)); + expectEqual(output, ref.u8("output0")); +} + +TEST(ONNX, Greater) +{ + SofieReference ref = readReference("Greater"); - float* correct = GatherAxis3_ExpectedOutput::output; + ASSERT_INCLUDE_AND_RUN(std::vector, "Greater", ref.f32("input0"), ref.f32("input1")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectEqual(output, ref.u8("output0")); } -TEST(ONNX, Gather2d) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, Less) +{ + SofieReference ref = readReference("Less"); - // input - std::vector input(9); - std::iota(input.begin(), input.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "Gather2d", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "Less", ref.f32("input0"), ref.f32("input1")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(Gather2d_ExpectedOutput::output)); + expectEqual(output, ref.u8("output0")); +} - float* correct = Gather2d_ExpectedOutput::output; +TEST(ONNX, ExpandSameSize) +{ + SofieReference ref = readReference("ExpandSameSize"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "ExpandSameSize", ref.f32("input0")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, GatherNegativeIndices) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, ExpandDiffSize) +{ + SofieReference ref = readReference("ExpandDiffSize"); - // input - std::vector input(10); - std::iota(input.begin(), input.end(), 0.); - ASSERT_INCLUDE_AND_RUN(std::vector, "GatherNegativeIndices", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "ExpandDiffSize", ref.f32("input0")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(GatherNegativeIndices_ExpectedOutput::output)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - float* correct = GatherNegativeIndices_ExpectedOutput::output; +TEST(ONNX, GatherAxis0) +{ + SofieReference ref = readReference("GatherAxis0"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + ASSERT_INCLUDE_AND_RUN(std::vector, "GatherAxis0", ref.f32("input0")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Slice) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, GatherAxis1) +{ + SofieReference ref = readReference("GatherAxis1"); - std::vector input = Slice::input; - ASSERT_INCLUDE_AND_RUN(std::vector, "Slice", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "GatherAxis1", ref.f32("input0")); - EXPECT_EQ(output.size(), std::size(Slice::output)); - float *correct = Slice::output; + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - for (size_t i=0; i, "GatherAxis2", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Slice_Default_Axis) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, GatherAxis3) +{ + SofieReference ref = readReference("GatherAxis3"); - std::vector input = Slice_Default_Axis::input; - ASSERT_INCLUDE_AND_RUN(std::vector, "Slice_Default_Axis", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "GatherAxis3", ref.f32("input0")); - EXPECT_EQ(output.size(), std::size(Slice_Default_Axis::output)); - float *correct = Slice_Default_Axis::output; + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - for (size_t i=0; i, "Gather2d", ref.f32("input0")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Slice_Default_Steps) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, GatherNegativeIndices) +{ + SofieReference ref = readReference("GatherNegativeIndices"); + + ASSERT_INCLUDE_AND_RUN(std::vector, "GatherNegativeIndices", ref.f32("input0")); - std::vector input = Slice_Default_Steps::input; - ASSERT_INCLUDE_AND_RUN(std::vector, "Slice_Default_Steps", input); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - EXPECT_EQ(output.size(), std::size(Slice_Default_Steps::output)); - float *correct = Slice_Default_Steps::output; +TEST(ONNX, Slice) +{ + SofieReference ref = readReference("Slice"); - for (size_t i=0; i, "Slice", ref.f32("input0")); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } -TEST(ONNX, Slice_Neg) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; +TEST(ONNX, Slice_Default_Axis) +{ + SofieReference ref = readReference("Slice_Default_Axis"); - std::vector input = Slice_Neg::input; - ASSERT_INCLUDE_AND_RUN(std::vector, "Slice_Neg", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "Slice_Default_Axis", ref.f32("input0")); - EXPECT_EQ(output.size(), std::size(Slice_Neg::output)); - float *correct = Slice_Neg::output; + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - for (size_t i=0; i, "Slice_Default_Steps", ref.f32("input0")); - // inputs - std::vector start{1.}; - std::vector limit{10.}; - std::vector delta{2.}; - ASSERT_INCLUDE_AND_RUN_SESSION_ARGS(std::vector, "RangeFloat", "\"RangeFloat_FromONNX.dat\", 5", start, limit, delta); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - // Checking the output size - EXPECT_EQ(output.size(), std::size(RangeFloat_ExpectedOutput::outputs)); +TEST(ONNX, Slice_Neg) +{ + SofieReference ref = readReference("Slice_Neg"); - float* correct = RangeFloat_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Slice_Neg", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } +TEST(ONNX, RangeFloat) +{ + SofieReference ref = readReference("RangeFloat"); -TEST(ONNX, RangeInt) { - // inputs - std::vector start{1}; - std::vector limit{10}; - std::vector delta{2}; - ASSERT_INCLUDE_AND_RUN_SESSION_ARGS(std::vector, "RangeInt", "\"RangeInt_FromONNX.dat\", 5", start, limit, delta); + ASSERT_INCLUDE_AND_RUN_SESSION_ARGS( + std::vector, + "RangeFloat", + "\"RangeFloat_FromONNX.dat\", 5", + ref.f32("input0"), + ref.f32("input1"), + ref.f32("input2")); - // Checking the output size - EXPECT_EQ(output.size(), std::size(RangeInt_ExpectedOutput::outputs)); + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); +} - int64_t* correct = RangeInt_ExpectedOutput::outputs; +TEST(ONNX, RangeInt) +{ + SofieReference ref = readReference("RangeInt"); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); i++) { - EXPECT_EQ(output[i], correct[i]); - } + ASSERT_INCLUDE_AND_RUN_SESSION_ARGS( + std::vector, + "RangeInt", + "\"RangeInt_FromONNX.dat\", 5", + ref.i64("input0"), + ref.i64("input1"), + ref.i64("input2")); + + expectEqual(output, ref.i64("output0")); } -TEST(ONNX, Tile5D) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input_data({ - 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, 0.5724563598632812, -0.6596977710723877, - 0.17560836672782898, 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, 0.2705111503601074, - 1.42119562625885, 0.032626643776893616, -1.212586522102356, -0.5129594802856445, -0.43296414613723755, - -0.1606937050819397, 1.1884371042251587, -0.662174642086029, -2.291109323501587, -0.6852569580078125, - 2.325223922729492, -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, 0.2831517457962036, - 0.4496127665042877, -0.2029038816690445, 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, - 1.90426504611969, -0.4861580729484558, 0.9139055013656616, -0.5031066536903381, 0.9583520293235779, - -0.23210509121418, 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, -0.14444805681705475, - -0.8829464912414551, 1.725736141204834, 0.45657631754875183, 0.4920198321342468, -1.088847041130066, - 0.49437597393989563, -0.006085286382585764, 2.475630760192871, 0.12170185893774033, -0.8953945636749268, - 1.1430096626281738, 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, 0.05180325731635094, - 0.2802475392818451, 0.5289335250854492, 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, - 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, 0.5463842153549194, -0.7782878875732422, - -0.8570080399513245, -2.593783378601074, -0.11392943561077118, 0.5637082457542419, 2.075004816055298, - -1.0598397254943848, 1.0823975801467896 - }); - // std::vector repetitions({2, 1, 2, 1, 3}); - - ASSERT_INCLUDE_AND_RUN(std::vector, "Tile5D", input_data); - - // EXPECT_EQ(output.size(), expected_output.size()); - EXPECT_EQ(output.size(), std::size(Tile5D_ExpectedOutput::output)); - - - float* correct = Tile5D_ExpectedOutput::output; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } +TEST(ONNX, Tile5D) +{ + SofieReference ref = readReference("Tile5D"); + + ASSERT_INCLUDE_AND_RUN(std::vector, "Tile5D", ref.f32("input0")); + + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, Pad) { // add constant pad values of zeros @@ -3297,82 +1661,38 @@ TEST(ONNX, Clip) TEST(ONNX, Gelu) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input{1.0, -2.0, 3.0, 0.5, -1.0, 2.0}; - - ASSERT_INCLUDE_AND_RUN(std::vector, "Gelu", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(Gelu_ExpectedOutput::outputs)); + SofieReference ref = readReference("Gelu"); - float *correct = Gelu_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Gelu", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, Swish) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Input spanning negative and positive values - std::vector input{1.0, -2.0, 3.0, 0.5, -1.0, 2.0}; - - ASSERT_INCLUDE_AND_RUN(std::vector, "Swish", input); + SofieReference ref = readReference("Swish"); - // Checking output size - EXPECT_EQ(output.size(), std::size(Swish_ExpectedOutput::outputs)); - - float *correct = Swish_ExpectedOutput::outputs; + ASSERT_INCLUDE_AND_RUN(std::vector, "Swish", ref.f32("input0")); - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, HardSigmoid) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; - - // Preparing the standard input - std::vector input{1.0, -2.0, 3.0, 0.5, -1.0, 2.0}; + SofieReference ref = readReference("HardSigmoid"); - ASSERT_INCLUDE_AND_RUN(std::vector, "HardSigmoid", input); + ASSERT_INCLUDE_AND_RUN(std::vector, "HardSigmoid", ref.f32("input0")); - // Checking output size - EXPECT_EQ(output.size(), std::size(HardSigmoid_ExpectedOutput::outputs)); - - float *correct = HardSigmoid_ExpectedOutput::outputs; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, HardSwish) { - constexpr float TOLERANCE = DEFAULT_TOLERANCE; + SofieReference ref = readReference("HardSwish"); - // Preparing the standard input - std::vector input{1.0, -2.0, 3.0, 0.5, -1.0, 2.0}; + ASSERT_INCLUDE_AND_RUN(std::vector, "HardSwish", ref.f32("input0")); - ASSERT_INCLUDE_AND_RUN(std::vector, "HardSwish", input); - - // Checking output size - EXPECT_EQ(output.size(), std::size(HardSwish_ExpectedOutput::outputs)); - - float *correct = HardSwish_ExpectedOutput::outputs; - - // Checking every output value, one by one - for (size_t i = 0; i < output.size(); ++i) { - EXPECT_LE(std::abs(output[i] - correct[i]), TOLERANCE); - } + expectNear(output, ref.f32("output0"), DEFAULT_TOLERANCE); } TEST(ONNX, ComparisonBroadcast) diff --git a/tmva/sofie/test/generate_input_models.py b/tmva/sofie/test/generate_input_models.py new file mode 100644 index 0000000000000..cc4f82527ac33 --- /dev/null +++ b/tmva/sofie/test/generate_input_models.py @@ -0,0 +1,5286 @@ +#!/usr/bin/env python3 +"""Generator for the ONNX input models of the SOFIE tests. + +Each make_() function below builds one of the models in a +human-readable way with the onnx helper API. Large weight tensors whose +values carry no meaning (e.g. the weights of the Linear_* models) are +seeded-random via _random_tensor(). + +The script also computes the expected outputs for the value-based unit tests +(see TEST_INPUTS further below) and writes them to references/.ref in +the output directory, from where TestCustomModelsFromONNX.cxx reads them at +runtime. + +This script is run as the SofieGenerateModels_ONNX unit test, which the +other SOFIE ONNX tests depend on (see CMakeLists.txt). To (re)generate the +models and reference files manually: + + python3 generate_input_models.py --outdir [model names...] + +Listing the available model names does not require the onnx package: + + python3 generate_input_models.py --list +""" + +import argparse +import os +import sys + +try: + import numpy as np + import onnx + from onnx import TensorProto, helper, numpy_helper + from onnx.reference import ReferenceEvaluator +except ImportError: + onnx = None + +inf = float("inf") +nan = float("nan") + + +def _vi(name, dtype, shape): + """Shorthand for a tensor value info (graph/node input or output).""" + return helper.make_tensor_value_info(name, dtype, shape) + + +def _tensor(name, dtype, dims, vals): + """Shorthand for a constant tensor with explicit values.""" + return helper.make_tensor(name, dtype, dims, vals) + + +def _random_tensor(name, dims, seed): + """Uniform random float32 weight tensor in [-k, k] with k = 1/sqrt(fan_in), + mimicking the default pytorch initialization that the original models were + exported with. The fixed per-tensor seed keeps the generated model - and + with it the reference outputs computed further below - reproducible.""" + rng = np.random.RandomState(seed) + k = 1.0 / np.sqrt(dims[-1]) + vals = rng.uniform(-k, k, int(np.prod(dims))).astype(np.float32) + return helper.make_tensor(name, TensorProto.FLOAT, dims, vals) + + +def _model(graph, opset, ir_version, **kwargs): + """Wrap a graph into a ModelProto with the given opset and IR version.""" + model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", opset)], **kwargs) + model.ir_version = ir_version + return model + + +if onnx is not None: + BOOL = TensorProto.BOOL + DOUBLE = TensorProto.DOUBLE + FLOAT = TensorProto.FLOAT + INT64 = TensorProto.INT64 + UINT8 = TensorProto.UINT8 + + +def make_Abs(): + """Ops: Abs""" + nodes = [ + helper.make_node('Abs', ['input'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'Abs', + inputs=[ + _vi('input', FLOAT, [2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Add(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['onnx::Add_0', 'onnx::Add_1'], ['2'], name='Add_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Add_0', FLOAT, [2]), + _vi('onnx::Add_1', FLOAT, [2]), + ], + outputs=[ + _vi('2', FLOAT, [2]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_AddBroadcast1(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['A', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Add', + inputs=[ + _vi('A', FLOAT, [5]), + _vi('B', FLOAT, [4, 5]), + ], + outputs=[ + _vi('Y', FLOAT, [4, 5]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_AddBroadcast2(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['A', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Add', + inputs=[ + _vi('A', FLOAT, [5]), + _vi('B', FLOAT, [2, 3, 4, 5]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3, 4, 5]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_AddBroadcast3(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['A', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Add', + inputs=[ + _vi('A', FLOAT, [2, 1, 1, 5]), + _vi('B', FLOAT, [2, 3, 4, 5]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3, 4, 5]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_AddBroadcast4(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['A', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Add', + inputs=[ + _vi('A', FLOAT, [2, 1]), + _vi('B', FLOAT, [2, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 4]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_AddBroadcast5(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['A', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Add', + inputs=[ + _vi('A', FLOAT, [2, 1, 4]), + _vi('B', FLOAT, [2, 3, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3, 4]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_AddBroadcast6(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['A', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Add', + inputs=[ + _vi('A', FLOAT, [2, 1, 3, 1, 2]), + _vi('B', FLOAT, [2, 2, 3, 2, 2]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 2, 3, 2, 2]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_AddBroadcast7(): + """Ops: Add""" + nodes = [ + helper.make_node('Add', ['A', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Add', + inputs=[ + _vi('A', FLOAT, [2, 1, 3, 1]), + _vi('B', FLOAT, [1, 1, 3, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 1, 3, 4]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_AvgPool(): + """Ops: AveragePool""" + nodes = [ + helper.make_node( + 'AveragePool', + ['onnx::Pad_0'], + ['2'], + name='AveragePool_1', + kernel_shape=[3, 2], + pads=[0, 0, 0, 0], + strides=[2, 1], + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Pad_0', FLOAT, [1, 1, 5, 10]), + ], + outputs=[ + _vi('2', FLOAT, [1, 1, 2, 9]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_Cast(): + """Ops: Cast""" + nodes = [ + helper.make_node('Cast', ['onnx::Cast_0'], ['1'], name='Cast_0', to=11), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Cast_0', INT64, [2, 3]), + ], + outputs=[ + _vi('1', DOUBLE, [2, 3]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_Clip(): + """Ops: Clip""" + nodes = [ + helper.make_node('Clip', ['X', 'min', 'max'], ['Y'], name='clip_node'), + helper.make_node('Clip', ['X', 'min'], ['Y2'], name='clip_node'), + ] + graph = helper.make_graph( + nodes, + 'ClipGraph', + inputs=[ + _vi('X', FLOAT, ['N', 2, 2]), + ], + outputs=[ + _vi('Y', FLOAT, ['N', 2, 2]), + _vi('Y2', FLOAT, ['N', 2, 2]), + ], + initializer=[ + _tensor('min', FLOAT, [], [-1.0]), + _tensor('max', FLOAT, [], [1.0]), + ], + ) + return _model(graph, opset=13, ir_version=8, producer_name='onnx-example') + + +def make_Comparison_broadcast(): + """Ops: Greater, Equal, Less""" + nodes = [ + helper.make_node('Greater', ['A', 'B'], ['OutGreater']), + helper.make_node('Equal', ['A', 'B'], ['OutEqual']), + helper.make_node('Less', ['A', 'B'], ['OutLess']), + ] + graph = helper.make_graph( + nodes, + 'ComparisonOpsWithBroadcast', + inputs=[ + _vi('A', FLOAT, [1, 4]), + _vi('B', FLOAT, [4]), + ], + outputs=[ + _vi('OutGreater', BOOL, [1, 4]), + _vi('OutEqual', BOOL, [1, 4]), + _vi('OutLess', BOOL, [1, 4]), + ], + ) + return _model(graph, opset=23, ir_version=11, producer_name='comparison_broadcast_demo') + + +def make_Comparison_broadcast_3d(): + """Ops: Greater, Equal, Less""" + nodes = [ + helper.make_node('Greater', ['A', 'B'], ['OutGreater']), + helper.make_node('Equal', ['A', 'B'], ['OutEqual']), + helper.make_node('Less', ['A', 'B'], ['OutLess']), + ] + graph = helper.make_graph( + nodes, + 'ComparisonOpsBroadcast', + inputs=[ + _vi('A', FLOAT, [2, 2, 4]), + _vi('B', FLOAT, [1, 4]), + ], + outputs=[ + _vi('OutGreater', BOOL, [2, 2, 4]), + _vi('OutEqual', BOOL, [2, 2, 4]), + _vi('OutLess', BOOL, [2, 2, 4]), + ], + ) + return _model(graph, opset=23, ir_version=11, producer_name='comparison_broadcast_demo') + + +def make_ComplexTopK(): + """Ops: Constant, TopK""" + nodes = [ + helper.make_node( + 'Constant', + [], + ['/Constant_output_0'], + name='/Constant', + value=_tensor('', INT64, [1], [3]), + ), + helper.make_node( + 'TopK', + ['onnx::TopK_0', '/Constant_output_0'], + ['4', '5'], + name='/TopK', + axis=1, + largest=1, + sorted=1, + ), + ] + graph = helper.make_graph( + nodes, + 'main_graph', + inputs=[ + _vi('onnx::TopK_0', FLOAT, [2, 3, 9]), + ], + outputs=[ + _vi('4', FLOAT, [2, 3, 9]), + _vi('5', INT64, [2, 3, 9]), + ], + ) + return _model(graph, opset=17, ir_version=8, producer_name='pytorch', producer_version='2.3.0') + + +def make_Concat_0D(): + """Ops: Concat""" + nodes = [ + helper.make_node( + 'Concat', + ['onnx::Concat_0', 'onnx::Concat_0'], + ['1'], + name='Concat_0', + axis=0, + ), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::Concat_0', FLOAT, [2]), + ], + outputs=[ + _vi('1', FLOAT, [4]), + ], + ) + return _model(graph, opset=13, ir_version=7, producer_name='pytorch', producer_version='1.12.1') + + +def make_Constant(): + """Ops: Constant, Add""" + nodes = [ + helper.make_node( + 'Constant', + [], + ['constant_output'], + value=_tensor('constant_tensor', FLOAT, [2, 2], [1.0, 2.0, 3.0, 4.0]), + ), + helper.make_node('Add', ['constant_output', 'constant_output'], ['add_output']), + ] + graph = helper.make_graph( + nodes, + 'constant_addition_graph', + inputs=[ + ], + outputs=[ + _vi('add_output', FLOAT, [2, 2]), + ], + ) + return _model(graph, opset=19, ir_version=9, producer_name='onnx_constant_model') + + +def make_ConvAddRelu(): + """Ops: Conv, Add, Relu""" + nodes = [ + helper.make_node( + 'Conv', + ['x', 'w'], + ['conv_out'], + kernel_shape=[3, 3], + pads=[0, 0, 0, 0], + strides=[1, 1], + ), + helper.make_node('Add', ['conv_out', 'b'], ['add_out']), + helper.make_node('Relu', ['add_out'], ['y']), + ] + graph = helper.make_graph( + nodes, + 'ConvAddRelu', + inputs=[ + _vi('x', FLOAT, [1, 1, 4, 4]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 2, 2]), + ], + initializer=[ + _tensor('w', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + _tensor('b', FLOAT, [1], [0.5]), + ], + ) + return _model(graph, opset=13, ir_version=13) + + +def make_ConvTranspose1d(): + """Ops: ConvTranspose""" + nodes = [ + helper.make_node('ConvTranspose', ['X', 'W'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'ConvTranspose1d', + inputs=[ + _vi('X', FLOAT, [1, 1, 3]), + _vi('W', FLOAT, [1, 2, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 2, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 2, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_ConvTranspose2d(): + """Ops: ConvTranspose""" + nodes = [ + helper.make_node('ConvTranspose', ['X', 'W'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'ConvTranspose2d', + inputs=[ + _vi('X', FLOAT, [1, 1, 3, 3]), + _vi('W', FLOAT, [1, 2, 3, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 2, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 2, 3, 3], [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, + ]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_ConvTransposeBias2d(): + """Ops: ConvTranspose""" + nodes = [ + helper.make_node('ConvTranspose', ['X', 'W', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'ConvTranspose2d', + inputs=[ + _vi('X', FLOAT, [1, 1, 3, 3]), + _vi('W', FLOAT, [1, 2, 3, 3]), + _vi('B', FLOAT, [2]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 2, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 2, 3, 3], [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, + ]), + _tensor('B', FLOAT, [2], [1.0, 2.0]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_ConvTransposeBias2dBatched(): + """Ops: ConvTranspose""" + nodes = [ + helper.make_node('ConvTranspose', ['X', 'W', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'ConvTranspose2d', + inputs=[ + _vi('X', FLOAT, [2, 1, 3, 3]), + _vi('W', FLOAT, [1, 2, 3, 3]), + _vi('B', FLOAT, [2]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 2, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 2, 3, 3], [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, + ]), + _tensor('B', FLOAT, [2], [1.0, 2.0]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_ConvWithAsymmetricPadding(): + """Ops: Conv""" + nodes = [ + helper.make_node( + 'Conv', + ['x', 'W'], + ['y'], + kernel_shape=[3, 3], + pads=[1, 0, 1, 0], + strides=[2, 2], + ), + ] + graph = helper.make_graph( + nodes, + 'ConvWithAsymmetricPadding', + inputs=[ + _vi('x', FLOAT, [1, 1, 7, 5]), + _vi('W', FLOAT, [1, 1, 3, 3]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='python_script') + + +def make_ConvWithAutopadSameLower(): + """Ops: Conv""" + nodes = [ + helper.make_node( + 'Conv', + ['x', 'W'], + ['y'], + auto_pad='SAME_LOWER', + kernel_shape=[3, 3], + strides=[2, 2], + ), + ] + graph = helper.make_graph( + nodes, + 'ConvWithAutopadSameLower', + inputs=[ + _vi('x', FLOAT, [1, 1, 5, 5]), + _vi('W', FLOAT, [1, 1, 3, 3]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='python_script') + + +def make_ConvWithAutopadSameUpper(): + """Ops: Conv""" + nodes = [ + helper.make_node( + 'Conv', + ['x', 'W'], + ['y'], + auto_pad='SAME_UPPER', + kernel_shape=[3, 3], + strides=[1, 1], + ), + ] + graph = helper.make_graph( + nodes, + 'ConvSameUpper', + inputs=[ + _vi('x', FLOAT, [1, 1, 5, 5]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=11, ir_version=13) + + +def make_ConvWithDilation(): + """Ops: Conv""" + nodes = [ + helper.make_node( + 'Conv', + ['input', 'W'], + ['output'], + dilations=[2, 2], + group=1, + kernel_shape=[3, 3], + pads=[0, 0, 0, 0], + strides=[1, 1], + ), + ] + graph = helper.make_graph( + nodes, + 'ConvWithDilation', + inputs=[ + _vi('input', FLOAT, [1, 1, 7, 7]), + ], + outputs=[ + _vi('output', FLOAT, [1, 1, 3, 3]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [ + 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645, + 0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869, + ]), + ], + ) + return _model(graph, opset=13, ir_version=8) + + +def make_ConvWithDynShapeStride(): + """Ops: Conv""" + nodes = [ + helper.make_node('Conv', ['X', 'W'], ['Y'], kernel_shape=[3], pads=[0, 0], strides=[2]), + ] + graph = helper.make_graph( + nodes, + 'ConvWithDynShapeStride', + inputs=[ + _vi('X', FLOAT, [1, 1, 'W']), + ], + outputs=[ + _vi('Y', FLOAT, [1, 1, 'out_W']), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3], [1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=13, ir_version=13) + + +def make_ConvWithPadding(): + """Ops: Conv""" + nodes = [ + helper.make_node('Conv', ['x', 'W'], ['y'], kernel_shape=[3, 3], pads=[1, 1, 1, 1]), + ] + graph = helper.make_graph( + nodes, + 'ConvWithPadding', + inputs=[ + _vi('x', FLOAT, [1, 1, 5, 5]), + _vi('W', FLOAT, [1, 1, 3, 3]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='python_script') + + +def make_ConvWithStridesNoPadding(): + """Ops: Conv""" + nodes = [ + helper.make_node( + 'Conv', + ['x', 'W'], + ['y'], + kernel_shape=[3, 3], + pads=[0, 0, 0, 0], + strides=[2, 2], + ), + ] + graph = helper.make_graph( + nodes, + 'ConvWithStridesNoPadding', + inputs=[ + _vi('x', FLOAT, [1, 1, 7, 5]), + _vi('W', FLOAT, [1, 1, 3, 3]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='python_script') + + +def make_ConvWithStridesPadding(): + """Ops: Conv""" + nodes = [ + helper.make_node( + 'Conv', + ['x', 'W'], + ['y'], + kernel_shape=[3, 3], + pads=[1, 1, 1, 1], + strides=[2, 2], + ), + ] + graph = helper.make_graph( + nodes, + 'ConvWithStridesPadding', + inputs=[ + _vi('x', FLOAT, [1, 1, 7, 5]), + _vi('W', FLOAT, [1, 1, 3, 3]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='python_script') + + +def make_ConvWithoutPadding(): + """Ops: Conv""" + nodes = [ + helper.make_node('Conv', ['x', 'W'], ['y'], kernel_shape=[3, 3], pads=[0, 0, 0, 0]), + ] + graph = helper.make_graph( + nodes, + 'ConvWithoutPadding', + inputs=[ + _vi('x', FLOAT, [1, 1, 5, 5]), + _vi('W', FLOAT, [1, 1, 3, 3]), + ], + outputs=[ + _vi('y', FLOAT, [1, 1, 5, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 1, 3, 3], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='python_script') + + +def make_Cos(): + """Ops: Cos""" + nodes = [ + helper.make_node('Cos', ['input'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'CosGraph', + inputs=[ + _vi('input', FLOAT, [3, 4]), + ], + outputs=[ + _vi('output', FLOAT, [3, 4]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='cos_example') + + +def make_Div(): + """Ops: Div""" + nodes = [ + helper.make_node('Div', ['onnx::Div_0', 'onnx::Div_1'], ['2'], name='Div_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Div_0', FLOAT, [2]), + _vi('onnx::Div_1', FLOAT, [2]), + ], + outputs=[ + _vi('2', FLOAT, [2]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_Einsum_3(): + """Ops: Einsum""" + nodes = [ + helper.make_node('Einsum', ['inputA', 'inputB'], ['output'], equation='abc,abd->ad'), + ] + graph = helper.make_graph( + nodes, + 'EinsumGraph', + inputs=[ + _vi('inputA', FLOAT, [2, 2, 3]), + _vi('inputB', FLOAT, [2, 2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Einsum_4(): + """Ops: Einsum""" + nodes = [ + helper.make_node('Einsum', ['inputA', 'inputB'], ['output'], equation='abcd,abed->abce'), + ] + graph = helper.make_graph( + nodes, + 'EinsumGraph', + inputs=[ + _vi('inputA', FLOAT, [2, 1, 2, 3]), + _vi('inputB', FLOAT, [2, 1, 3, 3]), + ], + outputs=[ + _vi('output', FLOAT, [2, 1, 2, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Einsum_dotprod(): + """Ops: Einsum""" + nodes = [ + helper.make_node('Einsum', ['inputA', 'inputB'], ['output'], equation='i,i->'), + ] + graph = helper.make_graph( + nodes, + 'EinsumGraph', + inputs=[ + _vi('inputA', FLOAT, [3]), + _vi('inputB', FLOAT, [3]), + ], + outputs=[ + _vi('output', FLOAT, [0]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Einsum_matmul(): + """Ops: Einsum""" + nodes = [ + helper.make_node('Einsum', ['inputA', 'inputB'], ['output'], equation='ik,kj->ij'), + ] + graph = helper.make_graph( + nodes, + 'EinsumGraph', + inputs=[ + _vi('inputA', FLOAT, [2, 2]), + _vi('inputB', FLOAT, [2, 2]), + ], + outputs=[ + _vi('output', FLOAT, [2, 2]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Elu(): + """Ops: Elu""" + nodes = [ + helper.make_node('Elu', ['input'], ['output'], name='/elu/Elu', alpha=1.0), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('input', FLOAT, [2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='2.0.1') + + +def make_EluAlpha(): + """Ops: Elu""" + nodes = [ + helper.make_node('Elu', ['input'], ['output'], name='/elu/Elu', alpha=0.5), + ] + graph = helper.make_graph( + nodes, + 'EluAlpha', + inputs=[ + _vi('input', FLOAT, [2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=11, ir_version=13) + + +def make_Equal(): + """Ops: Equal""" + nodes = [ + helper.make_node('Equal', ['onnx::Equal_0', 'onnx::Equal_1'], ['2'], name='/Equal'), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::Equal_0', FLOAT, [3]), + _vi('onnx::Equal_1', FLOAT, [3]), + ], + outputs=[ + _vi('2', BOOL, [3]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='1.13.1') + + +def make_Erf(): + """Ops: Erf""" + nodes = [ + helper.make_node('Erf', ['onnx::Erf_0'], ['1'], name='/Erf'), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::Erf_0', FLOAT, [12]), + ], + outputs=[ + _vi('1', FLOAT, [12]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='1.13.1') + + +def make_Exp(): + """Ops: Exp""" + nodes = [ + helper.make_node('Exp', ['X'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Exp', + inputs=[ + _vi('X', FLOAT, [10]), + ], + outputs=[ + _vi('Y', FLOAT, [10]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_ExpandDiffSize(): + """Ops: Expand""" + nodes = [ + helper.make_node('Expand', ['X', 'Shape'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Expand', + inputs=[ + _vi('X', FLOAT, [3, 1]), + _vi('Shape', INT64, [4]), + ], + outputs=[ + _vi('Y', FLOAT, []), + ], + initializer=[ + _tensor('Shape', INT64, [4], [3, 2, 1, 4]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_ExpandSameSize(): + """Ops: Expand""" + nodes = [ + helper.make_node('Expand', ['X', 'Shape'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Expand', + inputs=[ + _vi('X', FLOAT, [3, 1]), + _vi('Shape', INT64, [2]), + ], + outputs=[ + _vi('Y', FLOAT, []), + ], + initializer=[ + _tensor('Shape', INT64, [2], [3, 4]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_EyeLike(): + """Ops: EyeLike""" + nodes = [ + helper.make_node('EyeLike', ['x'], ['y']), + ] + graph = helper.make_graph( + nodes, + 'eyelike_model', + inputs=[ + _vi('x', FLOAT, [3, 3]), + ], + outputs=[ + _vi('y', FLOAT, [3, 3]), + ], + ) + return _model(graph, opset=19, ir_version=9, producer_name='EyeLikeModel') + + +def make_FMod_ConstantFolding(): + """Ops: Constant, Mod""" + nodes = [ + helper.make_node('Constant', [], ['X'], value=_tensor('X', FLOAT, [3], [10.0, 7.0, 5.0])), + helper.make_node('Constant', [], ['D'], value=_tensor('D', FLOAT, [3], [3.0, 3.0, 3.0])), + helper.make_node('Mod', ['X', 'D'], ['Y'], fmod=1), + ] + graph = helper.make_graph( + nodes, + 'FMod_ConstantFolding', + inputs=[ + ], + outputs=[ + _vi('Y', FLOAT, [3]), + ], + ) + return _model(graph, opset=13, ir_version=13) + + +def make_GRUBatchwise(): + """Ops: GRU""" + nodes = [ + helper.make_node( + 'GRU', + ['X', 'W', 'R'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=6, + layout=1, + ), + ] + graph = helper.make_graph( + nodes, + 'GRUBatchwise', + inputs=[ + _vi('X', FLOAT, [3, 1, 2]), + _vi('W', FLOAT, [1, 18, 2]), + _vi('R', FLOAT, [1, 18, 6]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 1, 1, 6]), + _vi('Y_h', FLOAT, [3, 1, 6]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 18, 2], [ + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + ]), + _random_tensor('R', [1, 18, 6], seed=101), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_GRUBidirectional(): + """Ops: GRU""" + nodes = [ + helper.make_node( + 'GRU', + ['X', 'W', 'R'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh', 'Sigmoid', 'Tanh'], + clip=0.0, + direction='bidirectional', + hidden_size=5, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'GRUBidirectional', + inputs=[ + _vi('X', FLOAT, [1, 3, 2]), + _vi('W', FLOAT, [2, 15, 2]), + _vi('R', FLOAT, [2, 15, 5]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 2, 3, 5]), + _vi('Y_h', FLOAT, [2, 3, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [2, 15, 2], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, + ]), + _random_tensor('R', [2, 15, 5], seed=102), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_GRUDefaults(): + """Ops: GRU""" + nodes = [ + helper.make_node( + 'GRU', + ['X', 'W', 'R'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=5, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'GRUDefaults', + inputs=[ + _vi('X', FLOAT, [1, 3, 2]), + _vi('W', FLOAT, [1, 15, 2]), + _vi('R', FLOAT, [1, 15, 5]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 1, 3, 5]), + _vi('Y_h', FLOAT, [1, 3, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 15, 2], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, + ]), + _random_tensor('R', [1, 15, 5], seed=103), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_GRUInitialBias(): + """Ops: GRU""" + nodes = [ + helper.make_node( + 'GRU', + ['X', 'W', 'R', 'B'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=3, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'GRUInitialBias', + inputs=[ + _vi('X', FLOAT, [1, 3, 3]), + _vi('W', FLOAT, [1, 9, 3]), + _vi('R', FLOAT, [1, 9, 3]), + _vi('B', FLOAT, [1, 18]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 1, 3, 3]), + _vi('Y_h', FLOAT, [1, 3, 3]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 9, 3], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('R', FLOAT, [1, 9, 3], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('B', FLOAT, [1, 18], [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_GRUSeqLength(): + """Ops: GRU""" + nodes = [ + helper.make_node( + 'GRU', + ['X', 'W', 'R', 'B'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=5, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'GRUSeqLength', + inputs=[ + _vi('X', FLOAT, [2, 3, 3]), + _vi('W', FLOAT, [1, 15, 3]), + _vi('R', FLOAT, [1, 15, 5]), + _vi('B', FLOAT, [1, 30]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 1, 3, 5]), + _vi('Y_h', FLOAT, [1, 3, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 15, 3], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, + ]), + _random_tensor('R', [1, 15, 5], seed=104), + _tensor('B', FLOAT, [1, 30], [ + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_Gather2d(): + """Ops: Gather""" + nodes = [ + helper.make_node('Gather', ['X', 'I'], ['Y'], axis=0), + ] + graph = helper.make_graph( + nodes, + 'Gather', + inputs=[ + _vi('X', FLOAT, [3, 3]), + _vi('I', INT64, [3, 2]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 2, 3]), + ], + initializer=[ + _tensor('I', INT64, [3, 2], [0, 2, 0, 1, 2, 2]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_GatherAxis0(): + """Ops: Gather""" + nodes = [ + helper.make_node('Gather', ['X', 'I'], ['Y'], axis=0), + ] + graph = helper.make_graph( + nodes, + 'Gather', + inputs=[ + _vi('X', FLOAT, [5, 4, 3, 2]), + _vi('I', INT64, [3]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 4, 3, 2]), + ], + initializer=[ + _tensor('I', INT64, [3], [0, 1, 3]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_GatherAxis1(): + """Ops: Gather""" + nodes = [ + helper.make_node('Gather', ['X', 'I'], ['Y'], axis=1), + ] + graph = helper.make_graph( + nodes, + 'Gather', + inputs=[ + _vi('X', FLOAT, [5, 4, 3, 2]), + _vi('I', INT64, [3]), + ], + outputs=[ + _vi('Y', FLOAT, [5, 3, 3, 2]), + ], + initializer=[ + _tensor('I', INT64, [3], [0, 1, 3]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_GatherAxis2(): + """Ops: Gather""" + nodes = [ + helper.make_node('Gather', ['X', 'I'], ['Y'], axis=2), + ] + graph = helper.make_graph( + nodes, + 'Gather', + inputs=[ + _vi('X', FLOAT, [5, 4, 3, 2]), + _vi('I', INT64, [2]), + ], + outputs=[ + _vi('Y', FLOAT, [5, 4, 2, 2]), + ], + initializer=[ + _tensor('I', INT64, [2], [1, 2]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_GatherAxis3(): + """Ops: Gather""" + nodes = [ + helper.make_node('Gather', ['X', 'I'], ['Y'], axis=3), + ] + graph = helper.make_graph( + nodes, + 'Gather', + inputs=[ + _vi('X', FLOAT, [5, 4, 3, 2]), + _vi('I', INT64, [1]), + ], + outputs=[ + _vi('Y', FLOAT, [5, 4, 3, 1]), + ], + initializer=[ + _tensor('I', INT64, [1], [1]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_GatherND_1(): + """Ops: GatherND""" + nodes = [ + helper.make_node('GatherND', ['data', 'indices'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', FLOAT, [2, 3, 3]), + _vi('indices', INT64, [2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [2]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_GatherND_2(): + """Ops: GatherND""" + nodes = [ + helper.make_node('GatherND', ['data', 'indices'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', FLOAT, [2, 3, 3]), + _vi('indices', INT64, [2, 2]), + ], + outputs=[ + _vi('output', FLOAT, [2, 2]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_GatherND_3(): + """Ops: GatherND""" + nodes = [ + helper.make_node('GatherND', ['data', 'indices'], ['output'], batch_dims=1), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', FLOAT, [2, 3, 2, 2]), + _vi('indices', INT64, [2, 2, 1]), + ], + outputs=[ + _vi('output', FLOAT, [2, 2, 2, 2]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_GatherNegativeIndices(): + """Ops: Gather""" + nodes = [ + helper.make_node('Gather', ['X', 'I'], ['Y'], axis=0), + ] + graph = helper.make_graph( + nodes, + 'Gather', + inputs=[ + _vi('X', FLOAT, [10]), + _vi('I', INT64, [3]), + ], + outputs=[ + _vi('Y', FLOAT, [3]), + ], + initializer=[ + _tensor('I', INT64, [3], [0, -9, -10]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Gelu(): + """Ops: Gelu""" + nodes = [ + helper.make_node('Gelu', ['x'], ['y']), + ] + graph = helper.make_graph( + nodes, + 'Gelu', + inputs=[ + _vi('x', FLOAT, [6]), + ], + outputs=[ + _vi('y', FLOAT, [6]), + ], + ) + return _model(graph, opset=20, ir_version=13) + + +def make_Greater(): + """Ops: Greater""" + nodes = [ + helper.make_node( + 'Greater', + ['onnx::Greater_0', 'onnx::Greater_1'], + ['2'], + name='/Greater', + ), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::Greater_0', FLOAT, [3]), + _vi('onnx::Greater_1', FLOAT, [3]), + ], + outputs=[ + _vi('2', BOOL, [3]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='2.0.1') + + +def make_GreaterOrEqual(): + """Ops: GreaterOrEqual""" + nodes = [ + helper.make_node( + 'GreaterOrEqual', + ['onnx::GreaterOrEqual_0', 'onnx::GreaterOrEqual_1'], + ['2'], + name='/GreaterOrEqual', + ), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::GreaterOrEqual_0', FLOAT, [3]), + _vi('onnx::GreaterOrEqual_1', FLOAT, [3]), + ], + outputs=[ + _vi('2', BOOL, [3]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='2.0.1') + + +def make_HardSigmoid(): + """Ops: HardSigmoid""" + nodes = [ + helper.make_node( + 'HardSigmoid', + ['input'], + ['output'], + alpha=0.20000000298023224, + beta=0.5, + ), + ] + graph = helper.make_graph( + nodes, + 'HardSigmoidGraph', + inputs=[ + _vi('input', FLOAT, [6]), + ], + outputs=[ + _vi('output', FLOAT, [6]), + ], + ) + return _model(graph, opset=6, ir_version=13) + + +def make_HardSwish(): + """Ops: HardSwish""" + nodes = [ + helper.make_node('HardSwish', ['input'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'HardSwishGraph', + inputs=[ + _vi('input', FLOAT, [6]), + ], + outputs=[ + _vi('output', FLOAT, [6]), + ], + ) + return _model(graph, opset=14, ir_version=13) + + +def make_IsInf(): + """Ops: IsInf""" + nodes = [ + helper.make_node('IsInf', ['input'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'Test', + inputs=[ + _vi('input', FLOAT, [1, 'N']), + ], + outputs=[ + _vi('output', BOOL, [1, 'N']), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_LSTMBatchwise(): + """Ops: LSTM""" + nodes = [ + helper.make_node( + 'LSTM', + ['X', 'W', 'R'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=7, + layout=1, + ), + ] + graph = helper.make_graph( + nodes, + 'LSTMBatchwise', + inputs=[ + _vi('X', FLOAT, [3, 1, 2]), + _vi('W', FLOAT, [1, 28, 2]), + _vi('R', FLOAT, [1, 28, 7]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 1, 1, 7]), + _vi('Y_h', FLOAT, [3, 1, 7]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 28, 2], [ + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, 0.30000001192092896, + ]), + _random_tensor('R', [1, 28, 7], seed=105), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_LSTMBidirectional(): + """Ops: LSTM""" + nodes = [ + helper.make_node( + 'LSTM', + ['X', 'W', 'R'], + ['Y', 'Y_h', 'Y_c'], + activations=['Sigmoid', 'Tanh', 'Tanh', 'Sigmoid', 'Tanh', 'Tanh'], + clip=0.0, + direction='bidirectional', + hidden_size=3, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'LSTMBidirectional', + inputs=[ + _vi('X', FLOAT, [3, 1, 2]), + _vi('W', FLOAT, [2, 12, 2]), + _vi('R', FLOAT, [2, 12, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 2, 1, 3]), + _vi('Y_h', FLOAT, [2, 1, 3]), + _vi('Y_c', FLOAT, [2, 1, 3]), + ], + initializer=[ + _tensor('W', FLOAT, [2, 12, 2], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _random_tensor('R', [2, 12, 3], seed=106), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_LSTMDefaults(): + """Ops: LSTM""" + nodes = [ + helper.make_node( + 'LSTM', + ['X', 'W', 'R'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=3, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'LSTMDefaults', + inputs=[ + _vi('X', FLOAT, [3, 1, 2]), + _vi('W', FLOAT, [1, 12, 2]), + _vi('R', FLOAT, [1, 12, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 1, 1, 3]), + _vi('Y_h', FLOAT, [1, 1, 3]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 12, 2], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('R', FLOAT, [1, 12, 3], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_LSTMInitialBias(): + """Ops: LSTM""" + nodes = [ + helper.make_node( + 'LSTM', + ['X', 'W', 'R', 'B'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=4, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'LSTMInitialBias', + inputs=[ + _vi('X', FLOAT, [3, 1, 3]), + _vi('W', FLOAT, [1, 16, 3]), + _vi('R', FLOAT, [1, 16, 4]), + _vi('B', FLOAT, [1, 32]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 1, 1, 4]), + _vi('Y_h', FLOAT, [1, 1, 4]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 16, 3], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('R', FLOAT, [1, 16, 4], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('B', FLOAT, [1, 32], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_LSTMPeepholes(): + """Ops: LSTM""" + nodes = [ + helper.make_node( + 'LSTM', + ['X', 'W', 'R', 'B', 'sequence_lens', 'initial_h', 'initial_c', 'P'], + ['Y', 'Y_h'], + activations=['Sigmoid', 'Tanh', 'Tanh'], + clip=0.0, + direction='forward', + hidden_size=3, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'LSTMPeepholes', + inputs=[ + _vi('X', FLOAT, [1, 2, 4]), + _vi('W', FLOAT, [1, 12, 4]), + _vi('R', FLOAT, [1, 12, 3]), + _vi('B', FLOAT, [1, 24]), + _vi('sequence_lens', FLOAT, [2]), + _vi('initial_h', FLOAT, [1, 2, 3]), + _vi('initial_c', FLOAT, [1, 2, 3]), + _vi('P', FLOAT, [1, 9]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 1, 2, 3]), + _vi('Y_h', FLOAT, [1, 2, 3]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 12, 4], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('R', FLOAT, [1, 12, 3], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('B', FLOAT, [1, 24], [ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + ]), + _tensor('sequence_lens', FLOAT, [2], [1.0, 1.0]), + _tensor('initial_h', FLOAT, [1, 2, 3], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), + _tensor('initial_c', FLOAT, [1, 2, 3], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), + _tensor('P', FLOAT, [1, 9], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_LayerNormalization2d(): + """Ops: LayerNormalization""" + nodes = [ + helper.make_node('LayerNormalization', ['X', 'Scale', 'B'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'LayerNormalization', + inputs=[ + _vi('X', FLOAT, [3, 4]), + _vi('Scale', FLOAT, [4]), + _vi('B', FLOAT, [4]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 4]), + ], + initializer=[ + _tensor('Scale', FLOAT, [4], [0.5, -0.20000000298023224, 0.30000001192092896, 1.0]), + _tensor('B', FLOAT, [4], [0.20000000298023224, -0.10000000149011612, 0.10000000149011612, 0.0]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_LayerNormalization4d(): + """Ops: LayerNormalization""" + nodes = [ + helper.make_node('LayerNormalization', ['X', 'Scale', 'B'], ['Y'], axis=2), + ] + graph = helper.make_graph( + nodes, + 'LayerNormalization', + inputs=[ + _vi('X', FLOAT, [2, 3, 4, 5]), + _vi('Scale', FLOAT, [4, 5]), + _vi('B', FLOAT, [4, 5]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3, 4, 5]), + ], + initializer=[ + _tensor('Scale', FLOAT, [4, 5], [ + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, 0.10000000149011612, + ]), + _tensor('B', FLOAT, [4, 5], [ + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, + ]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Less(): + """Ops: Less""" + nodes = [ + helper.make_node('Less', ['onnx::Less_0', 'onnx::Less_1'], ['2'], name='/Less'), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::Less_0', FLOAT, [3]), + _vi('onnx::Less_1', FLOAT, [3]), + ], + outputs=[ + _vi('2', BOOL, [3]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='2.0.1') + + +def make_LessOrEqual(): + """Ops: LessOrEqual""" + nodes = [ + helper.make_node( + 'LessOrEqual', + ['onnx::LessOrEqual_0', 'onnx::LessOrEqual_1'], + ['2'], + name='/LessOrEqual', + ), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::LessOrEqual_0', FLOAT, [3]), + _vi('onnx::LessOrEqual_1', FLOAT, [3]), + ], + outputs=[ + _vi('2', BOOL, [3]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='2.0.1') + + +def make_LinearWithLeakyRelu(): + """Ops: LeakyRelu""" + nodes = [ + helper.make_node( + 'LeakyRelu', + ['input'], + ['1'], + name='LeakyRelu_0', + alpha=0.10000000149011612, + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('input', FLOAT, [24]), + ], + outputs=[ + _vi('1', FLOAT, [24]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_LinearWithSelu(): + """Ops: Gemm, Selu, Gemm, Selu""" + nodes = [ + helper.make_node( + 'Gemm', + ['input.1', '0.weight', '0.bias'], + ['5'], + name='Gemm_0', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Selu', ['5'], ['6'], name='Selu_1'), + helper.make_node( + 'Gemm', + ['6', '2.weight', '2.bias'], + ['7'], + name='Gemm_2', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Selu', ['7'], ['8'], name='Selu_3'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('input.1', FLOAT, [2, 24]), + ], + outputs=[ + _vi('8', FLOAT, [2, 12]), + ], + initializer=[ + _random_tensor('0.weight', [8, 24], seed=107), + _tensor('0.bias', FLOAT, [8], [ + -0.02950236387550831, 0.1598697304725647, 0.0748923048377037, -0.07833899557590485, + -0.1760983020067215, 0.230862095952034, 0.1015596091747284, -0.049189355224370956, + ]), + _random_tensor('2.weight', [12, 8], seed=108), + _tensor('2.bias', FLOAT, [12], [ + -0.17583288252353668, 0.30308830738067627, -0.027203908190131187, + 0.037800826132297516, 0.08170158416032791, 0.3773317337036133, + -0.17529195547103882, -0.37161365151405334, -0.1841122955083847, + 0.22103063762187958, -0.10950803756713867, -0.10128439217805862, + ]), + ], + ) + return _model(graph, opset=9, ir_version=6, producer_name='pytorch', producer_version='1.9') + + +def make_LinearWithSigmoid(): + """Ops: Gemm, Sigmoid, Gemm, Sigmoid""" + nodes = [ + helper.make_node( + 'Gemm', + ['input.1', '0.weight', '0.bias'], + ['5'], + name='Gemm_0', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Sigmoid', ['5'], ['6'], name='Sigmoid_1'), + helper.make_node( + 'Gemm', + ['6', '2.weight', '2.bias'], + ['7'], + name='Gemm_2', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Sigmoid', ['7'], ['8'], name='Sigmoid_3'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('input.1', FLOAT, [2, 24]), + ], + outputs=[ + _vi('8', FLOAT, [2, 12]), + ], + initializer=[ + _random_tensor('0.weight', [8, 24], seed=109), + _tensor('0.bias', FLOAT, [8], [ + 0.1170196384191513, -0.05893150717020035, 0.11833080649375916, 0.1336972713470459, + -0.08772247284650803, 0.16479122638702393, 0.05615559592843056, 0.059780675917863846, + ]), + _random_tensor('2.weight', [12, 8], seed=110), + _tensor('2.bias', FLOAT, [12], [ + 0.06870245188474655, -0.015492145903408527, 0.46931853890419006, + -0.4815196692943573, -0.23028719425201416, -0.24661526083946228, + -0.22366689145565033, -0.6485911011695862, -0.011641554534435272, + -0.8092096447944641, -0.737714409828186, -0.17296408116817474, + ]), + ], + ) + return _model(graph, opset=9, ir_version=6, producer_name='pytorch', producer_version='1.9') + + +def make_Linear_16(): + """Ops: Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm""" + nodes = [ + helper.make_node( + 'Gemm', + ['input.1', '0.weight', '0.bias'], + ['21'], + name='Gemm_0', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['21'], ['22'], name='Relu_1'), + helper.make_node( + 'Gemm', + ['22', '2.weight', '2.bias'], + ['23'], + name='Gemm_2', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['23'], ['24'], name='Relu_3'), + helper.make_node( + 'Gemm', + ['24', '4.weight', '4.bias'], + ['25'], + name='Gemm_4', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['25'], ['26'], name='Relu_5'), + helper.make_node( + 'Gemm', + ['26', '6.weight', '6.bias'], + ['27'], + name='Gemm_6', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['27'], ['28'], name='Relu_7'), + helper.make_node( + 'Gemm', + ['28', '8.weight', '8.bias'], + ['29'], + name='Gemm_8', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['29'], ['30'], name='Relu_9'), + helper.make_node( + 'Gemm', + ['30', '10.weight', '10.bias'], + ['31'], + name='Gemm_10', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['31'], ['32'], name='Relu_11'), + helper.make_node( + 'Gemm', + ['32', '12.weight', '12.bias'], + ['33'], + name='Gemm_12', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['33'], ['34'], name='Relu_13'), + helper.make_node( + 'Gemm', + ['34', '14.weight', '14.bias'], + ['35'], + name='Gemm_14', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['35'], ['36'], name='Relu_15'), + helper.make_node( + 'Gemm', + ['36', '16.weight', '16.bias'], + ['37'], + name='Gemm_16', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['37'], ['38'], name='Relu_17'), + helper.make_node( + 'Gemm', + ['38', '18.weight', '18.bias'], + ['39'], + name='Gemm_18', + alpha=1.0, + beta=1.0, + transB=1, + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('input.1', FLOAT, [16, 100]), + ], + outputs=[ + _vi('39', FLOAT, [16, 10]), + ], + initializer=[ + _tensor('0.bias', FLOAT, [50], [ + 0.06874362379312515, 0.1215260922908783, -0.03796323388814926, + -0.047220371663570404, 0.0851314440369606, 0.09796275943517685, + 0.12071841955184937, 0.07664817571640015, 0.11198078840970993, 0.02310258150100708, + 0.07579555362462997, 0.05929337441921234, -0.036450356245040894, + 0.11803308129310608, -0.011961907148361206, -0.08527068793773651, + -0.057033807039260864, 0.1044885590672493, -0.018882740288972855, + -0.008054572157561779, 0.10694648325443268, -0.022059820592403412, + 0.09017779678106308, 0.1540471315383911, 0.1271747350692749, 0.06436201930046082, + 0.1194877177476883, -0.010833785869181156, 0.1089724600315094, + -0.044143423438072205, 0.06858711689710617, -0.03810128942131996, + 0.0594230554997921, 0.011302107945084572, 0.16360539197921753, + -0.03886178508400917, 0.06342087686061859, 0.10477621853351593, + 0.07790201157331467, 0.025975681841373444, 0.15242689847946167, + -0.07979436218738556, -0.015697987750172615, 0.16126343607902527, + 0.058438144624233246, -0.007473993580788374, 0.09990260750055313, + 0.06640422344207764, -0.02770175412297249, 0.049512993544340134, + ]), + _random_tensor('0.weight', [50, 100], seed=111), + _tensor('10.bias', FLOAT, [50], [ + 0.12787356972694397, 0.01754315197467804, 0.12297597527503967, 0.07300411909818649, + 0.05101786553859711, -0.009935596957802773, 0.13993382453918457, + 0.15092433989048004, 0.06841301918029785, -0.03337057679891586, + -0.18426062166690826, -0.13440611958503723, 0.10937852412462234, + 0.11137652397155762, -0.10483825951814651, -0.02507081814110279, + 0.12054929882287979, 0.0411001481115818, 0.1838451772928238, 0.13574835658073425, + -0.0077139283530414104, -0.12025056034326553, 0.0854426920413971, + -0.05131257325410843, 0.13684552907943726, -0.014523052610456944, + -0.08954862505197525, -0.025241060182452202, -0.008962735533714294, + 0.09331826120615005, -0.10867604613304138, -0.10423946380615234, + 0.17008665204048157, -0.03412630781531334, 0.07280059158802032, + -0.04532545059919357, -0.10004503279924393, -0.11012918502092361, + -0.0077126519754529, -0.1191520020365715, 0.12147060036659241, 0.10113030672073364, + 0.03328618407249451, 0.014212618581950665, -0.010599344968795776, + 0.10923430323600769, -0.01827055774629116, 0.17716272175312042, + 0.06910598278045654, -0.07394197583198547, + ]), + _random_tensor('10.weight', [50, 50], seed=112), + _tensor('12.bias', FLOAT, [50], [ + -0.06509873270988464, 0.05613470822572708, -0.05249607563018799, + -0.060684677213430405, 0.055331166833639145, 0.08404038101434708, + 0.0655064731836319, 0.13225528597831726, 0.035152286291122437, -0.0857200175523758, + 0.04633798822760582, -0.13850943744182587, -0.030993010848760605, + 0.07260533422231674, -0.0611225962638855, 0.04004671797156334, 0.03332715854048729, + -0.13936835527420044, -0.11538780480623245, 0.03552905097603798, + -0.07537106424570084, -0.10834012180566788, -0.16588839888572693, + 0.058801423758268356, 0.0744016021490097, 0.07377104461193085, + -0.16663652658462524, 0.13944970071315765, -0.10723331570625305, + 0.16675545275211334, 0.11190473288297653, 0.1424584835767746, -0.10559768974781036, + 0.17358238995075226, 0.024868786334991455, -0.008324883878231049, + -0.009020783007144928, 0.09669970721006393, 0.1663464903831482, + 0.051099903881549835, -0.11830130964517593, -0.13791216909885406, + -0.054981157183647156, -0.14046736061573029, 0.024868272244930267, + -0.0492456778883934, 0.13240450620651245, -0.1366450935602188, + -0.006306866183876991, -0.06659865379333496, + ]), + _random_tensor('12.weight', [50, 50], seed=113), + _tensor('14.bias', FLOAT, [50], [ + 0.016014426946640015, 0.06593047082424164, -0.1345161348581314, + -0.1251203864812851, -0.12696857750415802, 0.011852066963911057, + 0.1119963675737381, -0.0366256982088089, -0.07817808538675308, + -0.0018910560756921768, -0.07488702237606049, 0.11818061023950577, + -0.04405388981103897, -0.014389574527740479, 0.072415791451931, + -0.040516626089811325, -0.06337642669677734, -0.038087353110313416, + 0.06708531081676483, 0.060243379324674606, 0.09579991549253464, + -0.0834713950753212, -0.04309255629777908, -0.039707157760858536, + -0.02101474069058895, -0.004626616835594177, 0.09738843142986298, + -0.15382537245750427, -0.14784333109855652, 0.012172728776931763, + 0.18078944087028503, 0.018331220373511314, -0.1306842863559723, + -0.1078730896115303, -0.049283646047115326, -0.04442322626709938, + -0.05975477397441864, -0.03484858572483063, -0.1593368649482727, + 0.04525914043188095, -0.028948737308382988, 0.09824682772159576, + -0.017328474670648575, -0.10201127827167511, 0.021711774170398712, + 0.02649231068789959, 0.1379029005765915, 0.0019947874825447798, + -0.09130772948265076, 0.07110419124364853, + ]), + _random_tensor('14.weight', [50, 50], seed=114), + _tensor('16.bias', FLOAT, [50], [ + -0.14252740144729614, 0.16887430846691132, -0.0887828916311264, + -0.06314415484666824, -0.06602327525615692, 0.05441824719309807, + 0.06415509432554245, 0.06069942191243172, -0.0223076269030571, 0.10297013819217682, + 0.025865202769637108, -0.08093931525945663, -0.027676187455654144, + 0.05468316376209259, 0.1288861781358719, -0.0795307531952858, + -0.018913164734840393, -0.1207500547170639, 0.17368493974208832, + -0.049284402281045914, -0.05787952244281769, 0.06717755645513535, + 0.012359170243144035, 0.13264226913452148, -0.05257987976074219, + 0.017382705584168434, 0.06598390638828278, -0.09585361182689667, + 0.07884091138839722, 0.010707235895097256, 0.04929834231734276, + -0.025524809956550598, 0.051943808794021606, 0.13757683336734772, + -0.11596449464559555, -0.07238765060901642, 0.11116628348827362, + -0.11908264458179474, -0.08664168417453766, 0.09629549086093903, + 0.11060114204883575, -0.013693519867956638, -0.1386561542749405, + -0.06237578019499779, 0.08550456911325455, -0.12340494990348816, + 0.06833907216787338, -0.017610615119338036, -0.04134988784790039, + 0.02336009591817856, + ]), + _random_tensor('16.weight', [50, 50], seed=115), + _tensor('18.bias', FLOAT, [10], [ + -0.028683319687843323, 0.031511370092630386, -0.015858041122555733, + 0.04559389129281044, 0.09545835852622986, -0.10511715710163116, + -0.07386839389801025, -0.11918522417545319, -0.06869250535964966, + 0.09922939538955688, + ]), + _random_tensor('18.weight', [10, 50], seed=116), + _tensor('2.bias', FLOAT, [50], [ + -0.044733885675668716, 0.053787779062986374, 0.07859575748443604, + -0.06343381106853485, 0.15348155796527863, 0.14867684245109558, + 0.02656984142959118, -0.026198450475931168, -0.07519230246543884, + -0.03524557128548622, 0.09328898042440414, 0.11387166380882263, + -0.019346164539456367, 0.17526762187480927, -0.07706878334283829, + 0.15751178562641144, 0.019623270258307457, -0.07372663915157318, + 0.08727440983057022, 0.11638835817575455, 0.16839821636676788, 0.04258020967245102, + -0.10223003476858139, 0.06937894970178604, -0.0855393335223198, + 0.12638899683952332, 0.020591460168361664, 0.1405806839466095, + -0.0023452509194612503, -0.029579175636172295, 0.019782187417149544, + 0.06618925929069519, 0.16647274792194366, 0.14933745563030243, + 0.051312513649463654, 0.0006887729396112263, -0.07575076073408127, + -0.054050710052251816, 0.13494345545768738, 0.025651181116700172, + -0.09433789551258087, -0.02612384594976902, 0.030958404764533043, + 0.11118845641613007, 0.16908417642116547, 0.1360965222120285, 0.0985386073589325, + 0.048001762479543686, -0.047142088413238525, 0.12221584469079971, + ]), + _random_tensor('2.weight', [50, 50], seed=117), + _tensor('4.bias', FLOAT, [50], [ + 0.04200629144906998, -0.05310118943452835, -0.04059197008609772, + 0.1476421356201172, -0.044893037527799606, -0.0946018248796463, + 0.03687572851777077, 0.08952753245830536, -0.0013579304795712233, + -0.04650532454252243, 0.10455886274576187, 0.04649180546402931, + -0.09281352907419205, 0.14577698707580566, -0.04373973235487938, + 0.07441886514425278, -0.09758659452199936, 0.07919350266456604, + -0.07836516946554184, 0.03809545934200287, -0.06411395221948624, + 0.0319918617606163, 0.051943857222795486, 0.00847010500729084, 0.12449851632118225, + 0.18247577548027039, -0.05370906740427017, 0.058310382068157196, + -0.04016480967402458, 0.008250949904322624, -0.06189260259270668, + -0.12295297533273697, 0.07729160040616989, 0.014789585024118423, + 0.10187598317861557, 0.0958903431892395, 0.06446435302495956, 0.012280937284231186, + 0.14996418356895447, -0.1411341279745102, -0.08492119610309601, + -0.011174597777426243, -0.06453771144151688, -0.0344211682677269, + 0.0628582313656807, 0.0434207059442997, -0.04334687814116478, + -0.029960226267576218, 0.15525946021080017, -0.04480167105793953, + ]), + _random_tensor('4.weight', [50, 50], seed=118), + _tensor('6.bias', FLOAT, [50], [ + -0.1301494687795639, -0.016671590507030487, 0.09305505454540253, + -0.0024569956585764885, -0.10665174573659897, 0.049031224101781845, + -0.022929606959223747, 0.02805551514029503, -0.1490677148103714, + 0.1025087982416153, 0.00938428845256567, 0.15098121762275696, -0.11440007388591766, + -0.06450272351503372, 0.016750779002904892, -0.08418712019920349, + -0.14083871245384216, 0.03546612709760666, -0.12778249382972717, + -0.10786302387714386, 0.0691528245806694, 0.04630193114280701, 0.09610986709594727, + 0.06807758659124374, -0.11870553344488144, -0.07684986293315887, + 0.17632094025611877, 0.11957243084907532, -0.018469832837581635, + 0.061927877366542816, 0.09733913093805313, 0.06544090062379837, + 0.08407261222600937, -0.09821699559688568, -0.02714831940829754, + 0.11982957273721695, -0.05582385137677193, 0.08686035871505737, 0.1096935048699379, + -0.12632803618907928, 0.16949345171451569, -0.1535651534795761, + -0.07482590526342392, 0.013653061352670193, 0.007351913955062628, + 0.12195851653814316, 0.002472013235092163, -0.03045388124883175, + -0.06886417418718338, 0.053352996706962585, + ]), + _random_tensor('6.weight', [50, 50], seed=119), + _tensor('8.bias', FLOAT, [50], [ + 0.0448136180639267, -0.029453275725245476, 0.005919584538787603, + -0.011282878927886486, 0.05477000027894974, 0.10227928310632706, + 0.005549189634621143, 0.09336987882852554, 0.1386832445859909, 0.15307164192199707, + -0.02468901313841343, -0.0662059560418129, 0.0102847283706069, + -0.02171068638563156, -0.11153922975063324, -0.08330245316028595, + 0.06905094534158707, 0.057425979524850845, 0.03267614543437958, + 0.04805871099233627, 0.09321744740009308, 0.1732863485813141, 0.043798334896564484, + 0.06929294764995575, -0.14251939952373505, 0.016439231112599373, + -0.052573300898075104, -0.09261982887983322, 0.015587260015308857, + 0.12414858490228653, 0.15976372361183167, -0.1122899278998375, 0.12213458120822906, + -0.03298468515276909, 0.12397517263889313, 0.008843302726745605, + -0.12524719536304474, -0.10820302367210388, -0.09638859331607819, + 0.12722527980804443, 0.10527792572975159, -0.08983974158763885, + 0.10839671641588211, 0.13300462067127228, 0.11159244924783707, + -0.054800763726234436, 0.1124715581536293, 0.09525484591722488, + -0.04181470349431038, 0.049590643495321274, + ]), + _random_tensor('8.weight', [50, 50], seed=120), + ], + ) + return _model(graph, opset=9, ir_version=6, producer_name='pytorch', producer_version='1.5') + + +def make_Linear_32(): + """Ops: Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm""" + nodes = [ + helper.make_node( + 'Gemm', + ['input.1', '0.weight', '0.bias'], + ['21'], + name='Gemm_0', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['21'], ['22'], name='Relu_1'), + helper.make_node( + 'Gemm', + ['22', '2.weight', '2.bias'], + ['23'], + name='Gemm_2', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['23'], ['24'], name='Relu_3'), + helper.make_node( + 'Gemm', + ['24', '4.weight', '4.bias'], + ['25'], + name='Gemm_4', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['25'], ['26'], name='Relu_5'), + helper.make_node( + 'Gemm', + ['26', '6.weight', '6.bias'], + ['27'], + name='Gemm_6', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['27'], ['28'], name='Relu_7'), + helper.make_node( + 'Gemm', + ['28', '8.weight', '8.bias'], + ['29'], + name='Gemm_8', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['29'], ['30'], name='Relu_9'), + helper.make_node( + 'Gemm', + ['30', '10.weight', '10.bias'], + ['31'], + name='Gemm_10', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['31'], ['32'], name='Relu_11'), + helper.make_node( + 'Gemm', + ['32', '12.weight', '12.bias'], + ['33'], + name='Gemm_12', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['33'], ['34'], name='Relu_13'), + helper.make_node( + 'Gemm', + ['34', '14.weight', '14.bias'], + ['35'], + name='Gemm_14', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['35'], ['36'], name='Relu_15'), + helper.make_node( + 'Gemm', + ['36', '16.weight', '16.bias'], + ['37'], + name='Gemm_16', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['37'], ['38'], name='Relu_17'), + helper.make_node( + 'Gemm', + ['38', '18.weight', '18.bias'], + ['39'], + name='Gemm_18', + alpha=1.0, + beta=1.0, + transB=1, + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('input.1', FLOAT, [32, 100]), + ], + outputs=[ + _vi('39', FLOAT, [32, 10]), + ], + initializer=[ + _tensor('0.bias', FLOAT, [50], [ + 0.11124264448881149, 0.09824328124523163, 0.008467835374176502, + -0.06339164823293686, -0.04812309890985489, 0.07819465547800064, + 0.04600067436695099, 0.12569192051887512, -0.006026973016560078, + 0.042687151581048965, 0.054539717733860016, 0.03256354108452797, + 0.1459706425666809, 0.011990390717983246, 0.11928670108318329, + -0.035920701920986176, -0.01965402625501156, 0.01519996952265501, + -0.020567703992128372, 0.006464967038482428, -0.040367837995290756, + 0.1230701357126236, 0.10814201086759567, 0.032152947038412094, 0.0349125899374485, + 0.09016934037208557, -0.0026081986725330353, 0.08004175126552582, + 0.08260804414749146, -0.030275214463472366, -0.017403658479452133, + 0.06508535891771317, 0.07616975903511047, 0.12453043460845947, 0.05175986513495445, + -0.034277405589818954, -0.001854078029282391, 0.07586805522441864, + -0.03652631491422653, -0.033068954944610596, -0.04171779379248619, + 0.01669793576002121, 0.11060179024934769, 0.07502856105566025, + -0.009946250356733799, 0.11157600581645966, 0.11138223856687546, + 0.0743454173207283, 0.05090726912021637, -0.05379515886306763, + ]), + _random_tensor('0.weight', [50, 100], seed=121), + _tensor('10.bias', FLOAT, [50], [ + 0.023677507415413857, 0.01546807587146759, 0.12556889653205872, + -0.025954080745577812, 0.13634377717971802, 0.022078335285186768, + 0.044483307749032974, 0.06803391128778458, -0.1336556077003479, + -0.02744845300912857, -0.07780878245830536, 0.060131218284368515, + 0.08147525042295456, -0.1075383722782135, 0.038635917007923126, + 0.04753212630748749, 0.007815081626176834, -0.091900534927845, + -0.040418289601802826, 0.12894690036773682, 0.04103463888168335, + 0.05978541821241379, -0.01061064749956131, -0.11792825162410736, + -0.03278864547610283, 0.11842191964387894, -0.0180479995906353, + -0.10795165598392487, 0.08416201174259186, 0.13871043920516968, + -0.09923344850540161, 0.0004032762080896646, -0.01704275608062744, + -0.09447328001260757, 0.02773180603981018, 0.03783107176423073, + 0.11792910844087601, -0.10673742741346359, 0.0416945181787014, 0.14280104637145996, + 0.08878400176763535, -0.08478271961212158, 0.14648577570915222, 0.1269282102584839, + 0.07769495993852615, -0.09769672155380249, -0.12921839952468872, + -0.08971879631280899, 0.13251297175884247, -0.05491340905427933, + ]), + _random_tensor('10.weight', [50, 50], seed=122), + _tensor('12.bias', FLOAT, [50], [ + -0.06826256215572357, 0.0388849675655365, 0.07320192456245422, 0.08387485146522522, + -0.07019667327404022, 0.12242702394723892, -0.09621168673038483, + 0.11204088479280472, -0.13937069475650787, -0.0626523569226265, + 0.056398920714855194, 0.1534673422574997, -0.001662513823248446, + -0.10726587474346161, 0.15035594999790192, -0.014129229821264744, + 0.11882692575454712, 0.015099582262337208, 0.1413463056087494, + 0.0007984754047356546, 0.08997610211372375, -0.07151174545288086, + 0.11034654080867767, -0.07181119918823242, 0.09321177005767822, + -0.042380593717098236, -0.10582658648490906, 0.10396461933851242, + 0.045979660004377365, 0.12390460819005966, -0.01176830567419529, + 0.1260722577571869, -0.004162704572081566, 0.032158028334379196, + 0.05012675002217293, 0.010814670473337173, 0.061898116022348404, + 0.02869694121181965, 0.06419070810079575, -0.05789436399936676, + -0.08914010971784592, 0.07718385756015778, -0.11866763234138489, + 0.046556998044252396, 0.010457875207066536, -0.11218304932117462, + 0.03364101052284241, -0.050707247108221054, -0.04438620060682297, 0.1124512255191803, + ]), + _random_tensor('12.weight', [50, 50], seed=123), + _tensor('14.bias', FLOAT, [50], [ + -0.042912423610687256, -0.08314505219459534, 0.010369965806603432, + 0.10941207408905029, -0.06298284977674484, 0.0006218135822564363, + -0.046892426908016205, 0.14291897416114807, -0.1065610870718956, + 0.12685929238796234, -0.06573846936225891, -0.08174490928649902, + -0.12673887610435486, 0.11660975217819214, -0.13191364705562592, + 0.1266399770975113, 0.10539578646421432, -0.03997437655925751, 0.08274240791797638, + -0.05659307911992073, -0.016876066103577614, -0.0644751563668251, + 0.09650067239999771, -0.1165977269411087, 0.02729981020092964, 0.1455359309911728, + 0.03180919587612152, -0.1552070677280426, 0.12558980286121368, + 0.018251288682222366, 0.03671560436487198, 0.08113941550254822, 0.0933469608426094, + 0.12075929343700409, -0.1378369927406311, 0.03614622354507446, 0.11320675164461136, + -0.008757159113883972, -0.11563608795404434, 0.08717223256826401, + -0.1610676348209381, 0.058534447103738785, 0.13570138812065125, + 0.09963928163051605, 0.015034488402307034, 0.05861431732773781, 0.1055833026766777, + -0.051912613213062286, -0.013903460465371609, 0.11571002751588821, + ]), + _random_tensor('14.weight', [50, 50], seed=124), + _tensor('16.bias', FLOAT, [50], [ + 0.13645648956298828, 0.10871178656816483, -0.04361168295145035, + 0.06587550044059753, 0.0516870953142643, -0.012960155494511127, + 0.10853584110736847, -0.010951125994324684, -0.1266385167837143, + -0.1094653308391571, 0.12544943392276764, -0.08655308932065964, + 0.024057991802692413, 0.0033439581748098135, 0.10357099026441574, + -0.042763128876686096, 0.13817517459392548, -0.06586167216300964, + -0.14774498343467712, -0.10796114802360535, -0.02931831032037735, + -0.09633642435073853, 0.09680622816085815, -0.05977587401866913, + 0.06083926931023598, -0.04657533019781113, 0.06506074219942093, + -0.15826131403446198, -0.0730171725153923, -0.006507332436740398, + 0.12966391444206238, 0.031853556632995605, 0.05254780873656273, + 0.08588340133428574, 0.12415903806686401, 0.11529742181301117, + -0.10537046194076538, -0.13778118789196014, -0.10065561532974243, + -0.02065938338637352, 0.0062689147889614105, -0.17919579148292542, + -0.1153501570224762, 0.10259155184030533, 0.02723391354084015, 0.08433964848518372, + 0.007203978020697832, 0.07054678350687027, 0.07516984641551971, -0.13919509947299957, + ]), + _random_tensor('16.weight', [50, 50], seed=125), + _tensor('18.bias', FLOAT, [10], [ + -0.0845300629734993, 0.06066350266337395, -0.0744476318359375, + -0.11339960992336273, 0.07592877745628357, -0.07158249616622925, + 0.030116315931081772, -0.13125865161418915, 0.02029414474964142, + -0.02809321880340576, + ]), + _random_tensor('18.weight', [10, 50], seed=126), + _tensor('2.bias', FLOAT, [50], [ + 0.09465888142585754, -0.04027128964662552, 0.08556117117404938, + 9.81339908321388e-05, 0.10296808928251266, 0.031810734421014786, + 0.12633393704891205, -0.04990290105342865, -0.051970064640045166, + 0.08027298748493195, 0.10882756114006042, 0.062105171382427216, + 0.008045201189815998, 0.08600206673145294, 0.06580343842506409, + 0.15130916237831116, -0.08689317107200623, -0.07181258499622345, + 0.11189711093902588, -0.017252318561077118, -0.11066558957099915, + 0.07146942615509033, -0.005338592920452356, 0.09884057939052582, + 0.08768560737371445, 0.06407410651445389, -0.03988203778862953, + -0.06665781140327454, 0.039171550422906876, 0.054918356239795685, + -0.04876664653420448, -0.020347272977232933, 0.0013799254084005952, + 0.09394200146198273, -0.03622853010892868, -0.0942491963505745, + 0.05046489089727402, 0.02834177017211914, -0.04078937694430351, + -0.01767958141863346, 0.12003850191831589, -0.10315573215484619, + -0.042500488460063934, 0.15254095196723938, 0.09979313611984253, + 0.03916972875595093, -0.007253315299749374, -0.0852055475115776, + 0.0820893943309784, 0.1186923235654831, + ]), + _random_tensor('2.weight', [50, 50], seed=127), + _tensor('4.bias', FLOAT, [50], [ + 0.024598661810159683, 0.08616624027490616, 0.038595184683799744, + 0.08363842964172363, 0.09489761292934418, -0.04017442837357521, + 0.06529752165079117, 0.10095158964395523, 0.14577096700668335, 0.06753067672252655, + -0.0175277441740036, 0.030973171815276146, 0.03054368868470192, + -0.08081741631031036, 0.08830731362104416, 0.0858900398015976, 0.06582188606262207, + -0.08109358698129654, 0.11148745566606522, 0.07020239531993866, 0.146789088845253, + 0.14938125014305115, 0.006371157709509134, -0.08334558457136154, + 0.14391906559467316, 0.03840988501906395, 0.11901327967643738, 0.10867060720920563, + 0.034775227308273315, 0.11030173301696777, 0.024303283542394638, + -0.11603455990552902, -0.03790628910064697, 0.13132940232753754, + -0.13394464552402496, -0.04722129553556442, 0.03803771734237671, + 0.03392547369003296, 0.06807977706193924, -0.042708538472652435, + 0.1414441466331482, -0.06422796100378036, -0.05185883864760399, + -0.050145845860242844, -0.06538667529821396, -0.1171017587184906, + 0.09188596159219742, 0.11895687878131866, -0.09153135120868683, 0.09006752818822861, + ]), + _random_tensor('4.weight', [50, 50], seed=128), + _tensor('6.bias', FLOAT, [50], [ + -0.1229783222079277, 0.11139104515314102, -0.10524418950080872, + 0.0016380425076931715, 0.07938187569379807, 0.003908644896000624, + -0.028028862550854683, -0.03216879814863205, -0.031408797949552536, + -0.04045102000236511, 0.09041076898574829, 0.015676679089665413, + -0.002135281218215823, -0.11499056965112686, -0.007753490470349789, + 0.025194739922881126, 0.13036774098873138, 0.11130959540605545, + -0.09819938987493515, 0.040943779051303864, 0.03980429843068123, + 0.08250012993812561, 0.14428070187568665, 0.041119564324617386, + -0.02864460088312626, -0.01911313831806183, -0.03500247001647949, + -0.0062780012376606464, -0.11006780713796616, -0.011378481984138489, + 0.09277238696813583, 0.017135074362158775, -0.1253904551267624, + -0.02176308073103428, -0.10329070687294006, 0.151449516415596, 0.133637934923172, + 0.056119631975889206, 0.005917373578995466, -0.07999040931463242, + -0.04148922860622406, 0.009720489382743835, 0.031680550426244736, + 0.13133378326892853, 0.0069076018407940865, 0.15768522024154663, + -0.011727947741746902, 0.032221000641584396, -0.03057415783405304, + 0.08015977591276169, + ]), + _random_tensor('6.weight', [50, 50], seed=129), + _tensor('8.bias', FLOAT, [50], [ + -0.08394850790500641, -0.08946047723293304, 0.0023817981127649546, + 0.08956918865442276, 0.11502696573734283, 0.1312992125749588, -0.10089538991451263, + 0.06887184828519821, -0.05314618721604347, -0.11070530861616135, + -0.10399400442838669, -0.09465840458869934, -0.07996507734060287, + -0.055972978472709656, -0.0011011596070602536, -0.11151980608701706, + -0.01033539418131113, 0.08838698267936707, -0.013264666311442852, + 0.1253567337989807, 0.028946250677108765, 0.08221150189638138, 0.08310119807720184, + 0.11621533334255219, -0.008178315125405788, -0.08422097563743591, + 0.014766180887818336, 0.09799371659755707, 0.05157942697405815, + 0.08685771375894547, -0.1275632679462433, 0.11424566060304642, + -0.04376813769340515, -0.08646500110626221, 0.07470041513442993, + -0.001382552902214229, 0.06231479346752167, 0.03777238354086876, + -0.03722120448946953, 0.06540307402610779, 0.023184368386864662, + -0.05114809796214104, -0.04856577143073082, -0.059934988617897034, + 0.1061999574303627, 0.1266958862543106, 0.009567365981638432, -0.03149254247546196, + 0.10635311156511307, -0.1022690087556839, + ]), + _random_tensor('8.weight', [50, 50], seed=130), + ], + ) + return _model(graph, opset=9, ir_version=6, producer_name='pytorch', producer_version='1.5') + + +def make_Linear_64(): + """Ops: Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm, Relu, Gemm""" + nodes = [ + helper.make_node( + 'Gemm', + ['input.1', '0.weight', '0.bias'], + ['21'], + name='Gemm_0', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['21'], ['22'], name='Relu_1'), + helper.make_node( + 'Gemm', + ['22', '2.weight', '2.bias'], + ['23'], + name='Gemm_2', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['23'], ['24'], name='Relu_3'), + helper.make_node( + 'Gemm', + ['24', '4.weight', '4.bias'], + ['25'], + name='Gemm_4', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['25'], ['26'], name='Relu_5'), + helper.make_node( + 'Gemm', + ['26', '6.weight', '6.bias'], + ['27'], + name='Gemm_6', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['27'], ['28'], name='Relu_7'), + helper.make_node( + 'Gemm', + ['28', '8.weight', '8.bias'], + ['29'], + name='Gemm_8', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['29'], ['30'], name='Relu_9'), + helper.make_node( + 'Gemm', + ['30', '10.weight', '10.bias'], + ['31'], + name='Gemm_10', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['31'], ['32'], name='Relu_11'), + helper.make_node( + 'Gemm', + ['32', '12.weight', '12.bias'], + ['33'], + name='Gemm_12', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['33'], ['34'], name='Relu_13'), + helper.make_node( + 'Gemm', + ['34', '14.weight', '14.bias'], + ['35'], + name='Gemm_14', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['35'], ['36'], name='Relu_15'), + helper.make_node( + 'Gemm', + ['36', '16.weight', '16.bias'], + ['37'], + name='Gemm_16', + alpha=1.0, + beta=1.0, + transB=1, + ), + helper.make_node('Relu', ['37'], ['38'], name='Relu_17'), + helper.make_node( + 'Gemm', + ['38', '18.weight', '18.bias'], + ['39'], + name='Gemm_18', + alpha=1.0, + beta=1.0, + transB=1, + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('input.1', FLOAT, [64, 100]), + ], + outputs=[ + _vi('39', FLOAT, [64, 10]), + ], + initializer=[ + _tensor('0.bias', FLOAT, [50], [ + 0.09159639477729797, -0.006669722031801939, 0.13838760554790497, + 0.007312551606446505, 0.050098199397325516, 0.15664000809192657, + 0.1113118976354599, -0.01220855861902237, 0.04115782678127289, 0.09007082134485245, + 0.04722576215863228, 0.050395555794239044, 0.04292930290102959, + -0.0252480898052454, 0.038219235837459564, 0.15084995329380035, 0.1120382621884346, + 0.04777619615197182, 0.04694032296538353, 0.03356737643480301, 0.14677441120147705, + 0.005037274677306414, -0.013039053417742252, 0.005265332292765379, + -0.036055635660886765, -0.03629482164978981, 0.08636198192834854, + 0.06236021965742111, -0.06167418509721756, -0.05445173755288124, + 0.06576776504516602, -0.004990452900528908, 0.051186129450798035, + 0.003741896478459239, -0.06545235961675644, -0.05202485993504524, + 0.07194308191537857, 0.13038986921310425, 0.016981661319732666, + -0.04673358425498009, 0.11374427378177643, -0.025251995772123337, + 0.014630576595664024, 0.0005040550604462624, 0.10728251188993454, + 0.008620365522801876, 0.0760183185338974, 0.07534903287887573, + 0.018748648464679718, -0.09183405339717865, + ]), + _random_tensor('0.weight', [50, 100], seed=131), + _tensor('10.bias', FLOAT, [50], [ + 0.023598425090312958, -0.13623277842998505, 0.07419407367706299, + -0.05104606971144676, -0.011362170800566673, 0.06712517142295837, + 0.08822090178728104, -0.0020764917135238647, 0.11936502158641815, + -0.06489405781030655, -0.10444420576095581, 0.037246569991111755, + -0.08549445867538452, 0.13663238286972046, -0.13414929807186127, + 0.0032362418714910746, -0.12991856038570404, 0.005575540475547314, + 0.08955343067646027, 0.08483952283859253, 0.1431363821029663, 0.048573967069387436, + -0.1422257423400879, 0.04993279650807381, 0.11434306204319, -0.0134720578789711, + 0.004054172430187464, -0.14051389694213867, 0.04162381589412689, + -0.15304715931415558, 0.0083013866096735, -0.03706217184662819, + 0.010971440933644772, -0.06586533039808273, 0.018230563029646873, + 0.030368328094482422, 0.13547532260417938, -0.07951928675174713, + 0.13427899777889252, 0.02883337251842022, -0.06782680749893188, + 0.07169642299413681, -0.007853972725570202, -0.0510685108602047, + -0.11296464502811432, -0.027279041707515717, 0.13714829087257385, + 0.07250010967254639, -0.0007291536312550306, -0.06502445042133331, + ]), + _random_tensor('10.weight', [50, 50], seed=132), + _tensor('12.bias', FLOAT, [50], [ + -0.0801251232624054, -0.05511970445513725, 0.03490331768989563, + 0.02558317594230175, 0.05685405805706978, -0.0002709181571844965, + 0.020529454573988914, 0.16004309058189392, -0.0037057101726531982, + 0.021892093122005463, 0.0422116257250309, 0.13861492276191711, 0.04279313609004021, + -0.06523241847753525, 0.025549277663230896, -0.11060528457164764, + -0.11546116322278976, 0.05192999541759491, -0.12274068593978882, + -0.047401707619428635, -0.09217683970928192, -0.05534840375185013, + 0.12988485395908356, 0.06574156880378723, -0.0901506319642067, + 0.049082305282354355, 0.021567750722169876, -0.03045421838760376, + -0.04347901791334152, -0.02055964060127735, -0.13669030368328094, + 0.08841653913259506, 0.06565003842115402, 0.029235024005174637, + 0.04059187322854996, -0.06516950577497482, 0.07286635041236877, + 0.027074089273810387, 0.05025995522737503, 0.046343252062797546, + 0.13113434612751007, -0.040170587599277496, 0.0747847706079483, + 0.14416146278381348, -0.07301327586174011, -0.13885334134101868, + 0.061743613332509995, 0.015627363696694374, -0.14226868748664856, + -0.040349800139665604, + ]), + _random_tensor('12.weight', [50, 50], seed=133), + _tensor('14.bias', FLOAT, [50], [ + 0.06647215783596039, 0.09063264727592468, -0.13074101507663727, + -0.13949799537658691, 0.004678502678871155, -0.016874082386493683, + -0.0011929124593734741, 0.03477223217487335, -0.14273054897785187, + -0.12513236701488495, -0.1137811541557312, -0.10309846699237823, + 0.08320702612400055, -0.17264628410339355, -0.1673404425382614, + -0.02677275612950325, 0.13770265877246857, -0.12795111536979675, + 0.11456170678138733, -0.01058092713356018, -0.04381580278277397, + -0.14236316084861755, 0.04663165286183357, 0.09976256638765335, + -0.016420619562268257, -0.03107152134180069, -0.11892712116241455, + -0.14145000278949738, -0.09588667750358582, -0.10125806927680969, + -0.07667424529790878, 0.08648142218589783, 0.13760849833488464, + 0.020085202530026436, -0.1349070966243744, -0.05883036181330681, + 0.06423906236886978, 0.021977975964546204, 0.004053518176078796, + -0.11900798976421356, 0.09760946035385132, -0.07316134124994278, + -0.12477194517850876, 0.05623914301395416, -0.1079934686422348, + 0.15659739077091217, 0.06688092648983002, -0.020453844219446182, + -0.06655491888523102, 0.042102597653865814, + ]), + _random_tensor('14.weight', [50, 50], seed=134), + _tensor('16.bias', FLOAT, [50], [ + 0.12710162997245789, -0.11911947280168533, -0.07807320356369019, + -0.035091958940029144, -0.1217832863330841, 0.07629904896020889, + 0.03150901570916176, 0.050709955394268036, 0.0009314765920862556, + 0.01097114384174347, 0.08148525655269623, 0.12900851666927338, 0.0837954506278038, + -0.10252774506807327, 0.026486115530133247, 0.12476948648691177, + 0.11806709319353104, -0.06699508428573608, -0.06001771613955498, + 0.025374993681907654, -0.16904965043067932, 0.07055971026420593, + -0.087677963078022, -0.06734836846590042, 0.09914802014827728, + -0.02004489302635193, 0.021534450352191925, -0.1340482234954834, + 0.10110945254564285, 0.11758943647146225, -0.1362207531929016, -0.0481615886092186, + -0.012928187847137451, -0.0925549864768982, -0.06118923798203468, + -0.1054878681898117, -0.11407053470611572, -0.07652084529399872, + -0.015235151164233685, 0.030054721981287003, -0.13776032626628876, + -0.07530069351196289, -0.06638159602880478, -0.14768138527870178, + -0.015214302577078342, -0.125348299741745, 0.0817929357290268, 0.12177981436252594, + -0.09903938323259354, 0.004565980285406113, + ]), + _random_tensor('16.weight', [50, 50], seed=135), + _tensor('18.bias', FLOAT, [10], [ + 0.09701453149318695, 0.03215126693248749, -0.0013841761974617839, + -0.03331436961889267, 0.059485986828804016, -0.09943024069070816, + 0.06851242482662201, 0.022922510281205177, 0.06729692965745926, + -0.051858361810445786, + ]), + _random_tensor('18.weight', [10, 50], seed=136), + _tensor('2.bias', FLOAT, [50], [ + -0.057317283004522324, 0.05470332130789757, -0.00017579866107553244, + 0.025761187076568604, 0.004599941428750753, -0.1244237944483757, + 0.08218210935592651, 0.09337401390075684, 0.13487280905246735, + 0.007681787014007568, 0.17570124566555023, 0.14757677912712097, 0.1500885784626007, + -0.0012366429436951876, -0.08663220703601837, 0.02858916111290455, + -0.06410738825798035, 0.032137297093868256, -0.1023068055510521, + -0.01723470538854599, 0.0846070945262909, 0.014609461650252342, + -0.05716143921017647, 0.10196615755558014, 0.15495315194129944, + 0.012524719350039959, -0.051979098469018936, -0.001390553079545498, + -0.014226754195988178, 0.05362191051244736, 0.12925197184085846, + -0.02208387665450573, 0.17744328081607819, -0.046732302755117416, + -0.018103472888469696, 0.0403139665722847, 0.09309444576501846, + 0.07387915998697281, 0.0640542134642601, 0.06046606972813606, -0.12276843190193176, + 0.06488797813653946, 0.1577167510986328, 0.07812289893627167, 0.11168011277914047, + 0.0024907258339226246, -0.07085540145635605, -0.09919169545173645, + 0.1299211084842682, 0.14291509985923767, + ]), + _random_tensor('2.weight', [50, 50], seed=137), + _tensor('4.bias', FLOAT, [50], [ + -0.1099703386425972, 0.07785989344120026, -0.05281399190425873, + -0.03463250771164894, 0.029007652774453163, -0.054168153554201126, + 0.022841189056634903, 0.1798921525478363, 0.03891337290406227, 0.04181481525301933, + -0.011574423871934414, -0.07251907885074615, 0.1228223443031311, + 0.10927148163318634, -0.007268114946782589, -0.10726579278707504, + -0.019819920882582664, 0.13857461512088776, 0.11483220756053925, + 0.12228760123252869, -0.07547355443239212, 0.14420607686042786, + -0.033190470188856125, -0.019701037555933, -0.01583164744079113, + 0.12164537608623505, 0.05813533440232277, 0.0008929441100917757, + 0.14075720310211182, 0.019338877871632576, -0.016825949773192406, + 0.14181609451770782, 0.01773025095462799, 0.06352683901786804, + -0.07688445597887039, 0.15308715403079987, -0.03269578516483307, + 0.019046491011977196, -0.10575303435325623, 0.10171069949865341, + 0.11624108999967575, 0.07952452450990677, 0.07676685601472855, + -0.09268729388713837, -0.09515844285488129, 0.08966265618801117, + 0.12256971001625061, 0.09974833577871323, -0.0020852594170719385, + 0.07005017250776291, + ]), + _random_tensor('4.weight', [50, 50], seed=138), + _tensor('6.bias', FLOAT, [50], [ + -0.038818925619125366, 0.06811299920082092, 0.1118309274315834, + 0.07874610275030136, 0.05133644491434097, 0.01601332612335682, + -0.08843040466308594, -0.018260041251778603, 0.021909251809120178, + 0.03044956363737583, 0.09717729687690735, 0.14612819254398346, + 0.033583976328372955, 0.07662538439035416, 0.07066786289215088, 0.1253795325756073, + 0.006381378974765539, 0.02676522172987461, 0.11174061894416809, + -0.015764767304062843, -0.11681172251701355, -0.050747837871313095, + 0.0873001366853714, 0.019174877554178238, -0.12318209558725357, + -0.011137604713439941, -0.10481218248605728, 0.01928110420703888, + 0.16160382330417633, 0.13084180653095245, 0.05665783956646919, + -0.12876908481121063, -0.02381623350083828, 0.05391921475529671, + 0.12290484458208084, 0.14049169421195984, 0.06409084051847458, + -0.09369882196187973, 0.10229893773794174, 0.026894323527812958, + 0.09336742758750916, 0.10093056410551071, -0.0749121680855751, 0.080393485724926, + -0.07547304034233093, 0.10684267431497574, 0.04369564354419708, + -0.07769715040922165, -0.07865709811449051, -0.02007412724196911, + ]), + _random_tensor('6.weight', [50, 50], seed=139), + _tensor('8.bias', FLOAT, [50], [ + 0.03757968917489052, 0.044984981417655945, -0.10111311078071594, + 0.058455660939216614, 0.01773645728826523, -0.07982795685529709, + 0.0912586972117424, -0.09884101152420044, -0.039294760674238205, + 0.04224107041954994, 0.06647494435310364, -0.10234533250331879, + -0.019759902730584145, -0.07916851341724396, 0.11428356915712357, + 0.007246797904372215, 0.08650056272745132, -0.11538772284984589, + -0.03382350504398346, 0.04845535755157471, -0.011813861317932606, + -0.06618679314851761, 0.03560318797826767, -0.060869812965393066, + -0.1252366602420807, 0.10331248492002487, -0.12572361528873444, + 0.14386624097824097, 0.10191508382558823, 0.14575746655464172, + -0.07625168561935425, 0.13770657777786255, 0.05900927633047104, + -0.0907086580991745, 0.02626039646565914, 0.12620759010314941, 0.03937942162156105, + 0.12115412205457687, 0.10908836126327515, -0.13738510012626648, + -0.10638768970966339, -0.03824464604258537, -0.11428388208150864, + 0.023384658619761467, -0.07685241103172302, 0.025741903111338615, + -0.07088501751422882, 0.07981190085411072, 0.10838404297828674, 0.05189177393913269, + ]), + _random_tensor('8.weight', [50, 50], seed=140), + ], + ) + return _model(graph, opset=9, ir_version=6, producer_name='pytorch', producer_version='1.5') + + +def make_Log(): + """Ops: Log""" + nodes = [ + helper.make_node('Log', ['onnx::Log_0'], ['1'], name='/Log'), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::Log_0', FLOAT, [4]), + ], + outputs=[ + _vi('1', FLOAT, [4]), + ], + ) + return _model(graph, opset=14, ir_version=7, producer_name='pytorch', producer_version='1.13.1') + + +def make_MatMul_Stacked(): + """Ops: MatMul""" + nodes = [ + helper.make_node('MatMul', ['input1', 'input2'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'AddGraph', + inputs=[ + _vi('input1', FLOAT, ['N', 2, 2]), + _vi('input2', FLOAT, [2, 1]), + ], + outputs=[ + _vi('output', FLOAT, ['N', 2, 1]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_MatMul_Stacked2(): + """Ops: MatMul""" + nodes = [ + helper.make_node('MatMul', ['input1', 'input2'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'AddGraph', + inputs=[ + _vi('input1', FLOAT, ['N', 2, 2]), + _vi('input2', FLOAT, ['N', 2, 1]), + ], + outputs=[ + _vi('output', FLOAT, ['N', 2, 1]), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_Max(): + """Ops: Max""" + nodes = [ + helper.make_node('Max', ['X1', 'X2'], ['Y'], name='Max'), + ] + graph = helper.make_graph( + nodes, + 'test-model', + inputs=[ + _vi('X1', FLOAT, [1, 3]), + _vi('X2', FLOAT, [1, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 3]), + ], + ) + return _model(graph, opset=13, ir_version=8, producer_name='onnx-example') + + +def make_MaxMultidirectionalBroadcast(): + """Ops: Max""" + nodes = [ + helper.make_node('Max', ['A', 'B', 'C'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Max', + inputs=[ + _vi('A', FLOAT, [3, 1]), + _vi('B', FLOAT, [2, 3, 1]), + _vi('C', FLOAT, [1, 4]), + ], + outputs=[ + _vi('Y', FLOAT, []), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_MaxPool1d(): + """Ops: MaxPool""" + nodes = [ + helper.make_node( + 'MaxPool', + ['onnx::MaxPool_0'], + ['1'], + name='MaxPool_0', + kernel_shape=[3], + pads=[0, 0], + strides=[1], + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::MaxPool_0', FLOAT, [1, 6, 10]), + ], + outputs=[ + _vi('1', FLOAT, [1, 6, 8]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_MaxPool2d(): + """Ops: MaxPool""" + nodes = [ + helper.make_node( + 'MaxPool', + ['onnx::MaxPool_0'], + ['1'], + name='MaxPool_0', + kernel_shape=[3, 2], + pads=[0, 0, 0, 0], + strides=[1, 1], + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::MaxPool_0', FLOAT, [1, 1, 5, 10]), + ], + outputs=[ + _vi('1', FLOAT, [1, 1, 3, 9]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_MaxPool2d_AsymPad(): + """Ops: MaxPool""" + nodes = [ + helper.make_node( + 'MaxPool', + ['X'], + ['Y'], + kernel_shape=[2, 2], + pads=[0, 1, 0, 1], + strides=[1, 1], + ), + ] + graph = helper.make_graph( + nodes, + 'MaxPool2d_AsymPad', + inputs=[ + _vi('X', FLOAT, [1, 1, 4, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 1, 3, 5]), + ], + ) + return _model(graph, opset=13, ir_version=13) + + +def make_MaxPool2d_CeilMode(): + """Ops: MaxPool""" + nodes = [ + helper.make_node( + 'MaxPool', + ['X'], + ['Y'], + ceil_mode=1, + kernel_shape=[2, 2], + strides=[2, 2], + ), + ] + graph = helper.make_graph( + nodes, + 'maxpool_ceil', + inputs=[ + _vi('X', FLOAT, [1, 1, 5, 5]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 1, 3, 3]), + ], + ) + return _model(graph, opset=11, ir_version=6) + + +def make_MaxPool3d(): + """Ops: MaxPool""" + nodes = [ + helper.make_node( + 'MaxPool', + ['onnx::MaxPool_0'], + ['1'], + name='MaxPool_0', + kernel_shape=[3, 2, 2], + pads=[0, 0, 0, 0, 0, 0], + strides=[1, 1, 1], + ), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::MaxPool_0', FLOAT, [1, 1, 3, 3, 3]), + ], + outputs=[ + _vi('1', FLOAT, [1, 1, 1, 2, 2]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_MeanMultidirectionalBroadcast(): + """Ops: Mean""" + nodes = [ + helper.make_node('Mean', ['A', 'B', 'C'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Mean', + inputs=[ + _vi('A', FLOAT, [3, 1]), + _vi('B', FLOAT, [2, 3, 1]), + _vi('C', FLOAT, [1, 4]), + ], + outputs=[ + _vi('Y', FLOAT, []), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_MinMultidirectionalBroadcast(): + """Ops: Min""" + nodes = [ + helper.make_node('Min', ['A', 'B', 'C'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Min', + inputs=[ + _vi('A', FLOAT, [3, 1]), + _vi('B', FLOAT, [2, 3, 1]), + _vi('C', FLOAT, [1, 4]), + ], + outputs=[ + _vi('Y', FLOAT, []), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Mod_ConstantFolding(): + """Ops: Constant, Mod""" + nodes = [ + helper.make_node('Constant', [], ['X'], value=_tensor('X', INT64, [3], [10, 7, 5])), + helper.make_node('Constant', [], ['D'], value=_tensor('D', INT64, [3], [3, 3, 3])), + helper.make_node('Mod', ['X', 'D'], ['Y'], fmod=0), + ] + graph = helper.make_graph( + nodes, + 'Mod_ConstantFolding', + inputs=[ + ], + outputs=[ + _vi('Y', INT64, [3]), + ], + ) + return _model(graph, opset=13, ir_version=13) + + +def make_Mul(): + """Ops: Mul""" + nodes = [ + helper.make_node('Mul', ['onnx::Mul_0', 'onnx::Mul_1'], ['2'], name='Mul_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Mul_0', FLOAT, [2]), + _vi('onnx::Mul_1', FLOAT, [2]), + ], + outputs=[ + _vi('2', FLOAT, [2]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_Neg(): + """Ops: Neg""" + nodes = [ + helper.make_node('Neg', ['onnx::Neg_0'], ['1'], name='Neg_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Neg_0', FLOAT, [12]), + ], + outputs=[ + _vi('1', FLOAT, [12]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_NonZero(): + """Ops: NonZero""" + nodes = [ + helper.make_node('NonZero', ['data'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', UINT8, [2, 2, 3]), + ], + outputs=[ + _vi('output', INT64, [3, 'N']), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_NonZero_Constant(): + """Ops: Constant, NonZero""" + nodes = [ + helper.make_node( + 'Constant', + [], + ['constant_data'], + value=_tensor('const_tensor', BOOL, [2, 2, 3], [False, True, False, True, True, False, False, False, True, False, True, True]), + ), + helper.make_node('NonZero', ['constant_data'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + ], + outputs=[ + _vi('output', INT64, [3, 6]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_NotIsNaN(): + """Ops: IsNaN, Not""" + nodes = [ + helper.make_node('IsNaN', ['input'], ['temp_result']), + helper.make_node('Not', ['temp_result'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'Test', + inputs=[ + _vi('input', FLOAT, [1, 'N']), + ], + outputs=[ + _vi('output', BOOL, [1, 'N']), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_Pad(): + """Ops: Constant, Pad""" + nodes = [ + helper.make_node( + 'Constant', + [], + ['pad_values'], + value=_tensor('const_tensor', INT64, [6], [1, 0, 1, 0, 1, 2]), + ), + helper.make_node('Pad', ['input', 'pad_values'], ['output'], mode='constant'), + ] + graph = helper.make_graph( + nodes, + 'PadGraph', + inputs=[ + _vi('input', FLOAT, [1, 2, 2]), + ], + outputs=[ + _vi('output', FLOAT, [2, 3, 5]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Pow(): + """Ops: Pow""" + nodes = [ + helper.make_node('Pow', ['onnx::Pow_0', 'onnx::Pow_1'], ['2'], name='Pow_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Pow_0', FLOAT, [3]), + _vi('onnx::Pow_1', FLOAT, [3]), + ], + outputs=[ + _vi('2', FLOAT, [3]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_Pow_broadcast(): + """Ops: Pow""" + nodes = [ + helper.make_node('Pow', ['onnx::Pow_0', 'onnx::Pow_1'], ['2'], name='Pow_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Pow_0', FLOAT, [1, 2, 3]), + _vi('onnx::Pow_1', FLOAT, [2, 3]), + ], + outputs=[ + _vi('2', FLOAT, [1, 2, 3]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_RNNBatchwise(): + """Ops: RNN""" + nodes = [ + helper.make_node( + 'RNN', + ['X', 'W', 'R'], + ['Y', 'Y_h'], + activations=['Tanh'], + clip=0.0, + direction='forward', + hidden_size=4, + layout=1, + ), + ] + graph = helper.make_graph( + nodes, + 'RNNBatchwise', + inputs=[ + _vi('X', FLOAT, [3, 1, 2]), + _vi('W', FLOAT, [1, 4, 2]), + _vi('R', FLOAT, [1, 4, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 1, 1, 4]), + _vi('Y_h', FLOAT, [3, 1, 4]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 4, 2], [ + 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, + 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, + ]), + _tensor('R', FLOAT, [1, 4, 4], [ + 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, + 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, + 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, + 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, 0.05000000074505806, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_RNNBidirectional(): + """Ops: RNN""" + nodes = [ + helper.make_node( + 'RNN', + ['X', 'W', 'R', 'B', 'sequence_lens', 'initial_h'], + ['Y', 'Y_h'], + activations=['Tanh', 'Tanh'], + clip=0.0, + direction='bidirectional', + hidden_size=4, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'RNNBidirectional', + inputs=[ + _vi('X', FLOAT, [3, 3, 2]), + _vi('W', FLOAT, [2, 4, 2]), + _vi('R', FLOAT, [2, 4, 4]), + _vi('B', FLOAT, [2, 8]), + _vi('sequence_lens', FLOAT, [3]), + _vi('initial_h', FLOAT, [2, 3, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 2, 3, 4]), + _vi('Y_h', FLOAT, [2, 3, 4]), + ], + initializer=[ + _tensor('W', FLOAT, [2, 4, 2], [ + 1.1630799770355225, 2.212209939956665, 0.48380500078201294, 0.7740039825439453, + 0.2995629906654358, 1.0434399843215942, 0.15302500128746033, 1.1839300394058228, + -1.1688100099563599, 1.8917100429534912, 1.5580699443817139, -1.2347400188446045, + -0.5459449887275696, -1.7710299491882324, -2.3556299209594727, -0.4513840079307556, + ]), + _tensor('R', FLOAT, [2, 4, 4], [ + -0.264847993850708, -1.3031100034713745, 0.07120870053768158, 0.641979992389679, + -2.7653799057006836, -0.6520739793777466, -0.7842749953269958, -1.767490029335022, + -0.45067301392555237, -0.9179289937019348, -0.9666540026664734, 0.6508560180664062, + 0.285537987947464, -0.9098479747772217, -1.9045900106430054, -0.14092600345611572, + -1.3713099956512451, 0.7806439995765686, 0.4410090148448944, 1.158560037612915, + 0.31329798698425293, 1.9676599502563477, -1.1199100017547607, + -0.004409589804708958, 0.40762200951576233, 2.6056900024414062, + -0.8409860134124756, 0.5856580138206482, 0.8232920169830322, -0.6968179941177368, + 1.1511499881744385, 0.15026900172233582, + ]), + _tensor('B', FLOAT, [2, 8], [ + -0.16102899610996246, -2.5899100303649902, 0.3397209942340851, -0.3166399896144867, + 0.049052998423576355, -1.8979500532150269, -0.32712098956108093, + -0.1596280038356781, -0.18305400013923645, -0.9774590134620667, + -1.0830899477005005, -0.01658809930086136, 1.9934899806976318, 1.3551299571990967, + -0.6979780197143555, -0.7086179852485657, + ]), + _tensor('sequence_lens', FLOAT, [3], [3.0, 3.0, 3.0]), + _tensor('initial_h', FLOAT, [2, 3, 4], [ + -0.37107500433921814, 0.2525329887866974, -1.4219499826431274, 0.39302998781204224, + -0.4631119966506958, -1.0243799686431885, -0.5383989810943604, -2.2150800228118896, + -1.4220999479293823, -0.14936499297618866, 1.2587000131607056, 1.3829400539398193, + -0.0841611996293068, 1.456969976425171, 0.06793870031833649, 2.1154799461364746, + -1.510509967803955, 1.5094799995422363, 0.20635099709033966, -0.9814450144767761, + -0.22147700190544128, -0.2304839938879013, 0.4533129930496216, 0.7954760193824768, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_RNNBidirectionalBatchwise(): + """Ops: RNN""" + nodes = [ + helper.make_node( + 'RNN', + ['X', 'W', 'R', 'B', 'sequence_lens', 'initial_h'], + ['Y', 'Y_h'], + activations=['Tanh', 'Tanh'], + clip=0.0, + direction='bidirectional', + hidden_size=4, + layout=1, + ), + ] + graph = helper.make_graph( + nodes, + 'RNNBidirectionalBatchwise', + inputs=[ + _vi('X', FLOAT, [3, 3, 2]), + _vi('W', FLOAT, [2, 4, 2]), + _vi('R', FLOAT, [2, 4, 4]), + _vi('B', FLOAT, [2, 8]), + _vi('sequence_lens', FLOAT, [3]), + _vi('initial_h', FLOAT, [3, 2, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 3, 2, 4]), + _vi('Y_h', FLOAT, [3, 2, 4]), + ], + initializer=[ + _tensor('W', FLOAT, [2, 4, 2], [ + 1.1630799770355225, 2.212209939956665, 0.48380500078201294, 0.7740039825439453, + 0.2995629906654358, 1.0434399843215942, 0.15302500128746033, 1.1839300394058228, + -1.1688100099563599, 1.8917100429534912, 1.5580699443817139, -1.2347400188446045, + -0.5459449887275696, -1.7710299491882324, -2.3556299209594727, -0.4513840079307556, + ]), + _tensor('R', FLOAT, [2, 4, 4], [ + -0.264847993850708, -1.3031100034713745, 0.07120870053768158, 0.641979992389679, + -2.7653799057006836, -0.6520739793777466, -0.7842749953269958, -1.767490029335022, + -0.45067301392555237, -0.9179289937019348, -0.9666540026664734, 0.6508560180664062, + 0.285537987947464, -0.9098479747772217, -1.9045900106430054, -0.14092600345611572, + -1.3713099956512451, 0.7806439995765686, 0.4410090148448944, 1.158560037612915, + 0.31329798698425293, 1.9676599502563477, -1.1199100017547607, + -0.004409589804708958, 0.40762200951576233, 2.6056900024414062, + -0.8409860134124756, 0.5856580138206482, 0.8232920169830322, -0.6968179941177368, + 1.1511499881744385, 0.15026900172233582, + ]), + _tensor('B', FLOAT, [2, 8], [ + -0.16102899610996246, -2.5899100303649902, 0.3397209942340851, -0.3166399896144867, + 0.049052998423576355, -1.8979500532150269, -0.32712098956108093, + -0.1596280038356781, -0.18305400013923645, -0.9774590134620667, + -1.0830899477005005, -0.01658809930086136, 1.9934899806976318, 1.3551299571990967, + -0.6979780197143555, -0.7086179852485657, + ]), + _tensor('sequence_lens', FLOAT, [3], [3.0, 3.0, 3.0]), + _tensor('initial_h', FLOAT, [2, 3, 4], [ + -0.37107500433921814, 0.2525329887866974, -1.4219499826431274, 0.39302998781204224, + -0.0841611996293068, 1.456969976425171, 0.06793870031833649, 2.1154799461364746, + -0.4631119966506958, -1.0243799686431885, -0.5383989810943604, -2.2150800228118896, + -1.510509967803955, 1.5094799995422363, 0.20635099709033966, -0.9814450144767761, + -1.4220999479293823, -0.14936499297618866, 1.2587000131607056, 1.3829400539398193, + -0.22147700190544128, -0.2304839938879013, 0.4533129930496216, 0.7954760193824768, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_RNNDefaults(): + """Ops: RNN""" + nodes = [ + helper.make_node( + 'RNN', + ['X', 'W', 'R', 'B'], + ['Y', 'Y_h'], + activations=['Tanh'], + clip=0.0, + direction='forward', + hidden_size=5, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'RNNDefaults', + inputs=[ + _vi('X', FLOAT, [3, 1, 3]), + _vi('W', FLOAT, [1, 5, 3]), + _vi('R', FLOAT, [1, 5, 5]), + _vi('B', FLOAT, [1, 10]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 1, 1, 5]), + _vi('Y_h', FLOAT, [1, 1, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 5, 3], [ + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + ]), + _tensor('R', FLOAT, [1, 5, 5], [ + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, + ]), + _tensor('B', FLOAT, [1, 10], [ + 0.009999999776482582, 0.009999999776482582, 0.009999999776482582, + 0.009999999776482582, 0.009999999776482582, 0.0, 0.0, 0.0, 0.0, 0.0, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_RNNSeqLength(): + """Ops: RNN""" + nodes = [ + helper.make_node( + 'RNN', + ['X', 'W', 'R', 'B'], + ['Y', 'Y_h'], + activations=['Tanh'], + clip=0.0, + direction='forward', + hidden_size=5, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'RNNSeqLength', + inputs=[ + _vi('X', FLOAT, [2, 3, 3]), + _vi('W', FLOAT, [1, 5, 3]), + _vi('R', FLOAT, [1, 5, 5]), + _vi('B', FLOAT, [1, 10]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 1, 3, 5]), + _vi('Y_h', FLOAT, [1, 3, 5]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 5, 3], [ + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + ]), + _tensor('R', FLOAT, [1, 5, 5], [ + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, 0.019999999552965164, 0.019999999552965164, + 0.019999999552965164, + ]), + _tensor('B', FLOAT, [1, 10], [ + 0.03099999949336052, 0.03099999949336052, 0.03099999949336052, 0.03099999949336052, + 0.03099999949336052, 0.020999999716877937, 0.020999999716877937, + 0.020999999716877937, 0.020999999716877937, 0.020999999716877937, + ]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_RNNSequence(): + """Ops: RNN""" + nodes = [ + helper.make_node( + 'RNN', + ['X', 'W', 'R', 'B', 'sequence_lens'], + ['Y', 'Y_h'], + activations=['Tanh'], + clip=0.0, + direction='forward', + hidden_size=6, + layout=0, + ), + ] + graph = helper.make_graph( + nodes, + 'RNNSequence', + inputs=[ + _vi('X', FLOAT, [3, 3, 5]), + _vi('W', FLOAT, [1, 6, 5]), + _vi('R', FLOAT, [1, 6, 6]), + _vi('B', FLOAT, [1, 12]), + _vi('sequence_lens', FLOAT, [3]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 1, 3, 6]), + _vi('Y_h', FLOAT, [1, 3, 6]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 6, 5], [ + 0.23690000176429749, 0.13459999859333038, 0.33169999718666077, -0.4821999967098236, + -0.1362999975681305, 0.9419999718666077, -0.45019999146461487, -2.8173999786376953, + 0.2888999879360199, 1.6714999675750732, 0.29670000076293945, 1.679900050163269, + -0.8342999815940857, 0.44929999113082886, 0.03700000047683716, -0.5325999855995178, + 1.1545000076293945, -1.6477999687194824, 0.777899980545044, -0.9257000088691711, + -1.482200026512146, -0.8716999888420105, -0.017400000244379044, 2.06850004196167, + -0.7620000243186951, 0.010499999858438969, -2.9377999305725098, 0.888700008392334, + -0.9477999806404114, -1.5724999904632568, + ]), + _tensor('R', FLOAT, [1, 6, 6], [ + 1.0134999752044678, -0.2632000148296356, -0.678600013256073, -1.017899990081787, + -2.1319000720977783, -0.003599999938160181, 1.9585000276565552, 1.1375000476837158, + 2.121000051498413, 0.6409000158309937, -2.050299882888794, -2.4921000003814697, + 0.5932000279426575, 1.5161000490188599, -0.7768999934196472, 0.2849000096321106, + 0.20720000565052032, -0.3086000084877014, -0.965499997138977, 0.9178000092506409, + -0.4291999936103821, -1.5053999423980713, -0.7396000027656555, 0.8928999900817871, + -0.18359999358654022, -1.6291999816894531, 1.0712000131607056, 0.37700000405311584, + 0.17790000140666962, -1.1167000532150269, -0.6861000061035156, 1.2390999794006348, + -0.5447999835014343, -0.3880999982357025, -0.5164999961853027, 0.012799999676644802, + ]), + _tensor('B', FLOAT, [1, 12], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), + _tensor('sequence_lens', FLOAT, [3], [3.0, 2.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_RNNSequenceBatchwise(): + """Ops: RNN""" + nodes = [ + helper.make_node( + 'RNN', + ['X', 'W', 'R', 'B', 'sequence_lens'], + ['Y', 'Y_h'], + activations=['Tanh'], + clip=0.0, + direction='forward', + hidden_size=6, + layout=1, + ), + ] + graph = helper.make_graph( + nodes, + 'RNNSequenceBatchwise', + inputs=[ + _vi('X', FLOAT, [3, 3, 5]), + _vi('W', FLOAT, [1, 6, 5]), + _vi('R', FLOAT, [1, 6, 6]), + _vi('B', FLOAT, [1, 12]), + _vi('sequence_lens', FLOAT, [3]), + ], + outputs=[ + _vi('Y', FLOAT, [3, 3, 1, 6]), + _vi('Y_h', FLOAT, [3, 1, 6]), + ], + initializer=[ + _tensor('W', FLOAT, [1, 6, 5], [ + 0.23690000176429749, 0.13459999859333038, 0.33169999718666077, -0.4821999967098236, + -0.1362999975681305, 0.9419999718666077, -0.45019999146461487, -2.8173999786376953, + 0.2888999879360199, 1.6714999675750732, 0.29670000076293945, 1.679900050163269, + -0.8342999815940857, 0.44929999113082886, 0.03700000047683716, -0.5325999855995178, + 1.1545000076293945, -1.6477999687194824, 0.777899980545044, -0.9257000088691711, + -1.482200026512146, -0.8716999888420105, -0.017400000244379044, 2.06850004196167, + -0.7620000243186951, 0.010499999858438969, -2.9377999305725098, 0.888700008392334, + -0.9477999806404114, -1.5724999904632568, + ]), + _tensor('R', FLOAT, [1, 6, 6], [ + 1.0134999752044678, -0.2632000148296356, -0.678600013256073, -1.017899990081787, + -2.1319000720977783, -0.003599999938160181, 1.9585000276565552, 1.1375000476837158, + 2.121000051498413, 0.6409000158309937, -2.050299882888794, -2.4921000003814697, + 0.5932000279426575, 1.5161000490188599, -0.7768999934196472, 0.2849000096321106, + 0.20720000565052032, -0.3086000084877014, -0.965499997138977, 0.9178000092506409, + -0.4291999936103821, -1.5053999423980713, -0.7396000027656555, 0.8928999900817871, + -0.18359999358654022, -1.6291999816894531, 1.0712000131607056, 0.37700000405311584, + 0.17790000140666962, -1.1167000532150269, -0.6861000061035156, 1.2390999794006348, + -0.5447999835014343, -0.3880999982357025, -0.5164999961853027, 0.012799999676644802, + ]), + _tensor('B', FLOAT, [1, 12], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), + _tensor('sequence_lens', FLOAT, [3], [3.0, 2.0, 1.0]), + ], + ) + return _model(graph, opset=14, ir_version=7) + + +def make_RandomNormal(): + """Ops: RandomNormal""" + nodes = [ + helper.make_node( + 'RandomNormal', + [], + ['output'], + mean=1.0, + scale=3.0, + seed=111, + shape=[2, 3], + ), + ] + graph = helper.make_graph( + nodes, + 'RandomNormal', + inputs=[ + ], + outputs=[ + _vi('output', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_RandomUniform(): + """Ops: RandomUniform""" + nodes = [ + helper.make_node( + 'RandomUniform', + [], + ['output'], + high=20.0, + low=10.0, + seed=111, + shape=[2, 3], + ), + ] + graph = helper.make_graph( + nodes, + 'RandomUniform', + inputs=[ + ], + outputs=[ + _vi('output', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_RangeFloat(): + """Ops: Range""" + nodes = [ + helper.make_node('Range', ['start', 'limit', 'delta'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Range', + inputs=[ + _vi('start', FLOAT, [1]), + _vi('limit', FLOAT, [1]), + _vi('delta', FLOAT, [1]), + ], + outputs=[ + _vi('Y', FLOAT, ['output_size']), + ], + ) + return _model(graph, opset=19, ir_version=9) + + +def make_RangeInt(): + """Ops: Range""" + nodes = [ + helper.make_node('Range', ['start', 'limit', 'delta'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Range', + inputs=[ + _vi('start', INT64, [1]), + _vi('limit', INT64, [1]), + _vi('delta', INT64, [1]), + ], + outputs=[ + _vi('Y', INT64, ['output_size']), + ], + ) + return _model(graph, opset=19, ir_version=9) + + +def make_Reciprocal(): + """Ops: Reciprocal""" + nodes = [ + helper.make_node('Reciprocal', ['X'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Reciprocal', + inputs=[ + _vi('X', FLOAT, [2, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_ReduceMean(): + """Ops: ReduceMean""" + nodes = [ + helper.make_node( + 'ReduceMean', + ['onnx::ReduceMean_0'], + ['1'], + name='ReduceMean_0', + axes=[1], + keepdims=0, + ), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::ReduceMean_0', FLOAT, [1, 2, 3]), + ], + outputs=[ + _vi('1', FLOAT, [1, 3]), + ], + ) + return _model(graph, opset=13, ir_version=7, producer_name='pytorch', producer_version='1.12.1') + + +def make_ReduceMean_kFirst(): + """Ops: ReduceMean""" + nodes = [ + helper.make_node('ReduceMean', ['X'], ['Y'], axes=[0], keepdims=0), + ] + graph = helper.make_graph( + nodes, + 'ReduceMean_kFirst', + inputs=[ + _vi('X', FLOAT, [3, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [4]), + ], + ) + return _model(graph, opset=13, ir_version=13) + + +def make_ReduceProd(): + """Ops: ReduceProd""" + nodes = [ + helper.make_node( + 'ReduceProd', + ['onnx::ReduceProd_0'], + ['1'], + name='ReduceProd_0', + axes=[1], + keepdims=0, + ), + ] + graph = helper.make_graph( + nodes, + 'torch_jit', + inputs=[ + _vi('onnx::ReduceProd_0', FLOAT, [1, 2, 3]), + ], + outputs=[ + _vi('1', FLOAT, [1, 3]), + ], + ) + return _model(graph, opset=13, ir_version=7, producer_name='pytorch', producer_version='1.12.1') + + +def make_ReduceSum(): + """Ops: ReduceSum""" + nodes = [ + helper.make_node('ReduceSum', ['input'], ['output'], axes=[0, 1, 2], keepdims=1), + ] + graph = helper.make_graph( + nodes, + 'ReduceSumGraph', + inputs=[ + _vi('input', FLOAT, [1, 2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [1, 1, 1]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_ReduceSumSquare(): + """Ops: ReduceSumSquare""" + nodes = [ + helper.make_node('ReduceSumSquare', ['input'], ['output'], axes=[2], keepdims=0), + ] + graph = helper.make_graph( + nodes, + 'ReduceSumSquareGraph', + inputs=[ + _vi('input', FLOAT, [1, 2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [1, 2]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_ScatterElements(): + """Ops: ScatterElements""" + nodes = [ + helper.make_node('ScatterElements', ['data', 'indices', 'updates'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', FLOAT, [3, 3]), + _vi('indices', INT64, [2, 3]), + _vi('updates', FLOAT, [2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [3, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_ScatterND_1(): + """Ops: ScatterND""" + nodes = [ + helper.make_node('ScatterND', ['data', 'indices', 'updates'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', FLOAT, [5]), + _vi('indices', INT64, [3, 1]), + _vi('updates', FLOAT, [3]), + ], + outputs=[ + _vi('output', FLOAT, [5]), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_ScatterND_2(): + """Ops: ScatterND""" + nodes = [ + helper.make_node('ScatterND', ['data', 'indices', 'updates'], ['output'], reduction='add'), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', FLOAT, [3, 2]), + _vi('indices', INT64, [2, 1]), + _vi('updates', FLOAT, [2, 2]), + ], + outputs=[ + _vi('output', FLOAT, [3, 2]), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_ScatterND_3(): + """Ops: ScatterND""" + nodes = [ + helper.make_node('ScatterND', ['data', 'indices', 'updates'], ['output'], reduction='mul'), + ] + graph = helper.make_graph( + nodes, + 'TestGraph', + inputs=[ + _vi('data', FLOAT, [2, 2]), + _vi('indices', INT64, [2, 2]), + _vi('updates', FLOAT, [2]), + ], + outputs=[ + _vi('output', FLOAT, [2, 2]), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_Shape(): + """Ops: Shape, ConstantOfShape, Mul""" + nodes = [ + helper.make_node('Shape', ['input'], ['out_shape']), + helper.make_node( + 'ConstantOfShape', + ['out_shape'], + ['scale_values'], + value=_tensor('value', FLOAT, [1], [2.0]), + ), + helper.make_node('Mul', ['input', 'scale_values'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'ShapeGraph', + inputs=[ + _vi('input', FLOAT, [1, 2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [1, 2, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Sin(): + """Ops: Sin""" + nodes = [ + helper.make_node('Sin', ['input'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'sin_test', + inputs=[ + _vi('input', FLOAT, [3, 4]), + ], + outputs=[ + _vi('output', FLOAT, [3, 4]), + ], + ) + return _model(graph, opset=7, ir_version=10, producer_name='onnx-example') + + +def make_Slice(): + """Ops: Slice""" + nodes = [ + helper.make_node('Slice', ['x', 'starts', 'ends', 'axes', 'steps'], ['y']), + ] + graph = helper.make_graph( + nodes, + 'Slice', + inputs=[ + _vi('x', FLOAT, [20, 10, 5]), + ], + outputs=[ + _vi('y', FLOAT, [3, 10, 5]), + ], + initializer=[ + _tensor('starts', INT64, [2], [0, 0]), + _tensor('ends', INT64, [2], [3, 10]), + _tensor('axes', INT64, [2], [0, 1]), + _tensor('steps', INT64, [2], [1, 1]), + ], + ) + return _model(graph, opset=19, ir_version=9, producer_name='Slice') + + +def make_Slice_Default_Axis(): + """Ops: Slice""" + nodes = [ + helper.make_node('Slice', ['x', 'starts', 'ends'], ['y']), + ] + graph = helper.make_graph( + nodes, + 'Slice', + inputs=[ + _vi('x', FLOAT, [20, 10, 5]), + ], + outputs=[ + _vi('y', FLOAT, [20, 10, 1]), + ], + initializer=[ + _tensor('starts', INT64, [3], [0, 0, 3]), + _tensor('ends', INT64, [3], [20, 10, 4]), + ], + ) + return _model(graph, opset=19, ir_version=9, producer_name='Slice_Default_Axis') + + +def make_Slice_Default_Steps(): + """Ops: Slice""" + nodes = [ + helper.make_node('Slice', ['x', 'starts', 'ends', 'axes'], ['y']), + ] + graph = helper.make_graph( + nodes, + 'Slice', + inputs=[ + _vi('x', FLOAT, [20, 10, 5]), + ], + outputs=[ + _vi('y', FLOAT, [20, 10, 1]), + ], + initializer=[ + _tensor('starts', INT64, [3], [0, 0, 3]), + _tensor('ends', INT64, [3], [20, 10, 4]), + _tensor('axes', INT64, [3], [0, 1, 2]), + ], + ) + return _model(graph, opset=19, ir_version=9, producer_name='Slice_Default_Steps') + + +def make_Slice_Neg(): + """Ops: Slice""" + nodes = [ + helper.make_node('Slice', ['x', 'starts', 'ends', 'axes', 'steps'], ['y']), + ] + graph = helper.make_graph( + nodes, + 'Slice', + inputs=[ + _vi('x', FLOAT, [20, 10, 5]), + ], + outputs=[ + _vi('y', FLOAT, [20, 9, 5]), + ], + initializer=[ + _tensor('starts', INT64, [1], [0]), + _tensor('ends', INT64, [1], [-1]), + _tensor('axes', INT64, [1], [1]), + _tensor('steps', INT64, [1], [1]), + ], + ) + return _model(graph, opset=19, ir_version=9, producer_name='Slice_Neg') + + +def make_Softmax1d(): + """Ops: Softmax""" + nodes = [ + helper.make_node('Softmax', ['X'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Softmax', + inputs=[ + _vi('X', FLOAT, [3]), + ], + outputs=[ + _vi('Y', FLOAT, [3]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Softmax2d(): + """Ops: Softmax""" + nodes = [ + helper.make_node('Softmax', ['X'], ['Y'], axis=1), + ] + graph = helper.make_graph( + nodes, + 'Softmax', + inputs=[ + _vi('X', FLOAT, [1, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [1, 3]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Softmax3d(): + """Ops: Softmax""" + nodes = [ + helper.make_node('Softmax', ['X'], ['Y'], axis=1), + ] + graph = helper.make_graph( + nodes, + 'Softmax', + inputs=[ + _vi('X', FLOAT, [2, 3, 4]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3, 4]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Softmax4d(): + """Ops: Softmax""" + nodes = [ + helper.make_node('Softmax', ['X'], ['Y'], axis=-2), + ] + graph = helper.make_graph( + nodes, + 'Softmax', + inputs=[ + _vi('X', FLOAT, [2, 3, 4, 2]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3, 4, 2]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Softplus(): + """Ops: Softplus""" + nodes = [ + helper.make_node('Softplus', ['input'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'Abs', + inputs=[ + _vi('input', FLOAT, [2, 3]), + ], + outputs=[ + _vi('output', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=25, ir_version=13, producer_name='onnx-example') + + +def make_Split_0(): + """Ops: Constant, Split""" + nodes = [ + helper.make_node( + 'Constant', + [], + ['split_values'], + value=_tensor('split', INT64, [2], [1, 1]), + ), + helper.make_node('Split', ['input', 'split_values'], ['output1', 'output2']), + ] + graph = helper.make_graph( + nodes, + 'SplitGraph', + inputs=[ + _vi('input', FLOAT, [2, 2, 3]), + ], + outputs=[ + _vi('output1', FLOAT, [1, 2, 3]), + _vi('output2', FLOAT, [1, 2, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Split_1(): + """Ops: Constant, Split""" + nodes = [ + helper.make_node( + 'Constant', + [], + ['split_values'], + value=_tensor('split', INT64, [2], [1, 1]), + ), + helper.make_node('Split', ['input', 'split_values'], ['output1', 'output2'], axis=1), + ] + graph = helper.make_graph( + nodes, + 'SplitGraph', + inputs=[ + _vi('input', FLOAT, [2, 2, 3]), + ], + outputs=[ + _vi('output1', FLOAT, [2, 1, 3]), + _vi('output2', FLOAT, [2, 1, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Split_2(): + """Ops: Split""" + nodes = [ + helper.make_node('Split', ['input'], ['output1', 'output2'], axis=2, num_outputs=2), + ] + graph = helper.make_graph( + nodes, + 'SplitGraph', + inputs=[ + _vi('input', FLOAT, [2, 2, 3]), + ], + outputs=[ + _vi('output1', FLOAT, [2, 2, 2]), + _vi('output2', FLOAT, [2, 2, 1]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +def make_Sqrt(): + """Ops: Sqrt""" + nodes = [ + helper.make_node('Sqrt', ['X'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Sqrt', + inputs=[ + _vi('X', FLOAT, [2, 3]), + ], + outputs=[ + _vi('Y', FLOAT, [2, 3]), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Sub(): + """Ops: Sub""" + nodes = [ + helper.make_node('Sub', ['onnx::Sub_0', 'onnx::Sub_1'], ['2'], name='Sub_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Sub_0', FLOAT, [2]), + _vi('onnx::Sub_1', FLOAT, [2]), + ], + outputs=[ + _vi('2', FLOAT, [2]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_SumMultidirectionalBroadcast(): + """Ops: Sum""" + nodes = [ + helper.make_node('Sum', ['A', 'B', 'C'], ['Y']), + ] + graph = helper.make_graph( + nodes, + 'Sum', + inputs=[ + _vi('A', FLOAT, [3, 1]), + _vi('B', FLOAT, [2, 3, 1]), + _vi('C', FLOAT, [1, 4]), + ], + outputs=[ + _vi('Y', FLOAT, []), + ], + ) + return _model(graph, opset=17, ir_version=8) + + +def make_Swish(): + """Ops: Swish""" + nodes = [ + helper.make_node('Swish', ['input'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'Swish', + inputs=[ + _vi('input', FLOAT, [6]), + ], + outputs=[ + _vi('output', FLOAT, [6]), + ], + ) + return _model(graph, opset=24, ir_version=13) + + +def make_Tanh(): + """Ops: Tanh""" + nodes = [ + helper.make_node('Tanh', ['onnx::Tanh_0'], ['1'], name='Tanh_0'), + ] + graph = helper.make_graph( + nodes, + 'torch-jit-export', + inputs=[ + _vi('onnx::Tanh_0', FLOAT, [24]), + ], + outputs=[ + _vi('1', FLOAT, [24]), + ], + ) + return _model(graph, opset=9, ir_version=4, producer_name='pytorch', producer_version='1.11.0') + + +def make_Tile5D(): + """Ops: Tile""" + nodes = [ + helper.make_node('Tile', ['input', 'repeats'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'TileGraph', + inputs=[ + _vi('input', FLOAT, [2, 2, 2, 3, 3]), + ], + outputs=[ + _vi('output', FLOAT, [4, 2, 4, 3, 9]), + ], + initializer=[ + _tensor('repeats', INT64, [5], [2, 1, 2, 1, 3]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='tile-model') + + +def make_TopK(): + """Ops: Constant, TopK""" + nodes = [ + helper.make_node( + 'Constant', + [], + ['/Constant_output_0'], + name='/Constant', + value=_tensor('', INT64, [1], [5]), + ), + helper.make_node( + 'TopK', + ['onnx::TopK_0', '/Constant_output_0'], + ['4', '5'], + name='/TopK', + axis=-1, + largest=1, + sorted=1, + ), + ] + graph = helper.make_graph( + nodes, + 'main_graph', + inputs=[ + _vi('onnx::TopK_0', FLOAT, [9]), + ], + outputs=[ + _vi('4', FLOAT, [5]), + _vi('5', INT64, [5]), + ], + ) + return _model(graph, opset=17, ir_version=8, producer_name='pytorch', producer_version='2.3.0') + + +def make_Where(): + """Ops: Where""" + nodes = [ + helper.make_node('Where', ['cond', 'inputA', 'inputB'], ['output']), + ] + graph = helper.make_graph( + nodes, + 'PadGraph', + inputs=[ + _vi('inputA', FLOAT, [1, 2]), + _vi('inputB', FLOAT, [3, 2]), + _vi('cond', BOOL, [3, 1]), + ], + outputs=[ + _vi('output', FLOAT, [3, 2]), + ], + ) + return _model(graph, opset=21, ir_version=10, producer_name='onnx-example') + + +MODELS = { + 'Abs': make_Abs, + 'Add': make_Add, + 'AddBroadcast1': make_AddBroadcast1, + 'AddBroadcast2': make_AddBroadcast2, + 'AddBroadcast3': make_AddBroadcast3, + 'AddBroadcast4': make_AddBroadcast4, + 'AddBroadcast5': make_AddBroadcast5, + 'AddBroadcast6': make_AddBroadcast6, + 'AddBroadcast7': make_AddBroadcast7, + 'AvgPool': make_AvgPool, + 'Cast': make_Cast, + 'Clip': make_Clip, + 'Comparison_broadcast': make_Comparison_broadcast, + 'Comparison_broadcast_3d': make_Comparison_broadcast_3d, + 'ComplexTopK': make_ComplexTopK, + 'Concat_0D': make_Concat_0D, + 'Constant': make_Constant, + 'ConvAddRelu': make_ConvAddRelu, + 'ConvTranspose1d': make_ConvTranspose1d, + 'ConvTranspose2d': make_ConvTranspose2d, + 'ConvTransposeBias2d': make_ConvTransposeBias2d, + 'ConvTransposeBias2dBatched': make_ConvTransposeBias2dBatched, + 'ConvWithAsymmetricPadding': make_ConvWithAsymmetricPadding, + 'ConvWithAutopadSameLower': make_ConvWithAutopadSameLower, + 'ConvWithAutopadSameUpper': make_ConvWithAutopadSameUpper, + 'ConvWithDilation': make_ConvWithDilation, + 'ConvWithDynShapeStride': make_ConvWithDynShapeStride, + 'ConvWithPadding': make_ConvWithPadding, + 'ConvWithStridesNoPadding': make_ConvWithStridesNoPadding, + 'ConvWithStridesPadding': make_ConvWithStridesPadding, + 'ConvWithoutPadding': make_ConvWithoutPadding, + 'Cos': make_Cos, + 'Div': make_Div, + 'Einsum_3': make_Einsum_3, + 'Einsum_4': make_Einsum_4, + 'Einsum_dotprod': make_Einsum_dotprod, + 'Einsum_matmul': make_Einsum_matmul, + 'Elu': make_Elu, + 'EluAlpha': make_EluAlpha, + 'Equal': make_Equal, + 'Erf': make_Erf, + 'Exp': make_Exp, + 'ExpandDiffSize': make_ExpandDiffSize, + 'ExpandSameSize': make_ExpandSameSize, + 'EyeLike': make_EyeLike, + 'FMod_ConstantFolding': make_FMod_ConstantFolding, + 'GRUBatchwise': make_GRUBatchwise, + 'GRUBidirectional': make_GRUBidirectional, + 'GRUDefaults': make_GRUDefaults, + 'GRUInitialBias': make_GRUInitialBias, + 'GRUSeqLength': make_GRUSeqLength, + 'Gather2d': make_Gather2d, + 'GatherAxis0': make_GatherAxis0, + 'GatherAxis1': make_GatherAxis1, + 'GatherAxis2': make_GatherAxis2, + 'GatherAxis3': make_GatherAxis3, + 'GatherND_1': make_GatherND_1, + 'GatherND_2': make_GatherND_2, + 'GatherND_3': make_GatherND_3, + 'GatherNegativeIndices': make_GatherNegativeIndices, + 'Gelu': make_Gelu, + 'Greater': make_Greater, + 'GreaterOrEqual': make_GreaterOrEqual, + 'HardSigmoid': make_HardSigmoid, + 'HardSwish': make_HardSwish, + 'IsInf': make_IsInf, + 'LSTMBatchwise': make_LSTMBatchwise, + 'LSTMBidirectional': make_LSTMBidirectional, + 'LSTMDefaults': make_LSTMDefaults, + 'LSTMInitialBias': make_LSTMInitialBias, + 'LSTMPeepholes': make_LSTMPeepholes, + 'LayerNormalization2d': make_LayerNormalization2d, + 'LayerNormalization4d': make_LayerNormalization4d, + 'Less': make_Less, + 'LessOrEqual': make_LessOrEqual, + 'LinearWithLeakyRelu': make_LinearWithLeakyRelu, + 'LinearWithSelu': make_LinearWithSelu, + 'LinearWithSigmoid': make_LinearWithSigmoid, + 'Linear_16': make_Linear_16, + 'Linear_32': make_Linear_32, + 'Linear_64': make_Linear_64, + 'Log': make_Log, + 'MatMul_Stacked': make_MatMul_Stacked, + 'MatMul_Stacked2': make_MatMul_Stacked2, + 'Max': make_Max, + 'MaxMultidirectionalBroadcast': make_MaxMultidirectionalBroadcast, + 'MaxPool1d': make_MaxPool1d, + 'MaxPool2d': make_MaxPool2d, + 'MaxPool2d_AsymPad': make_MaxPool2d_AsymPad, + 'MaxPool2d_CeilMode': make_MaxPool2d_CeilMode, + 'MaxPool3d': make_MaxPool3d, + 'MeanMultidirectionalBroadcast': make_MeanMultidirectionalBroadcast, + 'MinMultidirectionalBroadcast': make_MinMultidirectionalBroadcast, + 'Mod_ConstantFolding': make_Mod_ConstantFolding, + 'Mul': make_Mul, + 'Neg': make_Neg, + 'NonZero': make_NonZero, + 'NonZero_Constant': make_NonZero_Constant, + 'NotIsNaN': make_NotIsNaN, + 'Pad': make_Pad, + 'Pow': make_Pow, + 'Pow_broadcast': make_Pow_broadcast, + 'RNNBatchwise': make_RNNBatchwise, + 'RNNBidirectional': make_RNNBidirectional, + 'RNNBidirectionalBatchwise': make_RNNBidirectionalBatchwise, + 'RNNDefaults': make_RNNDefaults, + 'RNNSeqLength': make_RNNSeqLength, + 'RNNSequence': make_RNNSequence, + 'RNNSequenceBatchwise': make_RNNSequenceBatchwise, + 'RandomNormal': make_RandomNormal, + 'RandomUniform': make_RandomUniform, + 'RangeFloat': make_RangeFloat, + 'RangeInt': make_RangeInt, + 'Reciprocal': make_Reciprocal, + 'ReduceMean': make_ReduceMean, + 'ReduceMean_kFirst': make_ReduceMean_kFirst, + 'ReduceProd': make_ReduceProd, + 'ReduceSum': make_ReduceSum, + 'ReduceSumSquare': make_ReduceSumSquare, + 'ScatterElements': make_ScatterElements, + 'ScatterND_1': make_ScatterND_1, + 'ScatterND_2': make_ScatterND_2, + 'ScatterND_3': make_ScatterND_3, + 'Shape': make_Shape, + 'Sin': make_Sin, + 'Slice': make_Slice, + 'Slice_Default_Axis': make_Slice_Default_Axis, + 'Slice_Default_Steps': make_Slice_Default_Steps, + 'Slice_Neg': make_Slice_Neg, + 'Softmax1d': make_Softmax1d, + 'Softmax2d': make_Softmax2d, + 'Softmax3d': make_Softmax3d, + 'Softmax4d': make_Softmax4d, + 'Softplus': make_Softplus, + 'Split_0': make_Split_0, + 'Split_1': make_Split_1, + 'Split_2': make_Split_2, + 'Sqrt': make_Sqrt, + 'Sub': make_Sub, + 'SumMultidirectionalBroadcast': make_SumMultidirectionalBroadcast, + 'Swish': make_Swish, + 'Tanh': make_Tanh, + 'Tile5D': make_Tile5D, + 'TopK': make_TopK, + 'Where': make_Where, +} + + +# =========================================================================== +# Reference data for the value-based unit tests +# =========================================================================== +# +# TEST_INPUTS defines the inputs that TestCustomModelsFromONNX.cxx (and +# TestCladAutodiff.cxx) feed to each model, one numpy array per graph input. +# The expected outputs are computed here with onnx's ReferenceEvaluator (or +# with the numpy fallbacks in EXPECTED_OVERRIDES below) and written next to +# the generated models as references/.ref, from where the tests read +# both the inputs and the expected outputs at runtime. Models without an +# entry have their expectations hardcoded in the test source instead. + + +def f32(vals, shape=None): + a = np.asarray(vals, np.float32) + return a.reshape(shape) if shape is not None else a + + +def i64(vals, shape=None): + a = np.asarray(vals, np.int64) + return a.reshape(shape) if shape is not None else a + + +def rand_f32(seed, shape): + """Deterministic standard-normal random tensor.""" + return np.random.RandomState(seed).randn(*shape).astype(np.float32) + + +TEST_INPUTS = { + 'Add': [ + f32([1.0, 2.0], (2,)), + f32([0.0, 1.0], (2,)), + ], + 'AddBroadcast1': [ + f32([-0.7802330255508423, -1.3402948379516602, -3.014829397201538, 0.5364136099815369, -1.2259478569030762], (5,)), + f32([1.0626695156097412, 0.43842875957489014, 1.2247647047042847, 0.7976327538490295, 0.9868820905685425, 0.2526761293411255, 0.4487488269805908, 0.31516772508621216, -0.7877119779586792, 0.6456566452980042, 0.5045059323310852, -0.41265228390693665, -0.22474539279937744, -0.22362373769283295, 0.005096740089356899, 0.16927210986614227, 1.0675697326660156, -0.8163477182388306, 0.8846774697303772, 0.7890205979347229], (4, 5)), + ], + 'AddBroadcast2': [ + f32([0.6008180379867554, 0.565757691860199, -0.5840851068496704, -1.5082775354385376, 1.2396254539489746], (5,)), + f32([-1.2251673936843872, -2.503737449645996, -0.614517331123352, 0.44316595792770386, 0.004092322196811438, 1.4352006912231445, -0.8375269174575806, 1.1876263618469238, -1.42122220993042, 0.3771233558654785, -0.616450846195221, 1.966413140296936, -2.035682201385498, -0.53670334815979, -2.2214934825897217, -1.5829707384109497, -1.2514921426773071, 0.6506291031837463, 2.06339693069458, 0.6022816300392151, -0.5390340089797974, -1.2628082036972046, 0.7877674698829651, 0.10825152695178986, 2.3282978534698486, -1.5089000463485718, -0.5955929160118103, -0.0920059084892273, 1.6322861909866333, 1.946860671043396, 0.7456556558609009, 0.3869551122188568, -1.832051157951355, -1.1573481559753418, 0.03800858184695244, -0.21694916486740112, -0.23516549170017242, 0.2181714028120041, 0.061358895152807236, -0.8570862412452698, -2.0186426639556885, -1.6137357950210571, -2.0205025672912598, -0.32505208253860474, -0.10711464285850525, 0.46847009658813477, 0.19955800473690033, -1.9463766813278198, 0.24790054559707642, 0.7761988043785095, -0.19873686134815216, -2.00885009765625, 1.4684786796569824, 0.9610288143157959, -0.008149653673171997, 0.4633333384990692, -0.1113162413239479, 1.8204692602157593, -0.10051906853914261, 2.405775308609009, 2.5781426429748535, -1.5141286849975586, -0.06480903923511505, 0.9229392409324646, -1.314860463142395, 0.36738714575767517, -0.002170204883441329, -0.47474405169487, -0.6289427280426025, -1.317047357559204, -0.6206338405609131, -0.49025020003318787, -0.21248511970043182, -0.023678667843341827, 0.028880996629595757, -0.7447777986526489, 0.013009180314838886, -1.6810555458068848, 0.08222470432519913, -1.1493949890136719, -1.575654149055481, -0.7993866801261902, -0.4064111113548279, 1.0935839414596558, 1.5832337141036987, -0.08151749521493912, -0.0909925028681755, 2.3559670448303223, -0.06853648275136948, 0.4128839373588562, 0.500495433807373, -1.484426498413086, -0.5193490386009216, 0.3810258209705353, -0.10618859529495239, 0.2839215397834778, 1.1321500539779663, 1.2155804634094238, -1.0466749668121338, -0.9411510825157166, -0.04043630510568619, 1.455543041229248, 0.16402567923069, -0.33469337224960327, 1.2770131826400757, 0.8647446036338806, 1.0962142944335938, -1.0656343698501587, -1.5563756227493286, 2.143430471420288, 0.4696103632450104, 0.9091355800628662, -0.6206033825874329, -1.0423543453216553, -1.329746961593628, -0.13596804440021515, 0.9624383449554443, 1.134135127067566, -0.9246122241020203, -2.2613234519958496], (2, 3, 4, 5)), + ], + 'AddBroadcast3': [ + f32([0.13225243985652924, -0.4780140519142151, -1.470346212387085, 0.8778636455535889, -0.5138850212097168, 0.7701201438903809, 0.994074821472168, -0.4101419746875763, 1.7650624513626099, 1.241428017616272], (2, 1, 1, 5)), + f32([-0.7990003824234009, 1.2677446603775024, 0.10287351161241531, -0.007047129794955254, 0.19927170872688293, 1.7712593078613281, 0.2339390069246292, -0.751605749130249, -0.4098702073097229, 0.02957325056195259, 2.487703800201416, 2.724266767501831, 0.16116267442703247, 0.13580884039402008, -1.3455098867416382, 1.0834174156188965, -0.5723267793655396, -0.27434247732162476, 2.2975919246673584, 0.7250648140907288, -0.3598426282405853, -1.4755396842956543, 0.46544721722602844, 0.4530450701713562, 0.393509179353714, 0.2533503770828247, -2.154552698135376, 0.5859283208847046, 0.09075859934091568, 1.328303575515747, 2.1687653064727783, -1.315091609954834, -0.7790181636810303, 1.7297074794769287, 0.8941051959991455, 1.1889108419418335, 0.5837250351905823, -0.6117035150527954, -0.8382923007011414, 0.6391794681549072, 0.6662607789039612, -1.0766762495040894, 0.014115190133452415, -0.6708264946937561, -0.04556865990161896, -0.049491479992866516, -1.8707592487335205, 0.255876362323761, 0.1471511423587799, -0.7458451390266418, -1.1937352418899536, -1.5214205980300903, -0.9252294301986694, -0.9812653064727783, -0.07535745948553085, -1.4692507982254028, -0.08861242234706879, 0.6495186686515808, -0.1691899448633194, 0.8701536059379578, 0.5768899321556091, 1.3629382848739624, 1.282568335533142, 0.3924553692340851, 0.43308472633361816, 0.8452982902526855, -0.5668654441833496, -0.8479184508323669, -0.11286944150924683, 0.6085797548294067, -0.7951951026916504, -0.2049192488193512, -1.529517412185669, -0.3903006315231323, -2.7616076469421387, 0.09055905789136887, -0.991420328617096, 0.3348078429698944, -1.0999988317489624, 1.3614935874938965, 0.18557575345039368, 0.554069995880127, 1.2316406965255737, -0.23469014465808868, -1.3727471828460693, 1.80717933177948, 1.429667592048645, 0.7207739353179932, -0.09774938970804214, 1.1206538677215576, -0.5151561498641968, -0.9527944922447205, 0.8764696717262268, -0.5944010019302368, -0.12440208345651627, -0.710966944694519, -0.630127489566803, 0.5172616839408875, 1.2372664213180542, 1.5625547170639038, -0.9446976184844971, -0.381147563457489, -0.4202176034450531, -0.5892148613929749, -0.7143963575363159, 0.04793575033545494, -2.042145252227783, -0.45765405893325806, -1.1230720281600952, 0.9072713851928711, 0.9627283215522766, 0.5430320501327515, -0.8497303128242493, 0.2878032922744751, 0.17027853429317474, -0.11893711239099503, -1.2241463661193848, -1.6274759769439697, 0.5326449871063232, 0.5348359942436218], (2, 3, 4, 5)), + ], + 'AddBroadcast4': [ + f32([1.9430140256881714, 0.40606817603111267], (2, 1)), + f32([0.5089889168739319, -0.2782992124557495, -0.6876162886619568, 0.3318638205528259, 0.5791553258895874, 0.40685799717903137, 1.420383334159851, 0.19857093691825867], (2, 4)), + ], + 'AddBroadcast5': [ + f32([-0.45616137981414795, -0.05853134021162987, 1.0956422090530396, 0.9588031768798828, 0.9499531984329224, -0.3586410582065582, 1.0857089757919312, 0.6028053164482117], (2, 1, 4)), + f32([1.6978745460510254, 1.1064167022705078, 2.197551727294922, 0.06709206104278564, 0.0457230806350708, -2.1450436115264893, -0.4773070216178894, 0.15205423533916473, -0.2515922486782074, -0.07529807090759277, 0.517436683177948, 0.08267594873905182, 0.3401562571525574, 0.0946023091673851, -1.166089653968811, -0.2346605807542801, -0.5520268082618713, -0.13844847679138184, 0.5305575728416443, 0.1706864833831787, -0.4949127733707428, -1.4246270656585693, -0.9997391104698181, -0.257132887840271], (2, 3, 4)), + ], + 'AddBroadcast6': [ + f32([1.0549867153167725, -1.6431103944778442, 0.11925146728754044, -1.597557783126831, -0.014453129842877388, -0.6944054365158081, -0.12011280655860901, 0.005393229890614748, -0.16923530399799347, 2.3453359603881836, 1.302680492401123, 0.4569944441318512], (2, 1, 3, 1, 2)), + f32([0.03162163123488426, 1.363404393196106, -0.347364604473114, -0.7185632586479187, 0.40669968724250793, -0.3759573996067047, 0.22234952449798584, 1.6956379413604736, 0.9145916700363159, -0.020812150090932846, -1.6489421129226685, -0.011892610229551792, 0.5803133845329285, -0.11880190670490265, 0.7009931802749634, -0.3742424249649048, -0.23980526626110077, -0.031784068793058395, -0.27969110012054443, 0.018956879153847694, 1.3211175203323364, 0.021139059215784073, 0.514503002166748, -1.4176076650619507, -0.1922055333852768, 0.23529522120952606, 0.9519990682601929, -1.3897144794464111, -0.7583696246147156, -0.9095695614814758, -0.13006828725337982, -0.6439045667648315, -0.0808228999376297, 0.7913475632667542, 1.006848692893982, -1.438180923461914, -0.14550620317459106, -0.3363551199436188, -0.6185612082481384, -0.4928140640258789, -1.1294726133346558, 1.6181882619857788, -0.05826431140303612, -1.4780218601226807, 0.2563738226890564, -0.15478579699993134, 2.507887840270996, 0.3089805841445923], (2, 2, 3, 2, 2)), + ], + 'AddBroadcast7': [ + f32([-0.4216483533382416, -0.6176707744598389, -0.6877889633178711, -1.1417591571807861, 0.6320437788963318, -0.6063031554222107], (2, 1, 3, 1)), + f32([1.4051986932754517, -0.2876608669757843, 0.0749375969171524, 1.2207484245300293, -0.48621267080307007, -0.688210129737854, -0.6774346828460693, 0.3670888841152191, 0.0008057440281845629, -0.2080310881137848, 0.9697791337966919, 0.7583738565444946], (1, 1, 3, 4)), + ], + 'AvgPool': [f32([0.4763999879360199, -0.19760000705718994, 1.6505999565124512, -0.24210000038146973, 0.6412000060081482, 1.9984999895095825, 0.3937999904155731, 0.1347000002861023, 0.22040000557899475, -0.7502999901771545, 0.21389999985694885, 0.7285000085830688, -0.020999999716877937, -0.4584999978542328, -1.5333000421524048, -0.4772000014781952, 0.5559999942779541, 0.6323000192642212, -2.5371999740600586, 1.4905999898910522, -1.1061999797821045, -0.970300018787384, 0.23659999668598175, -0.91839998960495, 0.30140000581741333, 0.7985000014305115, -0.6840999722480774, -2.285399913787842, -2.7727999687194824, -1.2805999517440796, -1.0946999788284302, -0.5989999771118164, -0.30329999327659607, -1.9041999578475952, -0.5403000116348267, 0.23319999873638153, 0.921500027179718, -0.15489999949932098, 0.05570000037550926, -0.5566999912261963, -1.4970999956130981, 0.5386000275611877, -0.2921999990940094, 0.4860000014305115, -0.39730000495910645, -0.46239998936653137, 0.4514000117778778, 0.23849999904632568, 0.3783000111579895, -1.0499999523162842], (1, 1, 5, 10))], + 'Cast': [i64([1, 2, 3, 4, 5, 6], (2, 3))], + 'ComplexTopK': [f32([9.0, 8.0, 4.5, 1.7000000476837158, 2.9000000953674316, 3.200000047683716, 4.0, 2.5999999046325684, 7.400000095367432, 3.5, 5.599999904632568, 7.099999904632568, 9.800000190734863, 1.100000023841858, 3.299999952316284, 6.199999809265137, 8.399999618530273, 0.699999988079071, 2.200000047683716, 3.299999952316284, 4.400000095367432, 5.5, 6.599999904632568, 7.699999809265137, 8.800000190734863, 9.899999618530273, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 5.0, 4.0, 3.0, 2.0, 1.0, 6.0, 7.0, 8.0, 9.0], (2, 3, 9))], + 'Constant': [ + ], + 'ConvAddRelu': [f32(np.arange(-7.0, 9.0), (1, 1, 4, 4))], + 'ConvTranspose1d': [f32(np.arange(0.0, 3.0), (1, 1, 3))], + 'ConvTranspose2d': [f32(np.arange(0.0, 9.0), (1, 1, 3, 3))], + 'ConvTransposeBias2d': [f32(np.arange(0.0, 9.0), (1, 1, 3, 3))], + 'ConvTransposeBias2dBatched': [f32(np.arange(0.0, 18.0), (2, 1, 3, 3))], + 'ConvWithAsymmetricPadding': [f32(np.arange(0.0, 35.0), (1, 1, 7, 5))], + 'ConvWithAutopadSameLower': [f32(np.arange(0.0, 25.0), (1, 1, 5, 5))], + 'ConvWithAutopadSameUpper': [f32(np.arange(0.0, 25.0), (1, 1, 5, 5))], + 'ConvWithDilation': [f32(np.arange(0.0, 49.0), (1, 1, 7, 7))], + 'ConvWithPadding': [f32(np.arange(0.0, 25.0), (1, 1, 5, 5))], + 'ConvWithStridesNoPadding': [f32(np.arange(0.0, 35.0), (1, 1, 7, 5))], + 'ConvWithStridesPadding': [f32(np.arange(0.0, 35.0), (1, 1, 7, 5))], + 'ConvWithoutPadding': [f32(np.arange(0.0, 25.0), (1, 1, 5, 5))], + 'Div': [ + f32([4.0, 2.0], (2,)), + f32([2.0, 2.0], (2,)), + ], + 'Elu': [f32([1.0, -2.0, 3.0, 0.5, -1.0, 2.0], (2, 3))], + 'EluAlpha': [f32([1.0, -2.0, 3.0, 0.5, -1.0, 2.0], (2, 3))], + 'Equal': [ + f32([1.0, 2.0, 3.0], (3,)), + f32([4.0, 2.0, 6.0], (3,)), + ], + 'Erf': [f32([-1.041200041770935, 0.19179999828338623, 0.9984999895095825, -0.5958999991416931, 0.6841999888420105, -2.4718000888824463, 0.18039999902248383, 0.6851000189781189, 1.5645999908447266, -1.4981000423431396, 0.42480000853538513, -0.8503999710083008], (12,))], + 'Exp': [f32([1.4656645059585571, 0.6333451271057129, 2.4048163890838623, 0.5446845293045044, -1.4127167463302612, -0.18609187006950378, 0.275448203086853, 1.106152057647705, 0.884743869304657, 0.47531232237815857], (10,))], + 'ExpandDiffSize': [f32([0.0, 1.0, 2.0], (3, 1))], + 'ExpandSameSize': [f32([0.0, 1.0, 2.0], (3, 1))], + 'EyeLike': [f32([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], (3, 3))], + 'GRUBatchwise': [f32(np.arange(1.0, 7.0), (3, 1, 2))], + 'GRUBidirectional': [f32(np.arange(1.0, 7.0), (1, 3, 2))], + 'GRUDefaults': [f32(np.arange(1.0, 7.0), (1, 3, 2))], + 'GRUInitialBias': [f32(np.arange(1.0, 10.0), (1, 3, 3))], + 'GRUSeqLength': [f32(np.arange(1.0, 19.0), (2, 3, 3))], + 'Gather2d': [f32(np.arange(0.0, 9.0), (3, 3))], + 'GatherAxis0': [f32(np.arange(0.0, 120.0), (5, 4, 3, 2))], + 'GatherAxis1': [f32(np.arange(0.0, 120.0), (5, 4, 3, 2))], + 'GatherAxis2': [f32(np.arange(0.0, 120.0), (5, 4, 3, 2))], + 'GatherAxis3': [f32(np.arange(0.0, 120.0), (5, 4, 3, 2))], + 'GatherNegativeIndices': [f32(np.arange(0.0, 10.0), (10,))], + 'Gelu': [f32([1.0, -2.0, 3.0, 0.5, -1.0, 2.0], (6,))], + 'Greater': [ + f32([1.0, 2.0, 3.0], (3,)), + f32([4.0, 2.0, 6.0], (3,)), + ], + 'GreaterOrEqual': [ + f32([1.0, 2.0, 3.0], (3,)), + f32([4.0, 2.0, 6.0], (3,)), + ], + 'HardSigmoid': [f32([1.0, -2.0, 3.0, 0.5, -1.0, 2.0], (6,))], + 'HardSwish': [f32([1.0, -2.0, 3.0, 0.5, -1.0, 2.0], (6,))], + 'LSTMBatchwise': [f32(np.arange(1.0, 7.0), (3, 1, 2))], + 'LSTMBidirectional': [f32(np.arange(1.0, 7.0), (3, 1, 2))], + 'LSTMDefaults': [f32(np.arange(1.0, 7.0), (3, 1, 2))], + 'LSTMInitialBias': [f32(np.arange(1.0, 10.0), (3, 1, 3))], + 'LSTMPeepholes': [f32(np.arange(1.0, 9.0), (1, 2, 4))], + 'LayerNormalization2d': [f32(np.arange(0.0, 12.0), (3, 4))], + 'LayerNormalization4d': [f32(np.arange(0.0, 120.0), (2, 3, 4, 5))], + 'Less': [ + f32([1.0, 2.0, 3.0], (3,)), + f32([4.0, 2.0, 6.0], (3,)), + ], + 'LessOrEqual': [ + f32([1.0, 2.0, 3.0], (3,)), + f32([4.0, 2.0, 6.0], (3,)), + ], + 'LinearWithLeakyRelu': [f32([0.43689998984336853, -0.6881999969482422, 1.030900001525879, -1.0262999534606934, -0.15189999341964722, 1.2237000465393066, -0.7053999900817871, -0.1762000024318695, -0.6811000108718872, -2.259700059890747, 1.0388000011444092, -0.7993000149726868, 0.1467999964952469, 1.325700044631958, -0.4713999927043915, -0.0957999974489212, 0.7056999802589417, -0.3749000132083893, -0.3310000002384186, 0.09860000014305115, -0.13699999451637268, 0.08320000022649765, -1.6464999914169312, -0.2793000042438507], (24,))], + 'LinearWithSelu': [f32(np.full(48, 1.0), (2, 24))], + 'LinearWithSigmoid': [f32(np.full(48, 1.0), (2, 24))], + 'Linear_16': [f32(np.full(1600, 1.0), (16, 100))], + 'Linear_32': [f32(np.full(3200, 1.0), (32, 100))], + 'Linear_64': [f32(np.full(6400, 1.0), (64, 100))], + 'Log': [f32([1.0, 2.0, 3.0, 4.0], (4,))], + 'Max': [ + f32([1.0, 2.0, -1.0], (1, 3)), + f32([3.0, 0.0, 4.0], (1, 3)), + ], + 'MaxMultidirectionalBroadcast': [ + f32([0.35974153876304626, -2.2087337970733643, 0.957462728023529], (3, 1)), + f32([0.7590198516845703, -0.4654446244239807, -0.34920576214790344, -0.14607539772987366, 0.08269050717353821, -0.700456976890564], (2, 3, 1)), + f32([-0.4146898090839386, -0.46591925621032715, 0.5617253184318542, 0.056169308722019196], (1, 4)), + ], + 'MaxPool1d': [f32([0.09070000052452087, 0.10289999842643738, 0.814300000667572, 1.4496999979019165, -0.7785000205039978, 0.3824999928474426, -0.3763999938964844, 1.5785000324249268, -0.08349999785423279, 0.16220000386238098, 1.5866999626159668, 0.9822999835014343, -0.882099986076355, 0.4438999891281128, -0.13779999315738678, -0.2273000031709671, -0.01979999989271164, -2.0230000019073486, 0.09049999713897705, 0.6674000024795532, -1.4290000200271606, -1.309999942779541, -0.9438999891281128, -0.08330000191926956, -0.19189999997615814, 0.6886000037193298, 0.9388999938964844, -1.2913999557495117, -1.3583999872207642, -2.03410005569458, -0.32690000534057617, 0.1703999936580658, 1.1776000261306763, 1.3971999883651733, -1.8874000310897827, -1.533400058746338, 1.154099941253662, 0.3010999858379364, 0.6568999886512756, -2.350399971008301, 0.4032999873161316, 0.11420000344514847, 2.284600019454956, -1.3947999477386475, -0.8572999835014343, 0.5756000280380249, -1.086400032043457, 0.22830000519752502, 0.8946999907493591, 1.7626999616622925, -0.1657000035047531, 0.0649000033736229, -1.606600046157837, 0.41620001196861267, -1.152500033378601, -0.8184000253677368, 1.1324000358581543, -1.1086000204086304, 0.10610000044107437, 1.007099986076355], (1, 6, 10))], + 'MaxPool2d': [f32([0.6266000270843506, 0.1656000018119812, 0.275299996137619, -0.45579999685287476, -1.4592000246047974, 0.9284999966621399, -1.340999960899353, 1.3222999572753906, -0.5935999751091003, -1.364799976348877, -0.2989000082015991, 0.5900999903678894, -0.8845000267028809, -0.043299999088048935, 0.8313999772071838, -1.71589994430542, -0.5764999985694885, 0.8677999973297119, 1.0256999731063843, 0.7846999764442444, -0.34209999442100525, -1.2364000082015991, -0.5805000066757202, 0.44209998846054077, 1.218400001525879, 0.5042999982833862, 1.6822999715805054, -1.04830002784729, -2.2797999382019043, -1.892699956893921, 0.7716000080108643, 0.04050000011920929, 0.31209999322891235, -0.3010999858379364, -0.32659998536109924, -1.965999960899353, 1.0836999416351318, 0.23170000314712524, 0.9083999991416931, -0.32850000262260437, -0.9398000240325928, -0.20649999380111694, -0.9498999714851379, -0.9739000201225281, -0.12880000472068787, -0.13750000298023224, -1.261199951171875, 0.8809999823570251, 0.850600004196167, 0.445499986410141], (1, 1, 5, 10))], + 'MaxPool2d_AsymPad': [f32([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0], (1, 1, 4, 4))], + 'MaxPool2d_CeilMode': [f32(np.arange(25), (1, 1, 5, 5))], + 'MaxPool3d': [f32([-2.649600028991699, 1.0476000308990479, -0.5152999758720398, 0.37709999084472656, 0.41290000081062317, -0.3077000081539154, -0.8716999888420105, -0.8040000200271606, -0.35249999165534973, -0.17649999260902405, -0.33640000224113464, 0.8737000226974487, -0.23810000717639923, -0.8296999931335449, 0.4666000008583069, 0.6984000205993652, -0.6759999990463257, 0.629800021648407, 1.3832999467849731, 0.11010000109672546, 0.20389999449253082, -0.5476999878883362, 0.23409999907016754, 0.9180999994277954, 0.38420000672340393, 0.24279999732971191, 1.7924000024795532], (1, 1, 3, 3, 3))], + 'MeanMultidirectionalBroadcast': [ + f32([0.35974154, -2.20873388, 0.95746274], (3, 1)), + f32([0.75901985, -0.46544461, -0.34920575, -0.1460754, 0.08269051, -0.70045695], (2, 3, 1)), + f32([-0.41468981, -0.46591926, 0.56172534, 0.05616931], (1, 4)), + ], + 'MinMultidirectionalBroadcast': [ + f32([0.35974153876304626, -2.2087337970733643, 0.957462728023529], (3, 1)), + f32([0.7590198516845703, -0.4654446244239807, -0.34920576214790344, -0.14607539772987366, 0.08269050717353821, -0.700456976890564], (2, 3, 1)), + f32([-0.4146898090839386, -0.46591925621032715, 0.5617253184318542, 0.056169308722019196], (1, 4)), + ], + 'Mul': [ + f32([1.0, 2.0], (2,)), + f32([0.0, 1.0], (2,)), + ], + 'Neg': [f32([-1.909999966621399, 1.881100058555603, -1.7268999814987183, -0.10939999669790268, -0.014499999582767487, 0.250900000333786, 0.5892999768257141, -2.2732999324798584, -0.7077000141143799, 1.0644999742507935, -0.8607000112533569, 0.2084999978542328], (12,))], + 'Pow': [ + f32([1.0, 2.0, 3.0], (3,)), + f32([4.0, 5.0, 6.0], (3,)), + ], + 'Pow_broadcast': [ + f32([1.0, 2.0, 3.0, 3.0, 4.0, 5.0], (1, 2, 3)), + f32([2.0, 3.0, 4.0, 2.0, 3.0, 4.0], (2, 3)), + ], + 'RNNBatchwise': [f32(np.arange(1.0, 7.0), (3, 1, 2))], + 'RNNBidirectional': [f32([0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17], (3, 3, 2))], + 'RNNBidirectionalBatchwise': [f32([0.0, 0.01, 0.06, 0.07, 0.12, 0.13, 0.02, 0.03, 0.08, 0.09, 0.14, 0.15, 0.04, 0.05, 0.1, 0.11, 0.16, 0.17], (3, 3, 2))], + 'RNNDefaults': [f32(np.arange(1.0, 10.0), (3, 1, 3))], + 'RNNSeqLength': [f32(np.arange(1.0, 19.0), (2, 3, 3))], + 'RNNSequence': [f32([0.01, -0.01, 0.08, 0.09, 0.001, 0.09, -0.7, -0.35, 0.0, 0.001, 0.16, -0.19, 0.003, 0.0, 0.0001, 0.05, -0.09, 0.013, 0.5, 0.005, 0.2, -0.05, 0.062, -0.04, -0.04, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06, 0.087, 0.01, 0.3, -0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], (3, 3, 5))], + 'RNNSequenceBatchwise': [f32([0.01, -0.01, 0.08, 0.09, 0.001, 0.05, -0.09, 0.013, 0.5, 0.005, 0.06, 0.087, 0.01, 0.3, -0.001, 0.09, -0.7, -0.35, 0.0, 0.001, 0.2, -0.05, 0.062, -0.04, -0.04, 0.0, 0.0, 0.0, 0.0, 0.0, 0.16, -0.19, 0.003, 0.0, 0.0001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], (3, 3, 5))], + 'RangeFloat': [ + f32([1.0], (1,)), + f32([10.0], (1,)), + f32([2.0], (1,)), + ], + 'RangeInt': [ + i64([1], (1,)), + i64([10], (1,)), + i64([2], (1,)), + ], + 'Reciprocal': [f32([1.2690999507904053, -1.215999960899353, 0.6392999887466431, -0.4438000023365021, 0.8065000176429749, 0.20110000669956207], (2, 3))], + 'ReduceMean': [f32([5.0, 2.0, 3.0, 5.0, 5.0, 4.0], (1, 2, 3))], + 'ReduceProd': [f32([5.0, 2.0, 3.0, 5.0, 5.0, 4.0], (1, 2, 3))], + 'Shape': [f32([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], (1, 2, 3))], + 'Slice': [rand_f32(1, (20, 10, 5))], + 'Slice_Default_Axis': [rand_f32(2, (20, 10, 5))], + 'Slice_Default_Steps': [rand_f32(3, (20, 10, 5))], + 'Slice_Neg': [rand_f32(4, (20, 10, 5))], + 'Softmax1d': [f32([-1.0, 0.0, 1.0], (3,))], + 'Softmax2d': [f32([-1.0, 0.0, 1.0], (1, 3))], + 'Softmax3d': [f32([-0.8938999772071838, -0.36739999055862427, 0.17630000412464142, 1.580399990081787, -0.46869999170303345, 1.2252999544143677, -1.3487999439239502, -0.10000000149011612, -0.12620000541210175, 0.49619999527931213, 1.0870000123977661, 0.690500020980835, -0.3450999855995178, -1.698099970817566, -0.46880000829696655, 0.44679999351501465, -0.5479000210762024, 0.06499999761581421, 1.044600009918213, -1.624899983406067, -0.718999981880188, -1.7519999742507935, 3.7753000259399414, -1.493899941444397], (2, 3, 4))], + 'Softmax4d': [f32([-0.586899995803833, -1.4271999597549438, -0.15459999442100525, 0.009600000455975533, 0.17059999704360962, 0.03880000114440918, -0.3483999967575073, -0.7828999757766724, 1.113800048828125, -0.5644000172615051, -0.6263999938964844, -1.1890000104904175, 1.6741000413894653, -0.7129999995231628, 0.9592000246047974, 1.7476999759674072, -0.47749999165534973, 1.3407000303268433, -0.3882000148296356, -0.4560000002384186, 1.0384999513626099, -0.16689999401569366, 0.5540000200271606, -1.0789999961853027, -0.6152999997138977, -0.6273999810218811, -1.2303999662399292, -0.6757000088691711, 1.017799973487854, -0.2379000037908554, -0.7911999821662903, -0.016499999910593033, -0.5422999858856201, 0.14589999616146088, 1.3585000038146973, -0.5005000233650208, -0.21870000660419464, -1.8180999755859375, -0.6642000079154968, 0.028699999675154686, -1.9103000164031982, 0.7983999848365784, -0.7860000133514404, 1.5133999586105347, 1.3873000144958496, -0.6462000012397766, -0.6353999972343445, -0.13349999487400055], (2, 3, 4, 2))], + 'Sqrt': [f32([0.8343999981880188, 0.4715999960899353, 0.6226000189781189, 0.8447999954223633, 0.2483000010251999, 0.9466999769210815], (2, 3))], + 'Sub': [ + f32([1.0, 2.0], (2,)), + f32([0.0, 1.0], (2,)), + ], + 'SumMultidirectionalBroadcast': [ + f32([0.35974153876304626, -2.2087337970733643, 0.957462728023529], (3, 1)), + f32([0.7590198516845703, -0.4654446244239807, -0.34920576214790344, -0.14607539772987366, 0.08269050717353821, -0.700456976890564], (2, 3, 1)), + f32([-0.4146898090839386, -0.46591925621032715, 0.5617253184318542, 0.056169308722019196], (1, 4)), + ], + 'Swish': [f32([1.0, -2.0, 3.0, 0.5, -1.0, 2.0], (6,))], + 'Tanh': [f32([-0.38960000872612, -0.3521000146865845, 0.03629999980330467, 1.0961999893188477, 0.5084999799728394, -0.8522999882698059, -0.6765999794006348, 0.24210000038146973, 1.597100019454956, 1.3873000144958496, -0.21119999885559082, -0.6894999742507935, -0.5069000124931335, -2.1394999027252197, -0.7087000012397766, 1.1657999753952026, 1.3493000268936157, 0.8131999969482422, 1.7156000137329102, -0.8636999726295471, -0.19709999859333038, 0.041099999099969864, -0.5662000179290771, -0.2515999972820282], (24,))], + 'Tile5D': [f32([0.2386120855808258, 0.5549510717391968, -1.8190287351608276, 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, 0.2705111503601074, 1.42119562625885, 0.032626643776893616, -1.212586522102356, -0.5129594802856445, -0.43296414613723755, -0.1606937050819397, 1.1884371042251587, -0.662174642086029, -2.291109323501587, -0.6852569580078125, 2.325223922729492, -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, 1.90426504611969, -0.4861580729484558, 0.9139055013656616, -0.5031066536903381, 0.9583520293235779, -0.23210509121418, 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, -0.14444805681705475, -0.8829464912414551, 1.725736141204834, 0.45657631754875183, 0.4920198321342468, -1.088847041130066, 0.49437597393989563, -0.006085286382585764, 2.475630760192871, 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, -2.593783378601074, -0.11392943561077118, 0.5637082457542419, 2.075004816055298, -1.0598397254943848, 1.0823975801467896], (2, 2, 2, 3, 3))], + 'TopK': [f32([9.0, 8.0, 4.5, 1.7000000476837158, 2.9000000953674316, 3.200000047683716, 4.0, 2.5999999046325684, 7.400000095367432], (9,))], +} + + +def _recurrent_reference(model, feeds): + """Expected outputs for the RNN/LSTM/GRU models that onnx's + ReferenceEvaluator cannot evaluate (bidirectional recurrence, batchwise + layout or per-batch sequence lengths). Implements the ONNX operator + definitions directly with numpy, reading the weights from the model.""" + node = model.graph.node[0] + op = node.op_type + init = {t.name: numpy_helper.to_array(t) for t in model.graph.initializer} + + def operand(idx): + if idx < len(node.input) and node.input[idx]: + name = node.input[idx] + return feeds[name] if name in feeds else init[name] + return None + + attrs = {a.name: a for a in node.attribute} + hidden = attrs["hidden_size"].i + layout = attrs["layout"].i if "layout" in attrs else 0 + direction = attrs["direction"].s.decode() if "direction" in attrs else "forward" + linear_before_reset = ( + attrs["linear_before_reset"].i if "linear_before_reset" in attrs else 0 + ) + if "activations" in attrs: + acts = [s.decode() for s in attrs["activations"].strings] + defaults = {"RNN": ["Tanh"], "GRU": ["Sigmoid", "Tanh"], "LSTM": ["Sigmoid", "Tanh", "Tanh"]}[op] + num_dir_acts = 2 if direction == "bidirectional" else 1 + if acts != defaults * num_dir_acts: + raise RuntimeError(f"{op}: non-default activations {acts} not implemented") + + X, W, R = operand(0), operand(1), operand(2) + if op == "LSTM": + B, seq_lens, initial_h, initial_c, P = (operand(i) for i in range(3, 8)) + else: + B, seq_lens, initial_h = (operand(i) for i in range(3, 6)) + initial_c = P = None + + if layout == 1: + X = X.transpose(1, 0, 2) + seq_length, batch, _ = X.shape + num_dir = 2 if direction == "bidirectional" else 1 + ngates = {"RNN": 1, "GRU": 3, "LSTM": 4}[op] + if layout == 1: + # With layout=1, initial_h/initial_c hold [batch, num_dir, hidden]. + # The pytorch exporter kept the layout-0 dims on the initializer, so + # reinterpret the raw buffer instead of transposing the array. + if initial_h is not None: + initial_h = initial_h.flatten().reshape(batch, num_dir, hidden).transpose(1, 0, 2) + if initial_c is not None: + initial_c = initial_c.flatten().reshape(batch, num_dir, hidden).transpose(1, 0, 2) + if B is None: + B = np.zeros((num_dir, 2 * ngates * hidden), np.float32) + if seq_lens is None: + seq_lens = np.full(batch, seq_length) + seq_lens = np.asarray(seq_lens).astype(np.int64) + if direction != "forward" and not np.all(seq_lens == seq_length): + raise RuntimeError("per-batch sequence lengths only implemented for direction=forward") + if initial_h is None: + initial_h = np.zeros((num_dir, batch, hidden), np.float32) + if op == "LSTM" and initial_c is None: + initial_c = np.zeros((num_dir, batch, hidden), np.float32) + + def sigmoid(v): + return 1.0 / (1.0 + np.exp(-v)) + + Y = np.zeros((seq_length, num_dir, batch, hidden), np.float32) + Y_h = np.zeros((num_dir, batch, hidden), np.float32) + Y_c = np.zeros((num_dir, batch, hidden), np.float32) + for d in range(num_dir): + reverse = direction == "reverse" or d == 1 + Wd, Rd = W[d], R[d] + Wb, Rb = B[d][: ngates * hidden], B[d][ngates * hidden :] + h = initial_h[d].astype(np.float32) + c = initial_c[d].astype(np.float32) if op == "LSTM" else None + for step in range(seq_length): + t = seq_length - 1 - step if reverse else step + x = X[t] + pre = x @ Wd.T + h @ Rd.T + Wb + Rb + if op == "RNN": + h_new = np.tanh(pre) + elif op == "GRU": + z = sigmoid(pre[:, :hidden]) + r = sigmoid(pre[:, hidden : 2 * hidden]) + Wpre_h = x @ Wd[2 * hidden :].T + Wb[2 * hidden :] + if linear_before_reset: + h_tilde = np.tanh(Wpre_h + r * (h @ Rd[2 * hidden :].T + Rb[2 * hidden :])) + else: + h_tilde = np.tanh(Wpre_h + (r * h) @ Rd[2 * hidden :].T + Rb[2 * hidden :]) + h_new = (1 - z) * h_tilde + z * h + else: # LSTM: gate order in W/R/B is i, o, f, c + pc = P[d] if P is not None else np.zeros(3 * hidden, np.float32) + i_g = sigmoid(pre[:, :hidden] + pc[:hidden] * c) + f_g = sigmoid(pre[:, 2 * hidden : 3 * hidden] + pc[2 * hidden :] * c) + c_tilde = np.tanh(pre[:, 3 * hidden :]) + c_new = f_g * c + i_g * c_tilde + o_g = sigmoid(pre[:, hidden : 2 * hidden] + pc[hidden : 2 * hidden] * c_new) + h_new = o_g * np.tanh(c_new) + valid = (seq_lens > t).reshape(batch, 1) + if op == "LSTM": + c = np.where(valid, c_new, c) + h = np.where(valid, h_new, h) + Y[t, d] = np.where(valid, h_new, 0) + Y_h[d] = h + if op == "LSTM": + Y_c[d] = c + + if layout == 1: + Y = Y.transpose(2, 0, 1, 3) + Y_h = Y_h.transpose(1, 0, 2) + Y_c = Y_c.transpose(1, 0, 2) + outs = {"Y": Y, "Y_h": Y_h, "Y_c": Y_c} + return [outs[name] for name in ("Y", "Y_h", "Y_c")[: len(node.output)] if name] + + +def _maxpool2d_reference(model, feeds): + """MaxPool with asymmetric padding; the ReferenceEvaluator computes a + wrong output shape for that case.""" + node = model.graph.node[0] + attrs = {a.name: (list(a.ints) if a.type == onnx.AttributeProto.INTS else a.i) + for a in node.attribute} + kh, kw = attrs["kernel_shape"] + sh, sw = attrs.get("strides", [1, 1]) + pt, pl, pb, pr = attrs.get("pads", [0, 0, 0, 0]) + if attrs.get("ceil_mode", 0) != 0: + raise RuntimeError("ceil_mode not implemented") + x = feeds[node.input[0]] + n, c, h, w = x.shape + xp = np.full((n, c, h + pt + pb, w + pl + pr), -np.inf, np.float32) + xp[:, :, pt : pt + h, pl : pl + w] = x + h_out = (h + pt + pb - kh) // sh + 1 + w_out = (w + pl + pr - kw) // sw + 1 + out = np.empty((n, c, h_out, w_out), np.float32) + for i in range(h_out): + for j in range(w_out): + out[:, :, i, j] = xp[:, :, i * sh : i * sh + kh, j * sw : j * sw + kw].max(axis=(2, 3)) + return [out] + + +def _mean_reference(model, feeds): + """Mean with multidirectional broadcasting; the ReferenceEvaluator fails + to broadcast the inputs to a common shape.""" + return [np.mean(np.broadcast_arrays(*feeds.values()), axis=0, dtype=np.float32)] + + +# Models whose expected outputs the ReferenceEvaluator cannot compute. +EXPECTED_OVERRIDES = { + "GRUBidirectional": _recurrent_reference, + "LSTMBidirectional": _recurrent_reference, + "RNNBidirectional": _recurrent_reference, + "RNNBidirectionalBatchwise": _recurrent_reference, + "RNNSequence": _recurrent_reference, + "RNNSequenceBatchwise": _recurrent_reference, + "MaxPool2d_AsymPad": _maxpool2d_reference, + "MeanMultidirectionalBroadcast": _mean_reference, +} + + +def compute_reference(name): + """Return (feeds, outputs) for the test inputs of the given model.""" + model = MODELS[name]() + init_names = {t.name for t in model.graph.initializer} + graph_inputs = [vi for vi in model.graph.input if vi.name not in init_names] + arrays = TEST_INPUTS[name] + if len(arrays) != len(graph_inputs): + raise RuntimeError( + f"{name}: {len(arrays)} test inputs for {len(graph_inputs)} graph inputs" + ) + feeds = {vi.name: arr for vi, arr in zip(graph_inputs, arrays)} + if name in EXPECTED_OVERRIDES: + outputs = EXPECTED_OVERRIDES[name](model, feeds) + else: + outputs = ReferenceEvaluator(model).run(None, feeds) + return feeds, [np.asarray(o) for o in outputs] + + +def _write_reference_file(path, feeds, outputs): + """Text format, one entry per graph input/output: + \n\n""" + + def entry(f, key, arr): + if arr.dtype == np.bool_: + arr = arr.astype(np.uint8) + code = {"float32": "f32", "float64": "f64", "int64": "i64", + "int32": "i64", "uint8": "u8"}[arr.dtype.name] + flat = arr.flatten() + if code in ("f32", "f64"): + vals = " ".join(repr(float(v)) for v in flat) + else: + vals = " ".join(str(int(v)) for v in flat) + f.write(f"{key} {code} {arr.size}\n{vals}\n") + + with open(path, "w") as f: + for k, (name, arr) in enumerate(feeds.items()): + entry(f, f"input{k}", np.asarray(arr)) + for k, arr in enumerate(outputs): + entry(f, f"output{k}", arr) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("models", nargs="*", metavar="MODEL", + help="models to generate (default: all)") + parser.add_argument("--outdir", default=".", help="output directory") + parser.add_argument("--list", action="store_true", dest="list_models", + help="only print the available model names") + parser.add_argument("--no-references", action="store_true", + help="only generate the models, without the reference data files") + args = parser.parse_args() + + if args.list_models: + print("\n".join(MODELS)) + return 0 + + if onnx is None: + print("error: the onnx python package is required to generate the models", file=sys.stderr) + return 1 + + names = args.models or list(MODELS) + unknown = [n for n in names if n not in MODELS] + if unknown: + print(f"error: unknown model(s): {', '.join(unknown)}", file=sys.stderr) + return 1 + + os.makedirs(args.outdir, exist_ok=True) + ref_dir = os.path.join(args.outdir, "references") + if not args.no_references: + os.makedirs(ref_dir, exist_ok=True) + n_refs = 0 + for name in names: + onnx.save(MODELS[name](), os.path.join(args.outdir, name + ".onnx")) + if name in TEST_INPUTS and not args.no_references: + feeds, outputs = compute_reference(name) + _write_reference_file(os.path.join(ref_dir, name + ".ref"), feeds, outputs) + n_refs += 1 + print(f"generated {len(names)} models and {n_refs} reference files in {args.outdir}") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tmva/sofie/test/input_models/Abs.onnx b/tmva/sofie/test/input_models/Abs.onnx deleted file mode 100644 index ffaa3dad62eee..0000000000000 --- a/tmva/sofie/test/input_models/Abs.onnx +++ /dev/null @@ -1,12 +0,0 @@ - - onnx-example:N - -inputoutput"AbsAbsZ -input -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Add.onnx b/tmva/sofie/test/input_models/Add.onnx deleted file mode 100644 index c1773f247ae7e..0000000000000 --- a/tmva/sofie/test/input_models/Add.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch1.11.0:� -) - onnx::Add_0 - onnx::Add_12Add_0"Addtorch-jit-exportZ - onnx::Add_0 - - -Z - onnx::Add_1 - - -b -2 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AddBroadcast1.onnx b/tmva/sofie/test/input_models/AddBroadcast1.onnx deleted file mode 100644 index 330479fd8eb49..0000000000000 --- a/tmva/sofie/test/input_models/AddBroadcast1.onnx +++ /dev/null @@ -1,16 +0,0 @@ -:P - -A -BY"AddAddZ -A - - -Z -B -  - -b -Y -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AddBroadcast2.onnx b/tmva/sofie/test/input_models/AddBroadcast2.onnx deleted file mode 100644 index 27f1eed0ff82d..0000000000000 --- a/tmva/sofie/test/input_models/AddBroadcast2.onnx +++ /dev/null @@ -1,20 +0,0 @@ -:` - -A -BY"AddAddZ -A - - -Z -B - - - - -b -Y - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AddBroadcast3.onnx b/tmva/sofie/test/input_models/AddBroadcast3.onnx deleted file mode 100644 index 27773525d2b1e..0000000000000 --- a/tmva/sofie/test/input_models/AddBroadcast3.onnx +++ /dev/null @@ -1,22 +0,0 @@ -:l - -A -BY"AddAddZ -A - - - - -Z -B - - - - -b -Y - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AddBroadcast4.onnx b/tmva/sofie/test/input_models/AddBroadcast4.onnx deleted file mode 100644 index 069a6aeabb5f0..0000000000000 --- a/tmva/sofie/test/input_models/AddBroadcast4.onnx +++ /dev/null @@ -1,16 +0,0 @@ -:T - -A -BY"AddAddZ -A -  - -Z -B -  - -b -Y -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AddBroadcast5.onnx b/tmva/sofie/test/input_models/AddBroadcast5.onnx deleted file mode 100644 index 38e89196f6c22..0000000000000 --- a/tmva/sofie/test/input_models/AddBroadcast5.onnx +++ /dev/null @@ -1,19 +0,0 @@ -:` - -A -BY"AddAddZ -A - - - -Z -B - - - -b -Y - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AddBroadcast6.onnx b/tmva/sofie/test/input_models/AddBroadcast6.onnx deleted file mode 100644 index 831eb4a66457f..0000000000000 --- a/tmva/sofie/test/input_models/AddBroadcast6.onnx +++ /dev/null @@ -1,25 +0,0 @@ -:x - -A -BY"AddAddZ -A - - - - - -Z -B - - - - - -b -Y - - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AddBroadcast7.onnx b/tmva/sofie/test/input_models/AddBroadcast7.onnx deleted file mode 100644 index 77f1d9fa1592e..0000000000000 --- a/tmva/sofie/test/input_models/AddBroadcast7.onnx +++ /dev/null @@ -1,22 +0,0 @@ -:l - -A -BY"AddAddZ -A - - - - -Z -B - - - - -b -Y - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/AvgPool.onnx b/tmva/sofie/test/input_models/AvgPool.onnx deleted file mode 100644 index bb0c140ce21b5..0000000000000 Binary files a/tmva/sofie/test/input_models/AvgPool.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Cast.onnx b/tmva/sofie/test/input_models/Cast.onnx deleted file mode 100644 index 7c175fc9d373a..0000000000000 --- a/tmva/sofie/test/input_models/Cast.onnx +++ /dev/null @@ -1,12 +0,0 @@ -pytorch1.11.0:s -* - onnx::Cast_01Cast_0"Cast* -to �torch-jit-exportZ - onnx::Cast_0 -  - -b -1 -   - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Clip.onnx b/tmva/sofie/test/input_models/Clip.onnx deleted file mode 100644 index da53b415f59af..0000000000000 Binary files a/tmva/sofie/test/input_models/Clip.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Comparison_broadcast.onnx b/tmva/sofie/test/input_models/Comparison_broadcast.onnx deleted file mode 100644 index 4c08d5715ee1a..0000000000000 --- a/tmva/sofie/test/input_models/Comparison_broadcast.onnx +++ /dev/null @@ -1,32 +0,0 @@ - comparison_broadcast_demo:� - -A -B -OutGreater"Greater - -A -BOutEqual"Equal - -A -BOutLess"LessComparisonOpsWithBroadcastZ -A -  - -Z -B - - -b - -OutGreater -   - -b -OutEqual -   - -b -OutLess -   - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Comparison_broadcast_3d.onnx b/tmva/sofie/test/input_models/Comparison_broadcast_3d.onnx deleted file mode 100644 index e75e4173a9cd1..0000000000000 --- a/tmva/sofie/test/input_models/Comparison_broadcast_3d.onnx +++ /dev/null @@ -1,36 +0,0 @@ - comparison_broadcast_demo:� - -A -B -OutGreater"Greater - -A -BOutEqual"Equal - -A -BOutLess"LessComparisonOpsBroadcastZ -A - - - -Z -B -  - -b - -OutGreater -  - - -b -OutEqual -  - - -b -OutLess -  - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/ComplexTopK.onnx b/tmva/sofie/test/input_models/ComplexTopK.onnx deleted file mode 100644 index 8912e9d7839c0..0000000000000 Binary files a/tmva/sofie/test/input_models/ComplexTopK.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Concat_0D.onnx b/tmva/sofie/test/input_models/Concat_0D.onnx deleted file mode 100644 index 95a41fe002dac..0000000000000 Binary files a/tmva/sofie/test/input_models/Concat_0D.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Constant.onnx b/tmva/sofie/test/input_models/Constant.onnx deleted file mode 100644 index 9436a2f13f91a..0000000000000 Binary files a/tmva/sofie/test/input_models/Constant.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvAddRelu.onnx b/tmva/sofie/test/input_models/ConvAddRelu.onnx deleted file mode 100644 index f4cffe37ff708..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvAddRelu.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvTranspose1d.onnx b/tmva/sofie/test/input_models/ConvTranspose1d.onnx deleted file mode 100644 index 56d5c239807ea..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvTranspose1d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvTranspose2d.onnx b/tmva/sofie/test/input_models/ConvTranspose2d.onnx deleted file mode 100644 index 312e5b24c091e..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvTranspose2d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvTransposeBias2d.onnx b/tmva/sofie/test/input_models/ConvTransposeBias2d.onnx deleted file mode 100644 index e1c5a8f513668..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvTransposeBias2d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvTransposeBias2dBatched.onnx b/tmva/sofie/test/input_models/ConvTransposeBias2dBatched.onnx deleted file mode 100644 index e9cc74409335f..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvTransposeBias2dBatched.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithAsymmetricPadding.onnx b/tmva/sofie/test/input_models/ConvWithAsymmetricPadding.onnx deleted file mode 100644 index da614cdb476f6..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithAsymmetricPadding.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithAutopadSameLower.onnx b/tmva/sofie/test/input_models/ConvWithAutopadSameLower.onnx deleted file mode 100644 index ba5343cc9b859..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithAutopadSameLower.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithAutopadSameUpper.onnx b/tmva/sofie/test/input_models/ConvWithAutopadSameUpper.onnx deleted file mode 100644 index 1dade4fb31d23..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithAutopadSameUpper.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithDilation.onnx b/tmva/sofie/test/input_models/ConvWithDilation.onnx deleted file mode 100644 index c49707afa5be0..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithDilation.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithDynShapeStride.onnx b/tmva/sofie/test/input_models/ConvWithDynShapeStride.onnx deleted file mode 100644 index 69864d933ef01..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithDynShapeStride.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithPadding.onnx b/tmva/sofie/test/input_models/ConvWithPadding.onnx deleted file mode 100644 index 351c856f0d2c3..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithPadding.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithStridesNoPadding.onnx b/tmva/sofie/test/input_models/ConvWithStridesNoPadding.onnx deleted file mode 100644 index bede9ea95dd87..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithStridesNoPadding.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithStridesPadding.onnx b/tmva/sofie/test/input_models/ConvWithStridesPadding.onnx deleted file mode 100644 index ee79d59845dd0..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithStridesPadding.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ConvWithoutPadding.onnx b/tmva/sofie/test/input_models/ConvWithoutPadding.onnx deleted file mode 100644 index fe00fa8fe8f9e..0000000000000 Binary files a/tmva/sofie/test/input_models/ConvWithoutPadding.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Cos.onnx b/tmva/sofie/test/input_models/Cos.onnx deleted file mode 100644 index 31877b49bba14..0000000000000 --- a/tmva/sofie/test/input_models/Cos.onnx +++ /dev/null @@ -1,12 +0,0 @@ - - cos_example:S - -inputoutput"CosCosGraphZ -input -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Div.onnx b/tmva/sofie/test/input_models/Div.onnx deleted file mode 100644 index c76721b368f48..0000000000000 --- a/tmva/sofie/test/input_models/Div.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch1.11.0:� -) - onnx::Div_0 - onnx::Div_12Div_0"Divtorch-jit-exportZ - onnx::Div_0 - - -Z - onnx::Div_1 - - -b -2 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Einsum_3.onnx b/tmva/sofie/test/input_models/Einsum_3.onnx deleted file mode 100644 index e8212d60107bc..0000000000000 --- a/tmva/sofie/test/input_models/Einsum_3.onnx +++ /dev/null @@ -1,20 +0,0 @@ - - onnx-example:� -< -inputA -inputBoutput"Einsum* -equation" abc,abd->ad� EinsumGraphZ -inputA - - - -Z -inputB - - - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Einsum_4.onnx b/tmva/sofie/test/input_models/Einsum_4.onnx deleted file mode 100644 index b03ee64ec6daa..0000000000000 --- a/tmva/sofie/test/input_models/Einsum_4.onnx +++ /dev/null @@ -1,24 +0,0 @@ - - onnx-example:� -@ -inputA -inputBoutput"Einsum* -equation"abcd,abed->abce� EinsumGraphZ -inputA - - - - -Z -inputB - - - - -b -output - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Einsum_dotprod.onnx b/tmva/sofie/test/input_models/Einsum_dotprod.onnx deleted file mode 100644 index ea5ee8f9e0313..0000000000000 Binary files a/tmva/sofie/test/input_models/Einsum_dotprod.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Einsum_matmul.onnx b/tmva/sofie/test/input_models/Einsum_matmul.onnx deleted file mode 100644 index c2bd6b284a56c..0000000000000 --- a/tmva/sofie/test/input_models/Einsum_matmul.onnx +++ /dev/null @@ -1,18 +0,0 @@ - - onnx-example:� -: -inputA -inputBoutput"Einsum* -equation" ik,kj->ij� EinsumGraphZ -inputA -  - -Z -inputB -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Elu.onnx b/tmva/sofie/test/input_models/Elu.onnx deleted file mode 100644 index f010190ff3b44..0000000000000 Binary files a/tmva/sofie/test/input_models/Elu.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/EluAlpha.onnx b/tmva/sofie/test/input_models/EluAlpha.onnx deleted file mode 100644 index 7ae34fe27e3a0..0000000000000 Binary files a/tmva/sofie/test/input_models/EluAlpha.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Equal.onnx b/tmva/sofie/test/input_models/Equal.onnx deleted file mode 100644 index 15326603aa4a7..0000000000000 --- a/tmva/sofie/test/input_models/Equal.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch1.13.1:� -0 - onnx::Equal_0 - onnx::Equal_12/Equal"Equal torch_jitZ - onnx::Equal_0 - - -Z - onnx::Equal_1 - - -b -2 - -  -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Erf.onnx b/tmva/sofie/test/input_models/Erf.onnx deleted file mode 100644 index e0de14544c370..0000000000000 --- a/tmva/sofie/test/input_models/Erf.onnx +++ /dev/null @@ -1,11 +0,0 @@ -pytorch1.13.1:T - - onnx::Erf_01/Erf"Erf torch_jitZ - onnx::Erf_0 - - - b -1 - - - B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Exp.onnx b/tmva/sofie/test/input_models/Exp.onnx deleted file mode 100644 index 57eb841f912a5..0000000000000 --- a/tmva/sofie/test/input_models/Exp.onnx +++ /dev/null @@ -1,13 +0,0 @@ -:4 - -XY"ExpExpZ -X - - - -b -Y - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/ExpandDiffSize.onnx b/tmva/sofie/test/input_models/ExpandDiffSize.onnx deleted file mode 100644 index 3be23991b7cc4..0000000000000 Binary files a/tmva/sofie/test/input_models/ExpandDiffSize.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ExpandSameSize.onnx b/tmva/sofie/test/input_models/ExpandSameSize.onnx deleted file mode 100644 index 2eea13e384f8c..0000000000000 Binary files a/tmva/sofie/test/input_models/ExpandSameSize.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/EyeLike.onnx b/tmva/sofie/test/input_models/EyeLike.onnx deleted file mode 100644 index afdf6d6e1503d..0000000000000 --- a/tmva/sofie/test/input_models/EyeLike.onnx +++ /dev/null @@ -1,11 +0,0 @@ -  EyeLikeModel:J - -xy"EyeLike eyelike_modelZ -x -  - -b -y -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/FMod_ConstantFolding.onnx b/tmva/sofie/test/input_models/FMod_ConstantFolding.onnx deleted file mode 100644 index 5f2d78a90bf00..0000000000000 Binary files a/tmva/sofie/test/input_models/FMod_ConstantFolding.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GRUBatchwise.onnx b/tmva/sofie/test/input_models/GRUBatchwise.onnx deleted file mode 100644 index 57a5ad83d7e7a..0000000000000 Binary files a/tmva/sofie/test/input_models/GRUBatchwise.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GRUBidirectional.onnx b/tmva/sofie/test/input_models/GRUBidirectional.onnx deleted file mode 100644 index 844e4b574d462..0000000000000 Binary files a/tmva/sofie/test/input_models/GRUBidirectional.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GRUDefaults.onnx b/tmva/sofie/test/input_models/GRUDefaults.onnx deleted file mode 100644 index bc4c80676bdc7..0000000000000 Binary files a/tmva/sofie/test/input_models/GRUDefaults.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GRUInitialBias.onnx b/tmva/sofie/test/input_models/GRUInitialBias.onnx deleted file mode 100644 index b0cd2c12410a6..0000000000000 Binary files a/tmva/sofie/test/input_models/GRUInitialBias.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GRUSeqLength.onnx b/tmva/sofie/test/input_models/GRUSeqLength.onnx deleted file mode 100644 index 8fb191cc84750..0000000000000 Binary files a/tmva/sofie/test/input_models/GRUSeqLength.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Gather2d.onnx b/tmva/sofie/test/input_models/Gather2d.onnx deleted file mode 100644 index 3abcafc97e2d6..0000000000000 Binary files a/tmva/sofie/test/input_models/Gather2d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GatherAxis0.onnx b/tmva/sofie/test/input_models/GatherAxis0.onnx deleted file mode 100644 index 82612bc892336..0000000000000 Binary files a/tmva/sofie/test/input_models/GatherAxis0.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GatherAxis1.onnx b/tmva/sofie/test/input_models/GatherAxis1.onnx deleted file mode 100644 index c92abebccbc00..0000000000000 Binary files a/tmva/sofie/test/input_models/GatherAxis1.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/GatherAxis2.onnx b/tmva/sofie/test/input_models/GatherAxis2.onnx deleted file mode 100644 index e34778ec86da3..0000000000000 --- a/tmva/sofie/test/input_models/GatherAxis2.onnx +++ /dev/null @@ -1,21 +0,0 @@ -:� - -X -IY"Gather* -axis�Gather* :BIZ -X - - - - -Z -I - - -b -Y - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/GatherAxis3.onnx b/tmva/sofie/test/input_models/GatherAxis3.onnx deleted file mode 100644 index be36f82c92ed6..0000000000000 --- a/tmva/sofie/test/input_models/GatherAxis3.onnx +++ /dev/null @@ -1,22 +0,0 @@ -: - -X -IY"Gather* -axis�Gather* -:BIZ -X - - - - -Z -I - - -b -Y - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/GatherND_1.onnx b/tmva/sofie/test/input_models/GatherND_1.onnx deleted file mode 100644 index a8cd7ecbb1c5d..0000000000000 --- a/tmva/sofie/test/input_models/GatherND_1.onnx +++ /dev/null @@ -1,18 +0,0 @@ - - onnx-example:{ -! -data -indicesoutput"GatherND TestGraphZ -data - - - -Z -indices -  - -b -output - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/GatherND_2.onnx b/tmva/sofie/test/input_models/GatherND_2.onnx deleted file mode 100644 index 5717c8554238e..0000000000000 --- a/tmva/sofie/test/input_models/GatherND_2.onnx +++ /dev/null @@ -1,18 +0,0 @@ - - onnx-example: -! -data -indicesoutput"GatherND TestGraphZ -data - - - -Z -indices -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/GatherND_3.onnx b/tmva/sofie/test/input_models/GatherND_3.onnx deleted file mode 100644 index 43d9098621646..0000000000000 --- a/tmva/sofie/test/input_models/GatherND_3.onnx +++ /dev/null @@ -1,24 +0,0 @@ - - onnx-example:� -4 -data -indicesoutput"GatherND* - -batch_dims� TestGraphZ -data - - - - -Z -indices - - - -b -output - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/GatherNegativeIndices.onnx b/tmva/sofie/test/input_models/GatherNegativeIndices.onnx deleted file mode 100644 index 6c6723a9998d8..0000000000000 Binary files a/tmva/sofie/test/input_models/GatherNegativeIndices.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Gelu.onnx b/tmva/sofie/test/input_models/Gelu.onnx deleted file mode 100644 index b5cd46b4b5178..0000000000000 Binary files a/tmva/sofie/test/input_models/Gelu.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Greater.onnx b/tmva/sofie/test/input_models/Greater.onnx deleted file mode 100644 index 7ef3fa85cba16..0000000000000 --- a/tmva/sofie/test/input_models/Greater.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch2.0.1:� -8 -onnx::Greater_0 -onnx::Greater_12/Greater"Greater torch_jitZ -onnx::Greater_0 - - -Z -onnx::Greater_1 - - -b -2 - -  -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/GreaterOrEqual.onnx b/tmva/sofie/test/input_models/GreaterOrEqual.onnx deleted file mode 100644 index d688ad70a5e39..0000000000000 --- a/tmva/sofie/test/input_models/GreaterOrEqual.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch2.0.1:� -T -onnx::GreaterOrEqual_0 -onnx::GreaterOrEqual_12/GreaterOrEqual"GreaterOrEqual torch_jitZ$ -onnx::GreaterOrEqual_0 - - -Z$ -onnx::GreaterOrEqual_1 - - -b -2 - -  -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/HardSigmoid.onnx b/tmva/sofie/test/input_models/HardSigmoid.onnx deleted file mode 100644 index df4952c4992b9..0000000000000 Binary files a/tmva/sofie/test/input_models/HardSigmoid.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/HardSwish.onnx b/tmva/sofie/test/input_models/HardSwish.onnx deleted file mode 100644 index 579bff03f2404..0000000000000 Binary files a/tmva/sofie/test/input_models/HardSwish.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/IsInf.onnx b/tmva/sofie/test/input_models/IsInf.onnx deleted file mode 100644 index 87c836fbdaff6..0000000000000 --- a/tmva/sofie/test/input_models/IsInf.onnx +++ /dev/null @@ -1,11 +0,0 @@ -  onnx-example:S - -inputoutput"IsInfTestZ -input -  - -Nb -output -   - -NB \ No newline at end of file diff --git a/tmva/sofie/test/input_models/LSTMBatchwise.onnx b/tmva/sofie/test/input_models/LSTMBatchwise.onnx deleted file mode 100644 index 49e1ec1001788..0000000000000 Binary files a/tmva/sofie/test/input_models/LSTMBatchwise.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/LSTMBidirectional.onnx b/tmva/sofie/test/input_models/LSTMBidirectional.onnx deleted file mode 100644 index 1cc4d68055333..0000000000000 Binary files a/tmva/sofie/test/input_models/LSTMBidirectional.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/LSTMDefaults.onnx b/tmva/sofie/test/input_models/LSTMDefaults.onnx deleted file mode 100644 index f5c15dce7ce53..0000000000000 Binary files a/tmva/sofie/test/input_models/LSTMDefaults.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/LSTMInitialBias.onnx b/tmva/sofie/test/input_models/LSTMInitialBias.onnx deleted file mode 100644 index 45f0caea13a25..0000000000000 Binary files a/tmva/sofie/test/input_models/LSTMInitialBias.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/LSTMPeepholes.onnx b/tmva/sofie/test/input_models/LSTMPeepholes.onnx deleted file mode 100644 index 155471d49c015..0000000000000 Binary files a/tmva/sofie/test/input_models/LSTMPeepholes.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/LayerNormalization2d.onnx b/tmva/sofie/test/input_models/LayerNormalization2d.onnx deleted file mode 100644 index c3693c7a896a6..0000000000000 Binary files a/tmva/sofie/test/input_models/LayerNormalization2d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/LayerNormalization4d.onnx b/tmva/sofie/test/input_models/LayerNormalization4d.onnx deleted file mode 100644 index a6b5dea2abb74..0000000000000 --- a/tmva/sofie/test/input_models/LayerNormalization4d.onnx +++ /dev/null @@ -1,26 +0,0 @@ -:� -1 -X -Scale -BY"LayerNormalization* -axis�LayerNormalization*_"P���=���=���=���=���=���=���=���=���=���=���=���=���=���=���=���=���=���=���=���=BScale*["P��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>��L>BBZ -X - - - - -Z -Scale -  - -Z -B -  - -b -Y - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Less.onnx b/tmva/sofie/test/input_models/Less.onnx deleted file mode 100644 index a1c5698caacdb..0000000000000 --- a/tmva/sofie/test/input_models/Less.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch2.0.1:� -, - onnx::Less_0 - onnx::Less_12/Less"Less torch_jitZ - onnx::Less_0 - - -Z - onnx::Less_1 - - -b -2 - -  -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/LessOrEqual.onnx b/tmva/sofie/test/input_models/LessOrEqual.onnx deleted file mode 100644 index 443afed2d5586..0000000000000 --- a/tmva/sofie/test/input_models/LessOrEqual.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch2.0.1:� -H -onnx::LessOrEqual_0 -onnx::LessOrEqual_12 /LessOrEqual" LessOrEqual torch_jitZ! -onnx::LessOrEqual_0 - - -Z! -onnx::LessOrEqual_1 - - -b -2 - -  -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/LinearWithLeakyRelu.onnx b/tmva/sofie/test/input_models/LinearWithLeakyRelu.onnx deleted file mode 100644 index 7950ac7a36fc6..0000000000000 --- a/tmva/sofie/test/input_models/LinearWithLeakyRelu.onnx +++ /dev/null @@ -1,12 +0,0 @@ -pytorch1.11.0:m -3 -input1 LeakyRelu_0" LeakyRelu* -alpha���=�torch-jit-exportZ -input - - -b -1 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/LinearWithSelu.onnx b/tmva/sofie/test/input_models/LinearWithSelu.onnx deleted file mode 100644 index a55f84e646fec..0000000000000 Binary files a/tmva/sofie/test/input_models/LinearWithSelu.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/LinearWithSigmoid.onnx b/tmva/sofie/test/input_models/LinearWithSigmoid.onnx deleted file mode 100644 index ee4868ee05fea..0000000000000 Binary files a/tmva/sofie/test/input_models/LinearWithSigmoid.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Linear_16.onnx b/tmva/sofie/test/input_models/Linear_16.onnx deleted file mode 100644 index 8e65190bba494..0000000000000 Binary files a/tmva/sofie/test/input_models/Linear_16.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Linear_32.onnx b/tmva/sofie/test/input_models/Linear_32.onnx deleted file mode 100644 index 9c9f7d84e624d..0000000000000 Binary files a/tmva/sofie/test/input_models/Linear_32.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Linear_64.onnx b/tmva/sofie/test/input_models/Linear_64.onnx deleted file mode 100644 index 6ded5837b9c80..0000000000000 Binary files a/tmva/sofie/test/input_models/Linear_64.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Log.onnx b/tmva/sofie/test/input_models/Log.onnx deleted file mode 100644 index a1bfce7ba847b..0000000000000 --- a/tmva/sofie/test/input_models/Log.onnx +++ /dev/null @@ -1,11 +0,0 @@ -pytorch1.13.1:T - - onnx::Log_01/Log"Log torch_jitZ - onnx::Log_0 - - -b -1 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/MatMul_Stacked.onnx b/tmva/sofie/test/input_models/MatMul_Stacked.onnx deleted file mode 100644 index 19c39ee2adddd..0000000000000 --- a/tmva/sofie/test/input_models/MatMul_Stacked.onnx +++ /dev/null @@ -1,19 +0,0 @@ - - onnx-example:� - -input1 -input2output"MatMulAddGraphZ -input1 - -N - -Z -input2 -  - -b -output - -N - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/MatMul_Stacked2.onnx b/tmva/sofie/test/input_models/MatMul_Stacked2.onnx deleted file mode 100644 index 6c86f5849d1a0..0000000000000 --- a/tmva/sofie/test/input_models/MatMul_Stacked2.onnx +++ /dev/null @@ -1,19 +0,0 @@ -  onnx-example:� - -input1 -input2output"MatMulAddGraphZ -input1 - -N - -Z -input2 - -N - -b -output - -N - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Max.onnx b/tmva/sofie/test/input_models/Max.onnx deleted file mode 100644 index 70943526f6ccd..0000000000000 --- a/tmva/sofie/test/input_models/Max.onnx +++ /dev/null @@ -1,17 +0,0 @@ - onnx-example:d - -X1 -X2YMax"Max -test-modelZ -X1 -  - -Z -X2 -  - -b -Y -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/MaxMultidirectionalBroadcast.onnx b/tmva/sofie/test/input_models/MaxMultidirectionalBroadcast.onnx deleted file mode 100644 index dd802b29237fa..0000000000000 Binary files a/tmva/sofie/test/input_models/MaxMultidirectionalBroadcast.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/MaxPool1d.onnx b/tmva/sofie/test/input_models/MaxPool1d.onnx deleted file mode 100644 index 1fa4e59401cb6..0000000000000 Binary files a/tmva/sofie/test/input_models/MaxPool1d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/MaxPool2d.onnx b/tmva/sofie/test/input_models/MaxPool2d.onnx deleted file mode 100644 index 6427d59ce6e9d..0000000000000 Binary files a/tmva/sofie/test/input_models/MaxPool2d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/MaxPool2d_AsymPad.onnx b/tmva/sofie/test/input_models/MaxPool2d_AsymPad.onnx deleted file mode 100644 index bacb19d2886a1..0000000000000 Binary files a/tmva/sofie/test/input_models/MaxPool2d_AsymPad.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/MaxPool2d_CeilMode.onnx b/tmva/sofie/test/input_models/MaxPool2d_CeilMode.onnx deleted file mode 100644 index 4e0c8aeea0887..0000000000000 Binary files a/tmva/sofie/test/input_models/MaxPool2d_CeilMode.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/MaxPool3d.onnx b/tmva/sofie/test/input_models/MaxPool3d.onnx deleted file mode 100644 index e88616c9d94e9..0000000000000 Binary files a/tmva/sofie/test/input_models/MaxPool3d.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/MeanMultidirectionalBroadcast.onnx b/tmva/sofie/test/input_models/MeanMultidirectionalBroadcast.onnx deleted file mode 100644 index 656211ad55a36..0000000000000 Binary files a/tmva/sofie/test/input_models/MeanMultidirectionalBroadcast.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/MinMultidirectionalBroadcast.onnx b/tmva/sofie/test/input_models/MinMultidirectionalBroadcast.onnx deleted file mode 100644 index d3996372e355e..0000000000000 Binary files a/tmva/sofie/test/input_models/MinMultidirectionalBroadcast.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Mod_ConstantFolding.onnx b/tmva/sofie/test/input_models/Mod_ConstantFolding.onnx deleted file mode 100644 index 193273b63126b..0000000000000 Binary files a/tmva/sofie/test/input_models/Mod_ConstantFolding.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Mul.onnx b/tmva/sofie/test/input_models/Mul.onnx deleted file mode 100644 index 2f68a047d5762..0000000000000 --- a/tmva/sofie/test/input_models/Mul.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch1.11.0:� -) - onnx::Mul_0 - onnx::Mul_12Mul_0"Multorch-jit-exportZ - onnx::Mul_0 - - -Z - onnx::Mul_1 - - -b -2 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Neg.onnx b/tmva/sofie/test/input_models/Neg.onnx deleted file mode 100644 index 4359bfb97a88f..0000000000000 --- a/tmva/sofie/test/input_models/Neg.onnx +++ /dev/null @@ -1,11 +0,0 @@ -pytorch1.11.0:\ - - onnx::Neg_01Neg_0"Negtorch-jit-exportZ - onnx::Neg_0 - - - b -1 - - - B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/NonZero.onnx b/tmva/sofie/test/input_models/NonZero.onnx deleted file mode 100644 index 78af0007bb981..0000000000000 --- a/tmva/sofie/test/input_models/NonZero.onnx +++ /dev/null @@ -1,12 +0,0 @@ -  onnx-example:[ - -dataoutput"NonZero TestGraphZ -data - - - -b -output -  - -NB \ No newline at end of file diff --git a/tmva/sofie/test/input_models/NonZero_Constant.onnx b/tmva/sofie/test/input_models/NonZero_Constant.onnx deleted file mode 100644 index 5fe117b8f4d63..0000000000000 Binary files a/tmva/sofie/test/input_models/NonZero_Constant.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/NotIsNaN.onnx b/tmva/sofie/test/input_models/NotIsNaN.onnx deleted file mode 100644 index 1f0fb2596ecf1..0000000000000 --- a/tmva/sofie/test/input_models/NotIsNaN.onnx +++ /dev/null @@ -1,13 +0,0 @@ -  onnx-example:t - -input temp_result"IsNaN - - temp_resultoutput"NotTestZ -input -  - -Nb -output -   - -NB \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Pad.onnx b/tmva/sofie/test/input_models/Pad.onnx deleted file mode 100644 index 3e2c0d8af8b0c..0000000000000 Binary files a/tmva/sofie/test/input_models/Pad.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Pow.onnx b/tmva/sofie/test/input_models/Pow.onnx deleted file mode 100644 index a4f274b1fba72..0000000000000 --- a/tmva/sofie/test/input_models/Pow.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch1.11.0:� -) - onnx::Pow_0 - onnx::Pow_12Pow_0"Powtorch-jit-exportZ - onnx::Pow_0 - - -Z - onnx::Pow_1 - - -b -2 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Pow_broadcast.onnx b/tmva/sofie/test/input_models/Pow_broadcast.onnx deleted file mode 100644 index 83c2430567a70..0000000000000 --- a/tmva/sofie/test/input_models/Pow_broadcast.onnx +++ /dev/null @@ -1,18 +0,0 @@ -pytorch1.11.0:� -) - onnx::Pow_0 - onnx::Pow_12Pow_0"Powtorch-jit-exportZ! - onnx::Pow_0 - - - -Z - onnx::Pow_1 -  - -b -2 - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/RNNBatchwise.onnx b/tmva/sofie/test/input_models/RNNBatchwise.onnx deleted file mode 100644 index fa91478e62747..0000000000000 Binary files a/tmva/sofie/test/input_models/RNNBatchwise.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RNNBidirectional.onnx b/tmva/sofie/test/input_models/RNNBidirectional.onnx deleted file mode 100644 index 48f2f0a7a002a..0000000000000 Binary files a/tmva/sofie/test/input_models/RNNBidirectional.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RNNBidirectionalBatchwise.onnx b/tmva/sofie/test/input_models/RNNBidirectionalBatchwise.onnx deleted file mode 100644 index 30feb2512d6d3..0000000000000 Binary files a/tmva/sofie/test/input_models/RNNBidirectionalBatchwise.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RNNDefaults.onnx b/tmva/sofie/test/input_models/RNNDefaults.onnx deleted file mode 100644 index c829c14c8282a..0000000000000 Binary files a/tmva/sofie/test/input_models/RNNDefaults.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RNNSeqLength.onnx b/tmva/sofie/test/input_models/RNNSeqLength.onnx deleted file mode 100644 index 84ea9ddd19074..0000000000000 Binary files a/tmva/sofie/test/input_models/RNNSeqLength.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RNNSequence.onnx b/tmva/sofie/test/input_models/RNNSequence.onnx deleted file mode 100644 index 6a0ff84e84f58..0000000000000 Binary files a/tmva/sofie/test/input_models/RNNSequence.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RNNSequenceBatchwise.onnx b/tmva/sofie/test/input_models/RNNSequenceBatchwise.onnx deleted file mode 100644 index f29d3e71d3d71..0000000000000 Binary files a/tmva/sofie/test/input_models/RNNSequenceBatchwise.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RandomNormal.onnx b/tmva/sofie/test/input_models/RandomNormal.onnx deleted file mode 100644 index 7d5b251413a75..0000000000000 Binary files a/tmva/sofie/test/input_models/RandomNormal.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RandomUniform.onnx b/tmva/sofie/test/input_models/RandomUniform.onnx deleted file mode 100644 index 46e1e4f5ed9cb..0000000000000 Binary files a/tmva/sofie/test/input_models/RandomUniform.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/RangeFloat.onnx b/tmva/sofie/test/input_models/RangeFloat.onnx deleted file mode 100644 index 1b0abbe476320..0000000000000 --- a/tmva/sofie/test/input_models/RangeFloat.onnx +++ /dev/null @@ -1,20 +0,0 @@ - :� - -start -limit -deltaY"RangeRangeZ -start - - -Z -limit - - -Z -delta - - -b -Y - -  output_sizeB \ No newline at end of file diff --git a/tmva/sofie/test/input_models/RangeInt.onnx b/tmva/sofie/test/input_models/RangeInt.onnx deleted file mode 100644 index 47d257d66289b..0000000000000 --- a/tmva/sofie/test/input_models/RangeInt.onnx +++ /dev/null @@ -1,20 +0,0 @@ - :� - -start -limit -deltaY"RangeRangeZ -start - - -Z -limit - - -Z -delta - - -b -Y - -  output_sizeB \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Reciprocal.onnx b/tmva/sofie/test/input_models/Reciprocal.onnx deleted file mode 100644 index 5a9504a760eec..0000000000000 --- a/tmva/sofie/test/input_models/Reciprocal.onnx +++ /dev/null @@ -1,13 +0,0 @@ -:J - -XY" -Reciprocal -ReciprocalZ -X -  - -b -Y -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/ReduceMean.onnx b/tmva/sofie/test/input_models/ReduceMean.onnx deleted file mode 100644 index 48b62512bfc58..0000000000000 Binary files a/tmva/sofie/test/input_models/ReduceMean.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ReduceMean_kFirst.onnx b/tmva/sofie/test/input_models/ReduceMean_kFirst.onnx deleted file mode 100644 index 7d5e7bad145f6..0000000000000 Binary files a/tmva/sofie/test/input_models/ReduceMean_kFirst.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ReduceProd.onnx b/tmva/sofie/test/input_models/ReduceProd.onnx deleted file mode 100644 index 2c14e43638450..0000000000000 Binary files a/tmva/sofie/test/input_models/ReduceProd.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ReduceSum.onnx b/tmva/sofie/test/input_models/ReduceSum.onnx deleted file mode 100644 index c5ded0381b03e..0000000000000 Binary files a/tmva/sofie/test/input_models/ReduceSum.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ReduceSumSquare.onnx b/tmva/sofie/test/input_models/ReduceSumSquare.onnx deleted file mode 100644 index 40ef9494f06c8..0000000000000 Binary files a/tmva/sofie/test/input_models/ReduceSumSquare.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/ScatterElements.onnx b/tmva/sofie/test/input_models/ScatterElements.onnx deleted file mode 100644 index 56b0ed62141cf..0000000000000 --- a/tmva/sofie/test/input_models/ScatterElements.onnx +++ /dev/null @@ -1,22 +0,0 @@ - - onnx-example:� -1 -data -indices -updatesoutput"ScatterElements TestGraphZ -data -  - -Z -indices -  - -Z -updates -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/ScatterND_1.onnx b/tmva/sofie/test/input_models/ScatterND_1.onnx deleted file mode 100644 index 6e6bd2b58c0f7..0000000000000 --- a/tmva/sofie/test/input_models/ScatterND_1.onnx +++ /dev/null @@ -1,21 +0,0 @@ -  onnx-example:� -+ -data -indices -updatesoutput" ScatterND TestGraphZ -data - - -Z -indices -  - -Z -updates - - -b -output - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/ScatterND_2.onnx b/tmva/sofie/test/input_models/ScatterND_2.onnx deleted file mode 100644 index 9211d555dffda..0000000000000 --- a/tmva/sofie/test/input_models/ScatterND_2.onnx +++ /dev/null @@ -1,22 +0,0 @@ -  onnx-example:� -@ -data -indices -updatesoutput" ScatterND* - reduction"add� TestGraphZ -data -  - -Z -indices -  - -Z -updates -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/ScatterND_3.onnx b/tmva/sofie/test/input_models/ScatterND_3.onnx deleted file mode 100644 index 20d83a7dd1715..0000000000000 --- a/tmva/sofie/test/input_models/ScatterND_3.onnx +++ /dev/null @@ -1,22 +0,0 @@ -  onnx-example:� -@ -data -indices -updatesoutput" ScatterND* - reduction"mul� TestGraphZ -data -  - -Z -indices -  - -Z -updates - - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Shape.onnx b/tmva/sofie/test/input_models/Shape.onnx deleted file mode 100644 index 3fc0042a4b2d3..0000000000000 Binary files a/tmva/sofie/test/input_models/Shape.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Sin.onnx b/tmva/sofie/test/input_models/Sin.onnx deleted file mode 100644 index dedfc39623d0a..0000000000000 --- a/tmva/sofie/test/input_models/Sin.onnx +++ /dev/null @@ -1,12 +0,0 @@ - - onnx-example:S - -inputoutput"Sinsin_testZ -input -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Slice.onnx b/tmva/sofie/test/input_models/Slice.onnx deleted file mode 100644 index 73d22ad40ba9b..0000000000000 Binary files a/tmva/sofie/test/input_models/Slice.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Slice_Default_Axis.onnx b/tmva/sofie/test/input_models/Slice_Default_Axis.onnx deleted file mode 100644 index d159e75eb4561..0000000000000 Binary files a/tmva/sofie/test/input_models/Slice_Default_Axis.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Slice_Default_Steps.onnx b/tmva/sofie/test/input_models/Slice_Default_Steps.onnx deleted file mode 100644 index 31a71b91236e1..0000000000000 Binary files a/tmva/sofie/test/input_models/Slice_Default_Steps.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Slice_Neg.onnx b/tmva/sofie/test/input_models/Slice_Neg.onnx deleted file mode 100644 index d4bd677deaa1e..0000000000000 Binary files a/tmva/sofie/test/input_models/Slice_Neg.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Softmax1d.onnx b/tmva/sofie/test/input_models/Softmax1d.onnx deleted file mode 100644 index ff7dcf6cfc2bd..0000000000000 --- a/tmva/sofie/test/input_models/Softmax1d.onnx +++ /dev/null @@ -1,11 +0,0 @@ -:< - -XY"SoftmaxSoftmaxZ -X - - -b -Y - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Softmax2d.onnx b/tmva/sofie/test/input_models/Softmax2d.onnx deleted file mode 100644 index f466f7c3d01a0..0000000000000 --- a/tmva/sofie/test/input_models/Softmax2d.onnx +++ /dev/null @@ -1,12 +0,0 @@ -:Q - -XY"Softmax* -axis�SoftmaxZ -X -  - -b -Y -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Softmax3d.onnx b/tmva/sofie/test/input_models/Softmax3d.onnx deleted file mode 100644 index d475b359e578a..0000000000000 --- a/tmva/sofie/test/input_models/Softmax3d.onnx +++ /dev/null @@ -1,14 +0,0 @@ -:Y - -XY"Softmax* -axis�SoftmaxZ -X - - - -b -Y - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Softmax4d.onnx b/tmva/sofie/test/input_models/Softmax4d.onnx deleted file mode 100644 index be0046da23ce5..0000000000000 --- a/tmva/sofie/test/input_models/Softmax4d.onnx +++ /dev/null @@ -1,16 +0,0 @@ -:j -% -XY"Softmax* -axis����������SoftmaxZ -X - - - - -b -Y - - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Softplus.onnx b/tmva/sofie/test/input_models/Softplus.onnx deleted file mode 100644 index 2f6a69fa1b29c..0000000000000 --- a/tmva/sofie/test/input_models/Softplus.onnx +++ /dev/null @@ -1,11 +0,0 @@ -  onnx-example:S - -inputoutput"SoftplusAbsZ -input -  - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Split_0.onnx b/tmva/sofie/test/input_models/Split_0.onnx deleted file mode 100644 index 24158dca0681a..0000000000000 --- a/tmva/sofie/test/input_models/Split_0.onnx +++ /dev/null @@ -1,23 +0,0 @@ - - onnx-example:� -5 split_values"Constant* -value*:Bsplit� -. -input - split_valuesoutput1output2"Split -SplitGraphZ -input - - - -b -output1 - - - -b -output2 - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Split_1.onnx b/tmva/sofie/test/input_models/Split_1.onnx deleted file mode 100644 index 86cf6ec7c3648..0000000000000 --- a/tmva/sofie/test/input_models/Split_1.onnx +++ /dev/null @@ -1,24 +0,0 @@ - - onnx-example:� -5 split_values"Constant* -value*:Bsplit� -; -input - split_valuesoutput1output2"Split* -axis� -SplitGraphZ -input - - - -b -output1 - - - -b -output2 - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Split_2.onnx b/tmva/sofie/test/input_models/Split_2.onnx deleted file mode 100644 index 1392e794cb189..0000000000000 --- a/tmva/sofie/test/input_models/Split_2.onnx +++ /dev/null @@ -1,22 +0,0 @@ - - onnx-example:� -A -inputoutput1output2"Split* -axis�* - num_outputs� -SplitGraphZ -input - - - -b -output1 - - - -b -output2 - - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Sqrt.onnx b/tmva/sofie/test/input_models/Sqrt.onnx deleted file mode 100644 index 978f9ece00a38..0000000000000 --- a/tmva/sofie/test/input_models/Sqrt.onnx +++ /dev/null @@ -1,11 +0,0 @@ -:> - -XY"SqrtSqrtZ -X -  - -b -Y -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Sub.onnx b/tmva/sofie/test/input_models/Sub.onnx deleted file mode 100644 index 3b86b93723c14..0000000000000 --- a/tmva/sofie/test/input_models/Sub.onnx +++ /dev/null @@ -1,16 +0,0 @@ -pytorch1.11.0:� -) - onnx::Sub_0 - onnx::Sub_12Sub_0"Subtorch-jit-exportZ - onnx::Sub_0 - - -Z - onnx::Sub_1 - - -b -2 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/SumMultidirectionalBroadcast.onnx b/tmva/sofie/test/input_models/SumMultidirectionalBroadcast.onnx deleted file mode 100644 index 77383b8ecc8d2..0000000000000 Binary files a/tmva/sofie/test/input_models/SumMultidirectionalBroadcast.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Swish.onnx b/tmva/sofie/test/input_models/Swish.onnx deleted file mode 100644 index c2eff9dfdd845..0000000000000 Binary files a/tmva/sofie/test/input_models/Swish.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Tanh.onnx b/tmva/sofie/test/input_models/Tanh.onnx deleted file mode 100644 index d4ef42058a120..0000000000000 --- a/tmva/sofie/test/input_models/Tanh.onnx +++ /dev/null @@ -1,11 +0,0 @@ -pytorch1.11.0:` - - onnx::Tanh_01Tanh_0"Tanhtorch-jit-exportZ - onnx::Tanh_0 - - -b -1 - - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/Tile5D.onnx b/tmva/sofie/test/input_models/Tile5D.onnx deleted file mode 100644 index 0c60fbce1d67c..0000000000000 --- a/tmva/sofie/test/input_models/Tile5D.onnx +++ /dev/null @@ -1,20 +0,0 @@ - - -tile-model:� - -input -repeatsoutput"Tile TileGraph*:BrepeatsZ# -input - - - - - -b$ -output - - - - - - B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/TopK.onnx b/tmva/sofie/test/input_models/TopK.onnx deleted file mode 100644 index 1e6081e68ba3d..0000000000000 Binary files a/tmva/sofie/test/input_models/TopK.onnx and /dev/null differ diff --git a/tmva/sofie/test/input_models/Where.onnx b/tmva/sofie/test/input_models/Where.onnx deleted file mode 100644 index d28d7be7b69cf..0000000000000 --- a/tmva/sofie/test/input_models/Where.onnx +++ /dev/null @@ -1,22 +0,0 @@ - - onnx-example:� -% -cond -inputA -inputBoutput"WherePadGraphZ -inputA -  - -Z -inputB -  - -Z -cond -   - -b -output -  - -B \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Add.ref.hxx b/tmva/sofie/test/input_models/references/Add.ref.hxx deleted file mode 100644 index 9822c7a81c9a8..0000000000000 --- a/tmva/sofie/test/input_models/references/Add.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Add_ExpectedOutput{ - float outputs[] = { - 1, 3 - }; -} // namespace Add_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/AddBroadcast1.ref.hxx b/tmva/sofie/test/input_models/references/AddBroadcast1.ref.hxx deleted file mode 100644 index b035948b4724b..0000000000000 --- a/tmva/sofie/test/input_models/references/AddBroadcast1.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace AddBroadcast1_ExpectedOutput { -float output[] = {0.28243644, -0.90186608, -1.79006483, 1.33404634, -0.23906578, -0.52755691, -0.891546, - -2.69966178, -0.25129834, -0.58029126, -0.27572713, -1.7529471, -3.23957491, 0.31278987, - -1.22085115, -0.61096094, -0.27272514, -3.83117724, 1.42109105, -0.4369273}; - -} diff --git a/tmva/sofie/test/input_models/references/AddBroadcast2.ref.hxx b/tmva/sofie/test/input_models/references/AddBroadcast2.ref.hxx deleted file mode 100644 index 0b930f7317e17..0000000000000 --- a/tmva/sofie/test/input_models/references/AddBroadcast2.ref.hxx +++ /dev/null @@ -1,17 +0,0 @@ -namespace AddBroadcast2_ExpectedOutput { -float output[] = { - -0.62434934, -1.93797965, -1.19860246, -1.06511155, 1.24371772, 2.03601878, -0.2717692, 0.60354131, -2.92949971, - 1.61674874, -0.01563277, 2.53217091, -2.61976735, -2.04498089, -0.98186808, -0.9821527, -0.68573442, 0.06654399, - 0.55511936, 1.84190705, 0.06178405, -0.69705049, 0.20368234, -1.40002598, 3.56792334, -0.90808199, -0.02983521, - -0.67609102, 0.12400874, 3.1864861, 1.34647373, 0.95271283, -2.41613627, -2.66562568, 1.27763398, 0.38386889, - 0.33059223, -0.3659137, -1.44691861, 0.38253914, -1.41782462, -1.04797803, -2.60458769, -1.83332958, 1.13251076, - 1.06928815, 0.76531572, -2.53046179, -1.26037696, 2.01582423, 0.4020812, -1.44309226, 0.88439354, -0.54724872, - 1.23147575, 1.06415138, 0.45444148, 1.2363841, -1.60879658, 3.6454006, 3.17896063, -0.94837093, -0.64889415, - -0.58533829, -0.07523501, 0.9682052, 0.56358752, -1.05882916, -2.13722021, -0.0774219, -0.0198158, 0.07550752, - -0.79657023, -1.53195618, 1.2685064, -0.14395974, 0.5787669, -2.2651406, -1.4260528, 0.09023037, -0.97483613, - -0.23362897, -0.99049621, -0.4146936, 2.82285906, 0.51930055, 0.47476522, 1.77188205, -1.57681399, 1.65250932, - 1.10131347, -0.91866875, -1.10343416, -1.12725168, 1.1334368, 0.88473959, 1.69790773, 0.63149541, -2.55495247, - 0.2984743, 0.56038175, 2.02130076, -0.42005943, -1.84297087, 2.51663854, 1.46556267, 1.66197202, -1.64971946, - -3.06465319, 3.3830558, 1.0704284, 1.47489333, -1.20468849, -2.55063185, -0.09012151, 0.46485, 1.52819607, - 0.55005002, -2.43288973, -1.02169816}; -} diff --git a/tmva/sofie/test/input_models/references/AddBroadcast3.ref.hxx b/tmva/sofie/test/input_models/references/AddBroadcast3.ref.hxx deleted file mode 100644 index c37709fa70aff..0000000000000 --- a/tmva/sofie/test/input_models/references/AddBroadcast3.ref.hxx +++ /dev/null @@ -1,22 +0,0 @@ -namespace AddBroadcast3_ExpectedOutput { -float output[] = {-6.66747937e-01, 7.89730644e-01, -1.36747271e+00, 8.70816495e-01, -3.14613309e-01, 1.90351170e+00, - -2.44075053e-01, -2.22195199e+00, 4.67993413e-01, -4.84311768e-01, 2.61995613e+00, 2.24625281e+00, - -1.30918355e+00, 1.01367247e+00, -1.85939485e+00, 1.21566991e+00, -1.05034085e+00, -1.74468868e+00, - 3.17545559e+00, 2.11179770e-01, -2.27590204e-01, -1.95355380e+00, -1.00489901e+00, 1.33090871e+00, - -1.20375826e-01, 3.85602826e-01, -2.63256668e+00, -8.84417908e-01, 9.68622227e-01, 8.14418556e-01, - 2.30101776e+00, -1.79310571e+00, -2.24936438e+00, 2.60757107e+00, 3.80220173e-01, 1.32116333e+00, - 1.05710991e-01, -2.08204972e+00, 3.95713481e-02, 1.25294428e-01, 7.98513207e-01, -1.55469035e+00, - -1.45623103e+00, 2.07037113e-01, -5.59453678e-01, 8.27609595e-02, -2.34877335e+00, -1.21446985e+00, - 1.02501477e+00, -1.25973017e+00, -1.06148284e+00, -1.99943464e+00, -2.39557564e+00, -1.03401682e-01, - -5.89242481e-01, -1.33699837e+00, -5.66626485e-01, -8.20827546e-01, 7.08673679e-01, 3.56268594e-01, - 1.34701008e+00, 2.35701318e+00, 8.72426361e-01, 2.15751786e+00, 1.67451277e+00, 1.61541844e+00, - 4.27209371e-01, -1.25806042e+00, 1.65219304e+00, 1.85000776e+00, -2.50749521e-02, 7.89155583e-01, - -1.93965941e+00, 1.37476185e+00, -1.52017964e+00, 8.60679220e-01, 2.65449563e-03, -7.53341313e-02, - 6.65063658e-01, 2.60292159e+00, 9.55695921e-01, 1.54814485e+00, 8.21498686e-01, 1.53037234e+00, - -1.31319200e-01, 2.57729950e+00, 2.42374241e+00, 3.10631971e-01, 1.66731310e+00, 2.36208186e+00, - 2.54964027e-01, 4.12803372e-02, 4.66327691e-01, 1.17066147e+00, 1.11702596e+00, 5.91532438e-02, - 3.63947332e-01, 1.07119714e-01, 3.00232892e+00, 2.80398269e+00, -1.74577432e-01, 6.12927281e-01, - -8.30359593e-01, 1.17584762e+00, 5.27031664e-01, 8.18055914e-01, -1.04807033e+00, -8.67796047e-01, - 6.41990469e-01, 2.14869940e+00, 1.73284848e+00, 1.53710689e+00, -1.25987231e+00, 2.05286577e+00, - 1.41170658e+00, 6.51183049e-01, -2.30071547e-01, -2.03761790e+00, 2.29770750e+00, 1.77626405e+00}; -} diff --git a/tmva/sofie/test/input_models/references/AddBroadcast4.ref.hxx b/tmva/sofie/test/input_models/references/AddBroadcast4.ref.hxx deleted file mode 100644 index ad81c7cc3b818..0000000000000 --- a/tmva/sofie/test/input_models/references/AddBroadcast4.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace AddBroadcast4_ExpectedOutput { -float output[] = {2.45200291, 1.66471476, 1.25539769, 2.27487779, 0.98522352, 0.81292617, 1.82645147, 0.6046391}; -} diff --git a/tmva/sofie/test/input_models/references/AddBroadcast5.ref.hxx b/tmva/sofie/test/input_models/references/AddBroadcast5.ref.hxx deleted file mode 100644 index 5bdc7e5dca9f1..0000000000000 --- a/tmva/sofie/test/input_models/references/AddBroadcast5.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace AddBroadcast5_ExpectedOutput { -float output[] = {1.24171313, 1.04788539, 3.29319382, 1.02589521, -0.41043831, -2.203575, 0.61833515, 1.11085738, - -0.70775363, -0.13382941, 1.61307887, 1.0414791, 1.29010948, -0.26403874, -0.08038072, 0.36814471, - 0.39792642, -0.49708952, 1.61626656, 0.77349178, 0.45504046, -1.78326815, 0.08596983, 0.34567239}; -} diff --git a/tmva/sofie/test/input_models/references/AddBroadcast6.ref.hxx b/tmva/sofie/test/input_models/references/AddBroadcast6.ref.hxx deleted file mode 100644 index 941964b6dacd4..0000000000000 --- a/tmva/sofie/test/input_models/references/AddBroadcast6.ref.hxx +++ /dev/null @@ -1,9 +0,0 @@ -namespace AddBroadcast6_ExpectedOutput { -float output[] = {1.08660839, -0.27970598, 0.70762216, -2.36167365, 0.52595116, -1.97351519, 0.341601, - 0.09808014, 0.90013853, -0.71521756, -1.66339531, -0.70629803, 1.63530014, -1.76191232, - 1.75597992, -2.01735285, -0.12055379, -1.62934185, -0.16043962, -1.5786009, 1.30666441, - -0.67326635, 0.50004984, -2.11201309, -0.31231834, 0.24068845, 0.83188627, -1.38432122, - -0.92760496, 1.43576641, -0.29930359, 1.70143144, 1.22185757, 1.248342, 2.30952915, - -0.98118644, -0.26561902, -0.33096189, -0.73867402, -0.48742084, -1.29870789, 3.96352419, - -0.22749962, 0.86731415, 1.55905429, 0.30220863, 3.8105684, 0.76597502}; -} diff --git a/tmva/sofie/test/input_models/references/AddBroadcast7.ref.hxx b/tmva/sofie/test/input_models/references/AddBroadcast7.ref.hxx deleted file mode 100644 index 4f0d22969e91b..0000000000000 --- a/tmva/sofie/test/input_models/references/AddBroadcast7.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace AddBroadcast7_ExpectedOutput { -float output[] = {0.9835503, -0.7093092, -0.34671074, 0.79910006, -1.10388346, -1.30588089, -1.29510549, -0.25058191, - -0.68698323, -0.89582006, 0.28199016, 0.07058489, 0.26343949, -1.42942001, -1.06682156, 0.07898924, - 0.14583107, -0.05616636, -0.04539095, 0.99913263, -0.60549743, -0.81433426, 0.36347596, 0.15207069}; -} diff --git a/tmva/sofie/test/input_models/references/AvgPool.ref.hxx b/tmva/sofie/test/input_models/references/AvgPool.ref.hxx deleted file mode 100644 index 6af63c85ddd2b..0000000000000 --- a/tmva/sofie/test/input_models/references/AvgPool.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace AvgPool_ExpectedOutput { -float output[] = {-0.1425, 0.2378, 0.0412, -0.3683, 0.2882, 0.4309, -0.2088, - -1.1013, -0.9383, - -0.7881, -0.2316, -0.4493, -0.4955, -0.0111, 0.2097, -0.2522, - -0.7568, -0.8710}; -} // namespace AvgPool_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Cast.ref.hxx b/tmva/sofie/test/input_models/references/Cast.ref.hxx deleted file mode 100644 index 2b2a3d6e7b49b..0000000000000 --- a/tmva/sofie/test/input_models/references/Cast.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace Cast_ExpectedOutput{ - float outputs[] = { - 1.0,2.0,3.0, - 4.0,5.0,6.0 - }; -} // namespace Cast_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/ComplexTopK.ref.hxx b/tmva/sofie/test/input_models/references/ComplexTopK.ref.hxx deleted file mode 100644 index c9beb7c1d6714..0000000000000 --- a/tmva/sofie/test/input_models/references/ComplexTopK.ref.hxx +++ /dev/null @@ -1,14 +0,0 @@ -namespace ComplexTopK_ExpectedOutput { -float values[] = { - 9.0000, 8.0000, 7.1000, 9.8000, 6.6000, 7.7000, 8.8000, 9.9000, 7.4000, - 3.5000, 5.6000, 4.5000, 5.5000, 2.9000, 3.3000, 6.2000, 8.4000, 1.0000, - 2.2000, 3.3000, 4.4000, 1.7000, 1.1000, 3.2000, 4.0000, 2.6000, 0.7000, - - 9.0000, 8.0000, 7.0000, 6.0000, 5.0000, 6.0000, 7.0000, 8.0000, 9.0000, - 5.0000, 4.0000, 3.0000, 4.0000, 5.0000, 6.0000, 7.0000, 8.0000, 9.0000, - 1.0000, 2.0000, 3.0000, 2.0000, 1.0000, 4.0000, 3.0000, 2.0000, 1.0000}; - -float indexes[] = {0, 0, 1, 1, 2, 2, 2, 2, 0, 1, 1, 0, 2, 0, 1, 1, 1, 2, 2, 2, 2, 0, 1, 0, - 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 2, 2, 0, 0, 1, 2, 2, 2, 2, 0, 0, 2, - 2, 2, 1, 1, 1, 1}; -} // namespace ComplexTopK_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Constant.ref.hxx b/tmva/sofie/test/input_models/references/Constant.ref.hxx deleted file mode 100644 index cf0642090289b..0000000000000 --- a/tmva/sofie/test/input_models/references/Constant.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Constant_ExpectedOutput{ - float outputs[] = { - 2.0, 4.0, 6.0, 8.0 - }; -} // namespace Constant_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/ConvAddRelu.ref.hxx b/tmva/sofie/test/input_models/references/ConvAddRelu.ref.hxx deleted file mode 100644 index 78089177b20f1..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvAddRelu.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace ConvAddRelu_ExpectedOutput { -// Conv (3x3 all-ones kernel, no padding) + Add (bias 0.5) + Relu, applied to -// a 4x4 ramp input starting at -7 so that the Relu clips part of the output -float outputs[] = {0., 0., 18.5, 27.5}; -} // namespace ConvAddRelu_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvTranspose1d.ref.hxx b/tmva/sofie/test/input_models/references/ConvTranspose1d.ref.hxx deleted file mode 100644 index e9eb011030b9a..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvTranspose1d.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace ConvTranspose1d_ExpectedOutput{ - float output[] = {0, 1, 3, 3, 2, 0, 1, 3, 3, 2}; -} diff --git a/tmva/sofie/test/input_models/references/ConvTranspose2d.ref.hxx b/tmva/sofie/test/input_models/references/ConvTranspose2d.ref.hxx deleted file mode 100644 index 9b338fcd812c5..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvTranspose2d.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace ConvTranspose2d_ExpectedOutput{ - float output[] = { - 0, 1, 3, 3, 2, 3, 8, 15, 12, 7, 9, 21, 36, 27, 15, 9, 20, 33, 24, 13, 6, 13, - 21, 15, 8, 0, 1, 3, 3, 2, 3, 8, 15, 12, 7, 9, 21, 36, 27, 15, 9, 20, 33, 24, - 13, 6, 13, 21, 15, 8}; -} diff --git a/tmva/sofie/test/input_models/references/ConvTranspose3d.ref.hxx b/tmva/sofie/test/input_models/references/ConvTranspose3d.ref.hxx deleted file mode 100644 index 2fb051d4c6463..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvTranspose3d.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace ConvTranspose3d_ExpectedOutput{ - float output[] = { - 0., 1., 1., 2., 6., 4., 2., 5., 3., 4., 10., 6., 12., 28., - 16., 8., 18., 10., 4., 9., 5., 10., 22., 12., 6., 13., 7., 0., - 1., 1., 2., 6., 4., 2., 5., 3., 4., 10., 6., 12., 28., 16., - 8., 18., 10., 4., 9., 5., 10., 22., 12., 6., 13., 7.}; -} diff --git a/tmva/sofie/test/input_models/references/ConvTransposeBias2d.ref.hxx b/tmva/sofie/test/input_models/references/ConvTransposeBias2d.ref.hxx deleted file mode 100644 index 0fc2c4aed2357..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvTransposeBias2d.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace ConvTransposeBias2d_ExpectedOutput{ - float output[] = { - 1 ,2 ,4 ,4 ,3 ,4 ,9 ,16 ,13 ,8 ,10 ,22 ,37 ,28 ,16 ,10 ,21 ,34 ,25 ,14 ,7, - 14 ,22 ,16 ,9 ,2 ,3 ,5 ,5 ,4 ,5 ,10 ,17 ,14 ,9 ,11 ,23 ,38 ,29 ,17 ,11 ,22, - 35 ,26 ,15 ,8 ,15 ,23 ,17 ,10}; -} diff --git a/tmva/sofie/test/input_models/references/ConvTransposeBias2dBatched.ref.hxx b/tmva/sofie/test/input_models/references/ConvTransposeBias2dBatched.ref.hxx deleted file mode 100644 index bfba0aa66179e..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvTransposeBias2dBatched.ref.hxx +++ /dev/null @@ -1,12 +0,0 @@ -namespace ConvTransposeBias2dBatched_ExpectedOutput{ - float output[] = { - 1., 2., 4., 4., 3., 4., 9., 16., 13., 8., 10., 22., - 37., 28., 16., 10., 21., 34., 25., 14., 7., 14., 22., 16., - 9., 2., 3., 5., 5., 4., 5., 10., 17., 14., 9., 11., - 23., 38., 29., 17., 11., 22., 35., 26., 15., 8., 15., 23., - 17., 10., 10., 20., 31., 22., 12., 22., 45., 70., 49., 26., - 37., 76., 118., 82., 43., 28., 57., 88., 61., 32., 16., 32., - 49., 34., 18., 11., 21., 32., 23., 13., 23., 46., 71., 50., - 27., 38., 77., 119., 83., 44., 29., 58., 89., 62., 33., 17., - 33., 50., 35., 19.}; -} diff --git a/tmva/sofie/test/input_models/references/ConvWithAsymmetricPadding.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithAsymmetricPadding.ref.hxx deleted file mode 100644 index 2ae1473b93980..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithAsymmetricPadding.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace ConvWithAsymmetricPadding_ExpectedOutput { -float all_ones[] = {21., 33., 99., 117., 189., 207., 171., 183.}; -} // namespace ConvWithAsymmetricPadding_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvWithAutopadSameLower.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithAutopadSameLower.ref.hxx deleted file mode 100644 index ebef261437ce7..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithAutopadSameLower.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace ConvWithAutopadSameLower_ExpectedOutput { -float all_ones[] = {12., 27., 24., 63., 108., 81., 72., 117., 84.}; -} // namespace ConvWithAutopadSameLower_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvWithAutopadSameUpper.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithAutopadSameUpper.ref.hxx deleted file mode 100644 index 71bf99b6cb987..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithAutopadSameUpper.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace ConvWithAutopadSameUpper_ExpectedOutput { -float output[] = {12., 21., 27., 33., 24., 33., 54., 63., 72., 51., 63., 99., 108., - 117., 81., 93., 144., 153., 162., 111., 72., 111., 117., 123., 84.}; -} // namespace ConvWithAutopadSameUpper_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvWithDilation.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithDilation.ref.hxx deleted file mode 100644 index 76559a18954bc..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithDilation.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace ConvWithDilation_ExpectedOutput { -float all_ones[] = {98.400002f, 102.900009f, 107.400002f, 129.899994f, 134.399994f, 138.899994f, 161.399994f, 165.899994f, 170.399994f}; -} // namespace ConvWithDilation_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvWithPadding.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithPadding.ref.hxx deleted file mode 100644 index 7f6b0031e0398..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithPadding.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace ConvWithPadding_ExpectedOutput { -float all_ones[] = {12., 21., 27., 33., 24., 33., 54., 63., 72., - 51., 63., 99., 108., 117., 81., 93., 144., 153., - 162., 111., 72., 111., 117., 123., 84.}; -} // namespace ConvWithPadding_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvWithStridesNoPadding.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithStridesNoPadding.ref.hxx deleted file mode 100644 index 3f415781598b0..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithStridesNoPadding.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace ConvWithStridesNoPadding_ExpectedOutput { -float all_ones[] = {54., 72., 144., 162., 234., 252.}; -} // namespace ConvWithStridesNoPadding_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvWithStridesPadding.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithStridesPadding.ref.hxx deleted file mode 100644 index d0f7d314e146e..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithStridesPadding.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace ConvWithStridesPadding_ExpectedOutput { -float all_ones[] = {12., 27., 24., 63., 108., 81., - 123., 198., 141., 112., 177., 124.}; -} // namespace ConvWithStridesPadding_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ConvWithoutPadding.ref.hxx b/tmva/sofie/test/input_models/references/ConvWithoutPadding.ref.hxx deleted file mode 100644 index f569682f54b5c..0000000000000 --- a/tmva/sofie/test/input_models/references/ConvWithoutPadding.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace ConvWithoutPadding_ExpectedOutput { -float all_ones[] = {54., 63., 72., 99., 108., 117., 144., 153., 162.}; -} // namespace ConvWithoutPadding_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Div.ref.hxx b/tmva/sofie/test/input_models/references/Div.ref.hxx deleted file mode 100644 index ad2859637cfb2..0000000000000 --- a/tmva/sofie/test/input_models/references/Div.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Div_ExpectedOutput{ - float outputs[] = { - 2, 1 - }; -} // namespace Div_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Elu.ref.hxx b/tmva/sofie/test/input_models/references/Elu.ref.hxx deleted file mode 100644 index 636f09a7de378..0000000000000 --- a/tmva/sofie/test/input_models/references/Elu.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace Elu_ExpectedOutput{ - float outputs[] = { - 1.0000, -0.8647, 3.0000, - 0.5000, -0.6321, 2.0000 - }; -} // namespace Erf_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/EluAlpha.ref.hxx b/tmva/sofie/test/input_models/references/EluAlpha.ref.hxx deleted file mode 100644 index 96a037a66802b..0000000000000 --- a/tmva/sofie/test/input_models/references/EluAlpha.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace EluAlpha_ExpectedOutput{ - float outputs[] = { - 1.0000, -0.4323, 3.0000, - 0.5000, -0.3161, 2.0000 - }; -} // namespace EluAlpha_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Equal.ref.hxx b/tmva/sofie/test/input_models/references/Equal.ref.hxx deleted file mode 100644 index 13d717232bcd9..0000000000000 --- a/tmva/sofie/test/input_models/references/Equal.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Equal_ExpectedOutput{ - bool outputs[] = { - false, true, false - }; -} // namespace Equal_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Erf.ref.hxx b/tmva/sofie/test/input_models/references/Erf.ref.hxx deleted file mode 100644 index 969192cce9889..0000000000000 --- a/tmva/sofie/test/input_models/references/Erf.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace Erf_ExpectedOutput{ - float outputs[] = { - -0.8591, 0.2138, 0.8421, -0.6006, 0.6668, -0.9995, 0.2014, 0.6674, - 0.9731, -0.9659, 0.4520, -0.7709 - }; -} // namespace Erf_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Exp.ref.hxx b/tmva/sofie/test/input_models/references/Exp.ref.hxx deleted file mode 100644 index 161b84aa91085..0000000000000 --- a/tmva/sofie/test/input_models/references/Exp.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace Exp_ExpectedOutput{ - float output[] = {4.33041999, 1.88390199, 11.07639762, 1.72406441, 0.24348091, - 0.83019732, 1.31712088, 3.02270491, 2.42236393, 1.60851648}; -} diff --git a/tmva/sofie/test/input_models/references/ExpandDiffSize.ref.hxx b/tmva/sofie/test/input_models/references/ExpandDiffSize.ref.hxx deleted file mode 100644 index a2f3328885456..0000000000000 --- a/tmva/sofie/test/input_models/references/ExpandDiffSize.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace ExpandDiffSize_ExpectedOutput { -float output[] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2}; -} diff --git a/tmva/sofie/test/input_models/references/ExpandSameSize.ref.hxx b/tmva/sofie/test/input_models/references/ExpandSameSize.ref.hxx deleted file mode 100644 index 5db166975abbf..0000000000000 --- a/tmva/sofie/test/input_models/references/ExpandSameSize.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace ExpandSameSize_ExpectedOutput { -float output[] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2}; -} diff --git a/tmva/sofie/test/input_models/references/EyeLike.ref.hxx b/tmva/sofie/test/input_models/references/EyeLike.ref.hxx deleted file mode 100644 index fad896a7d36f4..0000000000000 --- a/tmva/sofie/test/input_models/references/EyeLike.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace EyeLike_ExpectedOutput { -float output[] = {1, 0, 0, 0, 1, 0, 0, 0, 1 }; -} diff --git a/tmva/sofie/test/input_models/references/GRUBatchwise.ref.hxx b/tmva/sofie/test/input_models/references/GRUBatchwise.ref.hxx deleted file mode 100644 index 089c2b98f9ee7..0000000000000 --- a/tmva/sofie/test/input_models/references/GRUBatchwise.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace GRUBatchwise_ExpectedOutput { -float all_ones[] = {0.19030017, 0.19030017, 0.19030017, 0.19030017, 0.19030017, - 0.19030017, 0.17513685, 0.17513685, 0.17513685, 0.17513685, - 0.17513685, 0.17513685, 0.09733084, 0.09733084, 0.09733084, - 0.09733084, 0.09733084, 0.09733084}; - -} // namespace GRUBatchwise_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/GRUBidirectional.ref.hxx b/tmva/sofie/test/input_models/references/GRUBidirectional.ref.hxx deleted file mode 100644 index e5563d17bbf80..0000000000000 --- a/tmva/sofie/test/input_models/references/GRUBidirectional.ref.hxx +++ /dev/null @@ -1,9 +0,0 @@ -namespace GRUBidirectional_ExpectedOutput { -float all_ones[] = {0.12397026, 0.12397026, 0.12397026, 0.12397026, 0.12397026, - 0.20053664, 0.20053664, 0.20053664, 0.20053664, 0.20053664, - 0.19991654, 0.19991654, 0.19991654, 0.19991654, 0.19991654, - 0.01477059, 0.01477059, 0.01477059, 0.01477059, 0.01477059, - 0.03372044, 0.03372044, 0.03372044, 0.03372044, 0.03372044, - 0.05176941, 0.05176941, 0.05176941, 0.05176941, 0.05176941}; - -} // namespace GRUBidirectional_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/GRUDefaults.ref.hxx b/tmva/sofie/test/input_models/references/GRUDefaults.ref.hxx deleted file mode 100644 index 02adee8a18aec..0000000000000 --- a/tmva/sofie/test/input_models/references/GRUDefaults.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace GRUDefaults_ExpectedOutput { -float all_ones[] = {0.12397026, 0.12397026, 0.12397026, 0.12397026, 0.12397026, - 0.20053664, 0.20053664, 0.20053664, 0.20053664, 0.20053664, - 0.19991654, 0.19991654, 0.19991654, 0.19991654, 0.19991654}; - -} // namespace GRUDefaults_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/GRUInitialBias.ref.hxx b/tmva/sofie/test/input_models/references/GRUInitialBias.ref.hxx deleted file mode 100644 index 232002a735150..0000000000000 --- a/tmva/sofie/test/input_models/references/GRUInitialBias.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace GRUInitialBias_ExpectedOutput { -float all_ones[] = {0.15482332, 0.15482332, 0.15482332, 0.0748427, 0.0748427, - 0.0748427, 0.0322236, 0.0322236, 0.0322236}; -} // namespace GRUInitialBias_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/GRUSeqLength.ref.hxx b/tmva/sofie/test/input_models/references/GRUSeqLength.ref.hxx deleted file mode 100644 index 1f2079f205dcd..0000000000000 --- a/tmva/sofie/test/input_models/references/GRUSeqLength.ref.hxx +++ /dev/null @@ -1,13 +0,0 @@ -namespace GRUSeqLength_ExpectedOutput { -float all_ones_y[] = { - 0.15482332, 0.15482332, 0.15482332, 0.15482332, 0.15482332, 0.0748427, - 0.0748427, 0.0748427, 0.0748427, 0.0748427, 0.0322236, 0.0322236, - 0.0322236, 0.0322236, 0.0322236, 0.16530132, 0.16530132, 0.16530132, - 0.16530132, 0.16530132, 0.07973265, 0.07973265, 0.07973265, 0.07973265, - 0.07973265, 0.03435477, 0.03435477, 0.03435477, 0.03435477, 0.03435477}; - -float all_ones_yh[] = {0.16530132, 0.16530132, 0.16530132, 0.16530132, - 0.16530132, 0.07973265, 0.07973265, 0.07973265, - 0.07973265, 0.07973265, 0.03435477, 0.03435477, - 0.03435477, 0.03435477, 0.03435477}; -} // namespace GRUSeqLength_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Gather2d.ref.hxx b/tmva/sofie/test/input_models/references/Gather2d.ref.hxx deleted file mode 100644 index da86eb35f30cb..0000000000000 --- a/tmva/sofie/test/input_models/references/Gather2d.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace Gather2d_ExpectedOutput { -float output[] = {0, 1, 2, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 7, 8}; -} diff --git a/tmva/sofie/test/input_models/references/GatherAxis0.ref.hxx b/tmva/sofie/test/input_models/references/GatherAxis0.ref.hxx deleted file mode 100644 index 9adf515c07bcc..0000000000000 --- a/tmva/sofie/test/input_models/references/GatherAxis0.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace GatherAxis0_ExpectedOutput { -float output[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}; -} diff --git a/tmva/sofie/test/input_models/references/GatherAxis1.ref.hxx b/tmva/sofie/test/input_models/references/GatherAxis1.ref.hxx deleted file mode 100644 index 7f13fdcffd24a..0000000000000 --- a/tmva/sofie/test/input_models/references/GatherAxis1.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace GatherAxis1_ExpectedOutput { -float output[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 114, 115, 116, 117, 118, 119}; -} diff --git a/tmva/sofie/test/input_models/references/GatherAxis2.ref.hxx b/tmva/sofie/test/input_models/references/GatherAxis2.ref.hxx deleted file mode 100644 index 36dd41ee5090c..0000000000000 --- a/tmva/sofie/test/input_models/references/GatherAxis2.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace GatherAxis2_ExpectedOutput { -float output[] = {2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 16, 17, 20, 21, 22, 23, 26, 27, 28, 29, - 32, 33, 34, 35, 38, 39, 40, 41, 44, 45, 46, 47, 50, 51, 52, 53, 56, 57, 58, 59, - 62, 63, 64, 65, 68, 69, 70, 71, 74, 75, 76, 77, 80, 81, 82, 83, 86, 87, 88, 89, - 92, 93, 94, 95, 98, 99, 100, 101, 104, 105, 106, 107, 110, 111, 112, 113, 116, 117, 118, 119}; -} diff --git a/tmva/sofie/test/input_models/references/GatherAxis3.ref.hxx b/tmva/sofie/test/input_models/references/GatherAxis3.ref.hxx deleted file mode 100644 index 52890fe69786b..0000000000000 --- a/tmva/sofie/test/input_models/references/GatherAxis3.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace GatherAxis3_ExpectedOutput { -float output[] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, - 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, - 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119}; -} diff --git a/tmva/sofie/test/input_models/references/GatherNegativeIndices.ref.hxx b/tmva/sofie/test/input_models/references/GatherNegativeIndices.ref.hxx deleted file mode 100644 index 7cf76546d3a39..0000000000000 --- a/tmva/sofie/test/input_models/references/GatherNegativeIndices.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace GatherNegativeIndices_ExpectedOutput { -float output[] = {0, 1, 0}; -} diff --git a/tmva/sofie/test/input_models/references/Gelu.ref.hxx b/tmva/sofie/test/input_models/references/Gelu.ref.hxx deleted file mode 100644 index 9ad35c2f15146..0000000000000 --- a/tmva/sofie/test/input_models/references/Gelu.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Gelu_ExpectedOutput { - float outputs[] = { - 0.841345f, -0.045500f, 2.995950f, 0.345731f, -0.158655f, 1.954500f - }; -} // namespace Gelu_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Greater.ref.hxx b/tmva/sofie/test/input_models/references/Greater.ref.hxx deleted file mode 100644 index c443419e34b43..0000000000000 --- a/tmva/sofie/test/input_models/references/Greater.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Greater_ExpectedOutput{ - bool outputs[] = { - false, false, false - }; -} // namespace Greater_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/GreaterOrEqual.ref.hxx b/tmva/sofie/test/input_models/references/GreaterOrEqual.ref.hxx deleted file mode 100644 index 92749171c55a3..0000000000000 --- a/tmva/sofie/test/input_models/references/GreaterOrEqual.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace GreaterOrEqual_ExpectedOutput{ - bool outputs[] = { - false, true, false - }; -} // namespace GreaterOrEqual_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/HardSigmoid.ref.hxx b/tmva/sofie/test/input_models/references/HardSigmoid.ref.hxx deleted file mode 100644 index 67b8db1e1ed75..0000000000000 --- a/tmva/sofie/test/input_models/references/HardSigmoid.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace HardSigmoid_ExpectedOutput { -float outputs[] = {0.700000f, 0.100000f, 1.000000f, 0.600000f, 0.300000f, 0.900000f}; -} // namespace HardSigmoid_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/HardSwish.ref.hxx b/tmva/sofie/test/input_models/references/HardSwish.ref.hxx deleted file mode 100644 index 6782ef0a893c0..0000000000000 --- a/tmva/sofie/test/input_models/references/HardSwish.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace HardSwish_ExpectedOutput { -float outputs[] = {0.666667f, -0.333333f, 3.000000f, 0.291667f, -0.333333f, 1.666667f}; -} // namespace HardSwish_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/LSTMBatchwise.ref.hxx b/tmva/sofie/test/input_models/references/LSTMBatchwise.ref.hxx deleted file mode 100644 index 21030f01c0b1e..0000000000000 --- a/tmva/sofie/test/input_models/references/LSTMBatchwise.ref.hxx +++ /dev/null @@ -1,8 +0,0 @@ -namespace LSTMBatchwise_ExpectedOutput { -float all_ones[] = {0.33369258, 0.33369258, 0.33369258, 0.33369258, 0.33369258, - 0.33369258, 0.33369258, 0.62239319, 0.62239319, 0.62239319, - 0.62239319, 0.62239319, 0.62239319, 0.62239319, 0.71857899, - 0.71857899, 0.71857899, 0.71857899, 0.71857899, 0.71857899, - 0.71857899}; - -} diff --git a/tmva/sofie/test/input_models/references/LSTMBidirectional.ref.hxx b/tmva/sofie/test/input_models/references/LSTMBidirectional.ref.hxx deleted file mode 100644 index a35c02f06eccc..0000000000000 --- a/tmva/sofie/test/input_models/references/LSTMBidirectional.ref.hxx +++ /dev/null @@ -1,9 +0,0 @@ -namespace LSTMBidirectional_ExpectedOutput { -float all_ones_y[] = {0.0952, 0.0952, 0.0952, 0.4041, 0.4041, 0.4041, - 0.3287, 0.3287, 0.3287, 0.4927, 0.4927, 0.4927, - 0.6004, 0.6004, 0.6004, 0.4032, 0.4032, 0.4032}; - -float all_ones_yh[] = {0.6004, 0.6004, 0.6004, 0.4041, 0.4041, 0.4041}; - -float all_ones_yc[] = {1.0493, 1.0493, 1.0493, 0.7970, 0.7970, 0.7970}; -} // namespace LSTMBidirectional_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/LSTMDefaults.ref.hxx b/tmva/sofie/test/input_models/references/LSTMDefaults.ref.hxx deleted file mode 100644 index 17ecf486e85bf..0000000000000 --- a/tmva/sofie/test/input_models/references/LSTMDefaults.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace LSTMDefaults_ExpectedOutput { -float all_ones_y[] = {0.09524119, 0.09524119, 0.09524119, - 0.32869044, 0.32869044, 0.32869044, - 0.60042989, 0.60042989, 0.60042989}; - -float all_ones_yh[] = {0.60042989, 0.60042989, 0.60042989}; -} // namespace LSTMDefaults_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/LSTMInitialBias.ref.hxx b/tmva/sofie/test/input_models/references/LSTMInitialBias.ref.hxx deleted file mode 100644 index 640edf5a0826b..0000000000000 --- a/tmva/sofie/test/input_models/references/LSTMInitialBias.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace LSTMInitialBias_ExpectedOutput { -float all_ones_y[] = {0.25606444, 0.25606444, 0.25606444, 0.25606444, - 0.68688357, 0.68688357, 0.68688357, 0.68688357, - 0.90747154, 0.90747154, 0.90747154, 0.90747154}; - -float all_ones_yh[] = {0.90747154, 0.90747154, 0.90747154, 0.90747154}; -} // namespace LSTMInitialBias_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/LSTMPeepholes.ref.hxx b/tmva/sofie/test/input_models/references/LSTMPeepholes.ref.hxx deleted file mode 100644 index 453957c7854a6..0000000000000 --- a/tmva/sofie/test/input_models/references/LSTMPeepholes.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace LSTMPeepholes_ExpectedOutput { -float all_ones[] = {0.37506911, 0.37506911, 0.37506911, - 0.6801309, 0.6801309, 0.6801309}; -} diff --git a/tmva/sofie/test/input_models/references/LayerNormalization2d.hxx b/tmva/sofie/test/input_models/references/LayerNormalization2d.hxx deleted file mode 100644 index 1dc03b3dfbd37..0000000000000 --- a/tmva/sofie/test/input_models/references/LayerNormalization2d.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace LayerNormalization2d_ExpectedOutput { -float output[] = {-0.4708, -0.0106, 0.2342, 1.3416, -0.4708, -0.0106, 0.2342, 1.3416, -0.4708, -0.0106, 0.2342, 1.3416}; -} // namespace LayerNormalization2d_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/LayerNormalization4d.hxx b/tmva/sofie/test/input_models/references/LayerNormalization4d.hxx deleted file mode 100644 index ea83928cb9ab8..0000000000000 --- a/tmva/sofie/test/input_models/references/LayerNormalization4d.hxx +++ /dev/null @@ -1,12 +0,0 @@ -namespace LayerNormalization4d_ExpectedOutput { -float output[] = {0.0352, 0.0526, 0.0699, 0.0873, 0.1046, 0.1220, 0.1393, 0.1566, 0.1740, 0.1913, 0.2087, 0.2260, - 0.2434, 0.2607, 0.2780, 0.2954, 0.3127, 0.3301, 0.3474, 0.3648, 0.0352, 0.0526, 0.0699, 0.0873, - 0.1046, 0.1220, 0.1393, 0.1566, 0.1740, 0.1913, 0.2087, 0.2260, 0.2434, 0.2607, 0.2780, 0.2954, - 0.3127, 0.3301, 0.3474, 0.3648, 0.0352, 0.0526, 0.0699, 0.0873, 0.1046, 0.1220, 0.1393, 0.1566, - 0.1740, 0.1913, 0.2087, 0.2260, 0.2434, 0.2607, 0.2780, 0.2954, 0.3127, 0.3301, 0.3474, 0.3648, - 0.0352, 0.0526, 0.0699, 0.0873, 0.1046, 0.1220, 0.1393, 0.1566, 0.1740, 0.1913, 0.2087, 0.2260, - 0.2434, 0.2607, 0.2780, 0.2954, 0.3127, 0.3301, 0.3474, 0.3648, 0.0352, 0.0526, 0.0699, 0.0873, - 0.1046, 0.1220, 0.1393, 0.1566, 0.1740, 0.1913, 0.2087, 0.2260, 0.2434, 0.2607, 0.2780, 0.2954, - 0.3127, 0.3301, 0.3474, 0.3648, 0.0352, 0.0526, 0.0699, 0.0873, 0.1046, 0.1220, 0.1393, 0.1566, - 0.1740, 0.1913, 0.2087, 0.2260, 0.2434, 0.2607, 0.2780, 0.2954, 0.3127, 0.3301, 0.3474, 0.3648}; -} // namespace LayerNormalization4d_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Less.ref.hxx b/tmva/sofie/test/input_models/references/Less.ref.hxx deleted file mode 100644 index 58482543cbbab..0000000000000 --- a/tmva/sofie/test/input_models/references/Less.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Less_ExpectedOutput{ - bool outputs[] = { - true, false, true - }; -} // namespace Less_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/LessOrEqual.ref.hxx b/tmva/sofie/test/input_models/references/LessOrEqual.ref.hxx deleted file mode 100644 index 7727c96ba6acd..0000000000000 --- a/tmva/sofie/test/input_models/references/LessOrEqual.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace LessOrEqual_ExpectedOutput{ - bool outputs[] = { - true, true, true - }; -} // namespace LessOrEqual_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/LinearWithLeakyRelu.ref.hxx b/tmva/sofie/test/input_models/references/LinearWithLeakyRelu.ref.hxx deleted file mode 100644 index aa43cea909e83..0000000000000 --- a/tmva/sofie/test/input_models/references/LinearWithLeakyRelu.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace LinearWithLeakyRelu_ExpectedOutput{ - float outputs[] = { - 0.4369, -0.0688, 1.0309, -0.1026, -0.0152, 1.2237, -0.0705, -0.0176, - -0.0681, -0.2260, 1.0388, -0.0799, 0.1468, 1.3257, -0.0471, -0.0096, - 0.7057, -0.0375, -0.0331, 0.0986, -0.0137, 0.0832, -0.1647, -0.0279 - }; -} // namespace LinearWithLeakyRelu_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/LinearWithSelu.ref.hxx b/tmva/sofie/test/input_models/references/LinearWithSelu.ref.hxx deleted file mode 100644 index 90f1e3a748b3f..0000000000000 --- a/tmva/sofie/test/input_models/references/LinearWithSelu.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace LinearWithSelu_ExpectedOutput{ - float all_ones[] = { - 0.175657, 0.305336, 0.281847, -0.634415, -0.683576, -0.144266, -0.397181, -0.481238, 0.0799519, -0.454446, -0.0238849, -0.388235, - 0.175657, 0.305336, 0.281847, -0.634415, -0.683576, -0.144266, -0.397181, -0.481238, 0.0799519, -0.454446, -0.0238849, -0.388235 - }; -} // namespace LinearWithSelu_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/LinearWithSigmoid.ref.hxx b/tmva/sofie/test/input_models/references/LinearWithSigmoid.ref.hxx deleted file mode 100644 index 3e1c4799ab113..0000000000000 --- a/tmva/sofie/test/input_models/references/LinearWithSigmoid.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace LinearWithSigmoid_ExpectedOutput{ - float all_ones[] = { - 0.485357, 0.591180, 0.815637, 0.156803, 0.164266, 0.342017, 0.415033, 0.191306, 0.227441, 0.101257, 0.105839, 0.333542, - 0.485357, 0.591180, 0.815637, 0.156803, 0.164266, 0.342017, 0.415033, 0.191306, 0.227441, 0.101257, 0.105839, 0.333542 - }; -} // namespace LinearWithSigmoid_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Linear_16.ref.hxx b/tmva/sofie/test/input_models/references/Linear_16.ref.hxx deleted file mode 100644 index 456e2139d28db..0000000000000 --- a/tmva/sofie/test/input_models/references/Linear_16.ref.hxx +++ /dev/null @@ -1,32 +0,0 @@ -namespace Linear_16_ExpectedOutput { -float all_ones[] = { -0.191688, -0.400436, 0.320249, 0.015183, 0.550377, -0.115759, -0.393626, -0.0239498, -0.460148, 0.256081, 0.191688, -0.400436, -0.320249, 0.015183, 0.550377, -0.115759, 0.393626, -0.0239498, --0.460148, 0.256081, 0.191688, -0.400436, 0.320249, 0.015183, -0.550377, -0.115759, 0.393626, -0.0239498, -0.460148, 0.256081, -0.191688, -0.400436, 0.320249, 0.015183, 0.550377, -0.115759, -0.393626, -0.0239498, -0.460148, 0.256081, 0.191688, -0.400436, -0.320249, 0.015183, 0.550377, -0.115759, 0.393626, -0.0239498, --0.460148, 0.256081, 0.191688, -0.400436, 0.320249, 0.015183, -0.550377, -0.115759, 0.393626, -0.0239498, -0.460148, 0.256081, -0.191688, -0.400436, 0.320249, 0.015183, 0.550377, -0.115759, -0.393626, -0.0239498, -0.460148, 0.256081, 0.191688, -0.400436, -0.320249, 0.015183, 0.550377, -0.115759, 0.393626, -0.0239498, --0.460148, 0.256081, 0.191688, -0.400436, 0.320249, 0.015183, -0.550377, -0.115759, 0.393626, -0.0239498, -0.460148, 0.256081, -0.191688, -0.400436, 0.320249, 0.015183, 0.550377, -0.115759, -0.393626, -0.0239498, -0.460148, 0.256081, 0.191688, -0.400436, -0.320249, 0.015183, 0.550377, -0.115759, 0.393626, -0.0239498, --0.460148, 0.256081, 0.191688, -0.400436, 0.320249, 0.015183, -0.550377, -0.115759, 0.393626, -0.0239498, -0.460148, 0.256081, -0.191688, -0.400436, 0.320249, 0.015183, 0.550377, -0.115759, -0.393626, -0.0239498, -0.460148, 0.256081, 0.191688, -0.400436, -0.320249, 0.015183, 0.550377, -0.115759, 0.393626, -0.0239498, --0.460148, 0.256081, 0.191688, -0.400436, 0.320249, 0.015183, -0.550377, -0.115759, 0.393626, -0.0239498, -0.460148, 0.256081, -0.191688, -0.400436, 0.320249, 0.015183, 0.550377, -0.115759, -0.393626, -0.0239498, -0.460148, 0.256081 -}; -} // namespace Linear_16_ExpectedOutput - diff --git a/tmva/sofie/test/input_models/references/Linear_32.ref.hxx b/tmva/sofie/test/input_models/references/Linear_32.ref.hxx deleted file mode 100644 index 3039567a08954..0000000000000 --- a/tmva/sofie/test/input_models/references/Linear_32.ref.hxx +++ /dev/null @@ -1,59 +0,0 @@ -namespace Linear_32_ExpectedOutput { -float all_ones[] = { -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002, 0.882019, -0.389944, -0.363889, 0.369407, --0.0866714, -0.51955, 0.0671092, -0.858623, 0.0955615, -0.684002, -0.882019, -0.389944, -0.363889, 0.369407, -0.0866714, -0.51955, -0.0671092, -0.858623, 0.0955615, -0.684002, 0.882019, -0.389944, --0.363889, 0.369407, -0.0866714, -0.51955, 0.0671092, -0.858623, -0.0955615, -0.684002 -}; -} // namespace Linear_32_ExpectedOutput - diff --git a/tmva/sofie/test/input_models/references/Linear_64.ref.hxx b/tmva/sofie/test/input_models/references/Linear_64.ref.hxx deleted file mode 100644 index 34a257b183b92..0000000000000 --- a/tmva/sofie/test/input_models/references/Linear_64.ref.hxx +++ /dev/null @@ -1,112 +0,0 @@ -namespace Linear_64_ExpectedOutput { -float all_ones[] = { --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654, -0.30755, -0.289056, --0.743735, 0.223954, -0.00694226, 0.477888, -0.275195, -0.292608, --0.179046, 0.607654, -0.30755, -0.289056, -0.743735, 0.223954, --0.00694226, 0.477888, -0.275195, -0.292608, -0.179046, 0.607654, --0.30755, -0.289056, -0.743735, 0.223954, -0.00694226, 0.477888, --0.275195, -0.292608, -0.179046, 0.607654 -}; -} // namespace Linear_64_ExpectedOutput - diff --git a/tmva/sofie/test/input_models/references/Log.ref.hxx b/tmva/sofie/test/input_models/references/Log.ref.hxx deleted file mode 100644 index c6c6bfc8d9cd8..0000000000000 --- a/tmva/sofie/test/input_models/references/Log.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Log_ExpectedOutput{ - float outputs[] = { - 0.0000, 0.6931, 1.0986, 1.3863 - }; -} // namespace Log_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Max.ref.hxx b/tmva/sofie/test/input_models/references/Max.ref.hxx deleted file mode 100644 index 268d8440f713e..0000000000000 --- a/tmva/sofie/test/input_models/references/Max.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Max_ExpectedOutput { -float outputs[] = { - 3.0, 2.0, 4.0 -}; -} // namespace Max_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/MaxMultidirectionalBroadcast.ref.hxx b/tmva/sofie/test/input_models/references/MaxMultidirectionalBroadcast.ref.hxx deleted file mode 100644 index 37d3ba51c91d5..0000000000000 --- a/tmva/sofie/test/input_models/references/MaxMultidirectionalBroadcast.ref.hxx +++ /dev/null @@ -1,8 +0,0 @@ -namespace MaxMultidirectionalBroadcast_ExpectedOutput { -float output[] = {0.7590198503375636, 0.7590198503375636, 0.7590198503375636, 0.7590198503375636, - -0.41468980634400543, -0.465444611539521, 0.5617253354820355, 0.05616930535561424, - 0.9574627354854222, 0.9574627354854222, 0.9574627354854222, 0.9574627354854222, - 0.3597415448611981, 0.3597415448611981, 0.5617253354820355, 0.3597415448611981, - 0.08269051091686609, 0.08269051091686609, 0.5617253354820355, 0.08269051091686609, - 0.9574627354854222, 0.9574627354854222, 0.9574627354854222, 0.9574627354854222}; -} diff --git a/tmva/sofie/test/input_models/references/MaxPool1d.ref.hxx b/tmva/sofie/test/input_models/references/MaxPool1d.ref.hxx deleted file mode 100644 index c1b15dccdcce2..0000000000000 --- a/tmva/sofie/test/input_models/references/MaxPool1d.ref.hxx +++ /dev/null @@ -1,14 +0,0 @@ -namespace MaxPool1d_ExpectedOutput { -float output[] = {0.8143, 1.4497, 1.4497, 1.4497, 0.3825, 1.5785, 1.5785, - 1.5785, - 1.5867, 0.9823, 0.4439, 0.4439, -0.0198, -0.0198, 0.0905, - 0.6674, - -0.9439, -0.0833, -0.0833, 0.6886, 0.9389, 0.9389, 0.9389, - -1.2914, - 1.1776, 1.3972, 1.3972, 1.3972, 1.1541, 1.1541, 1.1541, - 0.6569, - 2.2846, 2.2846, 2.2846, 0.5756, 0.5756, 0.5756, 0.8947, - 1.7627, - 0.0649, 0.4162, 0.4162, 0.4162, 1.1324, 1.1324, 1.1324, - 1.0071}; -} // namespace MaxPool1d_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/MaxPool2d.ref.hxx b/tmva/sofie/test/input_models/references/MaxPool2d.ref.hxx deleted file mode 100644 index fdcc0e55cc94a..0000000000000 --- a/tmva/sofie/test/input_models/references/MaxPool2d.ref.hxx +++ /dev/null @@ -1,8 +0,0 @@ -namespace MaxPool2d_ExpectedOutput { -float output[] = {0.6266, 0.5901, 0.4421, 1.2184, 1.2184, 1.6823, 1.6823, 1.3223, - 1.0257, - 0.7716, 0.5901, 0.4421, 1.2184, 1.2184, 1.6823, 1.6823, 1.0257, - 1.0257, - 0.7716, 0.3121, 0.4421, 1.2184, 1.2184, 1.6823, 1.6823, 0.9084, - 0.9084}; -} // namespace MaxPool2d_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/MaxPool2d_AsymPad.ref.hxx b/tmva/sofie/test/input_models/references/MaxPool2d_AsymPad.ref.hxx deleted file mode 100644 index 73fc4d5efb809..0000000000000 --- a/tmva/sofie/test/input_models/references/MaxPool2d_AsymPad.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace MaxPool2d_AsymPad_ExpectedOutput { -float output[] = {4, 5, 6, 7, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 15}; -} // namespace MaxPool2d_AsymPad_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/MaxPool2d_CeilMode.ref.hxx b/tmva/sofie/test/input_models/references/MaxPool2d_CeilMode.ref.hxx deleted file mode 100644 index f86ec60222d9f..0000000000000 --- a/tmva/sofie/test/input_models/references/MaxPool2d_CeilMode.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace MaxPool2d_CeilMode_ExpectedOutput { -float output[] = {6, 8, 9, 16, 18, 19, 21, 23, 24}; -} // namespace MaxPool2d_CeilMode_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/MaxPool3d.ref.hxx b/tmva/sofie/test/input_models/references/MaxPool3d.ref.hxx deleted file mode 100644 index 08263aa950d66..0000000000000 --- a/tmva/sofie/test/input_models/references/MaxPool3d.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace MaxPool3d_ExpectedOutput { -float output[] = { - 1.3833, 1.0476, - 0.6984, 1.7924 -}; -} // namespace MaxPool3d_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/MeanMultidirectionalBroadcast.ref.hxx b/tmva/sofie/test/input_models/references/MeanMultidirectionalBroadcast.ref.hxx deleted file mode 100644 index a1dd448c2e263..0000000000000 --- a/tmva/sofie/test/input_models/references/MeanMultidirectionalBroadcast.ref.hxx +++ /dev/null @@ -1,8 +0,0 @@ -namespace MeanMultidirectionalBroadcast_ExpectedOutput { -float output[] = {0.23469052666666665, 0.21761404333333334, 0.5601622433333333, 0.39164356666666666, - -1.0296227666666666, -1.04669925, -0.7041510500000001, -0.8726697266666666, - 0.06452239333333333, 0.04744591, 0.38999410999999995, 0.22147543333333333, - -0.06700788999999999, -0.08408437333333334, 0.2584638266666667, 0.08994515000000002, - -0.84691106, -0.8639875433333334, -0.5214393433333334, -0.6899580200000001, - -0.05256133999999999, -0.06963782333333333, 0.2729103766666667, 0.10439170000000002}; -} diff --git a/tmva/sofie/test/input_models/references/MinMultidirectionalBroadcast.ref.hxx b/tmva/sofie/test/input_models/references/MinMultidirectionalBroadcast.ref.hxx deleted file mode 100644 index e2a457c609c81..0000000000000 --- a/tmva/sofie/test/input_models/references/MinMultidirectionalBroadcast.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace MinMultidirectionalBroadcast_ExpectedOutput { -float output[] = {-0.41468981, -0.46591926, 0.35974154, 0.05616931, -2.20873388, -2.20873388, - -2.20873388, -2.20873388, -0.41468981, -0.46591926, -0.34920575, -0.34920575, - -0.41468981, -0.46591926, -0.1460754, -0.1460754, -2.20873388, -2.20873388, - -2.20873388, -2.20873388, -0.70045695, -0.70045695, -0.70045695, -0.70045695}; -} diff --git a/tmva/sofie/test/input_models/references/Mul.ref.hxx b/tmva/sofie/test/input_models/references/Mul.ref.hxx deleted file mode 100644 index 465bf1b57bf7e..0000000000000 --- a/tmva/sofie/test/input_models/references/Mul.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Mul_ExpectedOutput{ - float outputs[] = { - 0, 2 - }; -} // namespace Mul_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Neg.ref.hxx b/tmva/sofie/test/input_models/references/Neg.ref.hxx deleted file mode 100644 index d1e3bdcad5746..0000000000000 --- a/tmva/sofie/test/input_models/references/Neg.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace Neg_ExpectedOutput{ - float outputs[] = { - 1.9100, -1.8811, 1.7269, 0.1094, 0.0145, -0.2509, -0.5893, 2.2733, - 0.7077, -1.0645, 0.8607, -0.2085 - }; -} // namespace Neg_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Pow.ref.hxx b/tmva/sofie/test/input_models/references/Pow.ref.hxx deleted file mode 100644 index c568b609c3403..0000000000000 --- a/tmva/sofie/test/input_models/references/Pow.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Pow_ExpectedOutput{ - float outputs[] = { - 1, 32, 729 - }; -} // namespace Pow_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Pow_broadcast.ref.hxx b/tmva/sofie/test/input_models/references/Pow_broadcast.ref.hxx deleted file mode 100644 index 4212dec883ff4..0000000000000 --- a/tmva/sofie/test/input_models/references/Pow_broadcast.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace Pow_broadcast_ExpectedOutput{ - float outputs[] = { - 1, 8, 81, - 9, 64, 625 - }; -} // namespace Pow_broadcast_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/RNNBatchwise.ref.hxx b/tmva/sofie/test/input_models/references/RNNBatchwise.ref.hxx deleted file mode 100644 index c031263d365d2..0000000000000 --- a/tmva/sofie/test/input_models/references/RNNBatchwise.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace RNNBatchwise_ExpectedOutput { -float all_ones[] = {0.14888504, 0.14888504, 0.14888504, 0.14888504, - 0.33637556, 0.33637556, 0.33637556, 0.33637556, - 0.50052023, 0.50052023, 0.50052023, 0.50052023}; -} // namespace RNNBatchwise_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RNNBidirectional.ref.hxx b/tmva/sofie/test/input_models/references/RNNBidirectional.ref.hxx deleted file mode 100644 index cec0577813fe9..0000000000000 --- a/tmva/sofie/test/input_models/references/RNNBidirectional.ref.hxx +++ /dev/null @@ -1,19 +0,0 @@ -namespace RNNBidirectional_ExpectedOutput { -float all_ones_y[] = { - -0.1680, -0.9967, 0.9200, 0.9520, -0.0252, 0.9499, 0.2707, 0.9354, - 0.9207, -0.9991, 0.4916, -0.9971, 0.9570, 0.9907, 0.8348, -0.8432, - 0.9337, 0.9806, 0.4609, -0.8339, 0.9651, 0.9867, -0.1637, -0.9962, - 0.9723, -1.0000, 0.6775, -0.8878, -0.4064, -1.0000, -0.3654, -0.9542, - 0.6047, -0.9999, -0.4339, 0.0454, 0.5554, 0.9138, -0.3105, 0.2289, - 0.3086, 0.9752, 0.0683, -0.4540, -0.7255, 0.6310, -0.9871, -0.7722, - 0.6853, -1.0000, -0.5145, -0.2746, 0.8194, -0.5044, 0.7796, 0.8733, - 0.9203, -0.9999, 0.8698, 0.9291, 1.0000, 0.9964, 0.9936, -0.9419, - 0.9995, 0.9907, 0.4186, -0.9974, 0.9966, -0.5491, -0.9923, -0.5074}; - -float all_ones_yh[] = {0.68528736, -0.99995285, -0.51453173, -0.27458954, - 0.81935215, -0.5043667, 0.7795707, 0.8733188, - 0.92034006, -0.999916, 0.8697902, 0.9291247, - 0.9570278, 0.990718, 0.83482444, -0.8432297, - 0.9336523, 0.98059773, 0.46091712, -0.83394974, - 0.9651197, 0.98665035, -0.16370827, -0.99619436}; -} // namespace RNNBidirectional_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RNNBidirectionalBatchwise.ref.hxx b/tmva/sofie/test/input_models/references/RNNBidirectionalBatchwise.ref.hxx deleted file mode 100644 index ec811862af0b4..0000000000000 --- a/tmva/sofie/test/input_models/references/RNNBidirectionalBatchwise.ref.hxx +++ /dev/null @@ -1,18 +0,0 @@ -namespace RNNBidirectionalBatchwise_ExpectedOutput { -float all_ones_y[] = { - -0.168, -0.9967, 0.92, 0.952, 0.957, 0.9907, 0.8348, -0.8432, - 0.9723, -1, 0.6775, -0.8878, 0.5554, 0.9138, -0.3105, 0.2289, - 0.6853, -1, -0.5145, -0.2746, 1, 0.9964, 0.9936, -0.9419, - -0.0252, 0.9499, 0.2707, 0.9354, 0.9337, 0.9806, 0.4609, -0.8339, - -0.4064, -1, -0.3654, -0.9542, 0.3086, 0.9752, 0.0683, -0.454, - 0.8194, -0.5044, 0.7796, 0.8733, 0.9995, 0.9907, 0.4186, -0.9974, - 0.9207, -0.9991, 0.4916, -0.9971, 0.9651, 0.9867, -0.1637, -0.9962, - 0.6047, -0.9999, -0.4339, 0.0454, -0.7255, 0.631, -0.9871, -0.7722, - 0.9203, -0.9999, 0.8698, 0.9291, 0.9966, -0.5491, -0.9923, -0.5074}; - -float all_ones_yh[] = {0.685287, -0.999953, -0.514532, -0.27459, 0.957028, - 0.990718, 0.834824, -0.84323, 0.819352, -0.504367, - 0.779571, 0.873319, 0.933652, 0.980598, 0.460917, - -0.83395, 0.92034, -0.999916, 0.86979, 0.929125, - 0.96512, 0.98665, -0.163708, -0.996194}; -} // namespace RNNBidirectionalBatchwise_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RNNDefaults.ref.hxx b/tmva/sofie/test/input_models/references/RNNDefaults.ref.hxx deleted file mode 100644 index b613c07534274..0000000000000 --- a/tmva/sofie/test/input_models/references/RNNDefaults.ref.hxx +++ /dev/null @@ -1,9 +0,0 @@ -namespace RNNDefaults_ExpectedOutput { -float all_ones_y[] = {0.06988589, 0.06988589, 0.06988589, 0.06988589, - 0.06988589, 0.16205294, 0.16205294, 0.16205294, - 0.16205294, 0.16205294, 0.25251999, 0.25251999, - 0.25251999, 0.25251999, 0.25251999}; - -float all_ones_yh[] = {0.25251999, 0.25251999, 0.25251999, 0.25251999, - 0.25251999}; -} // namespace RNNDefaults_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RNNSeqLength.ref.hxx b/tmva/sofie/test/input_models/references/RNNSeqLength.ref.hxx deleted file mode 100644 index f7d9c9dd27adf..0000000000000 --- a/tmva/sofie/test/input_models/references/RNNSeqLength.ref.hxx +++ /dev/null @@ -1,13 +0,0 @@ -namespace RNNSeqLength_ExpectedOutput { -float all_ones_y[] = { - 0.17032367, 0.17032367, 0.17032367, 0.17032367, 0.17032367, 0.33814806, - 0.33814806, 0.33814806, 0.33814806, 0.33814806, 0.48690841, 0.48690841, - 0.48690841, 0.48690841, 0.48690841, 0.622473, 0.622473, 0.622473, - 0.622473, 0.622473, 0.72863662, 0.72863662, 0.72863662, 0.72863662, - 0.72863662, 0.80780905, 0.80780905, 0.80780905, 0.80780905, 0.80780905}; - -float all_ones_yh[] = {0.622473, 0.622473, 0.622473, 0.622473, - 0.622473, 0.72863662, 0.72863662, 0.72863662, - 0.72863662, 0.72863662, 0.80780905, 0.80780905, - 0.80780905, 0.80780905, 0.80780905}; -} // namespace RNNSeqLength_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RNNSequence.ref.hxx b/tmva/sofie/test/input_models/references/RNNSequence.ref.hxx deleted file mode 100644 index e8cace06a09f8..0000000000000 --- a/tmva/sofie/test/input_models/references/RNNSequence.ref.hxx +++ /dev/null @@ -1,14 +0,0 @@ -namespace RNNSequence_ExpectedOutput { -float all_ones_y[] = { - -0.0160, -0.1818, -0.0401, -0.0794, 0.1761, 0.0137, -0.1869, 0.8827, - -0.6948, -0.2732, 0.4479, 0.9408, 0.0133, 0.2241, -0.2675, -0.3001, - -0.0715, 0.5097, -0.4409, -0.5119, -0.1651, 0.0995, 0.8556, -0.4281, - -0.4965, -0.9996, 0.8845, 0.9602, -0.9983, 0.9460, 0.0000, 0.0000, - 0.0000, 0.0000, 0.0000, 0.0000, -0.9776, -0.9818, -0.2740, -0.6920, - 0.9529, -0.8501, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, - 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000}; - -float all_ones_yh[] = {-0.9776, -0.9818, -0.2740, -0.6920, 0.9529, -0.8501, - -0.4965, -0.9996, 0.8845, 0.9602, -0.9983, 0.9460, - 0.0133, 0.2241, -0.2675, -0.3001, -0.0715, 0.5097}; -} // namespace RNNSequence_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RNNSequenceBatchwise.ref.hxx b/tmva/sofie/test/input_models/references/RNNSequenceBatchwise.ref.hxx deleted file mode 100644 index affc3913be9ec..0000000000000 --- a/tmva/sofie/test/input_models/references/RNNSequenceBatchwise.ref.hxx +++ /dev/null @@ -1,14 +0,0 @@ -namespace RNNSequenceBatchwise_ExpectedOutput { -float all_ones_y[] = { - -0.0160, -0.1818, -0.0401, -0.0794, 0.1761, 0.0137, -0.4409, -0.5119, - -0.1651, 0.0995, 0.8556, -0.4281, -0.9776, -0.9818, -0.2740, -0.6920, - 0.9529, -0.8501, -0.1869, 0.8827, -0.6948, -0.2732, 0.4479, 0.9408, - -0.4965, -0.9996, 0.8845, 0.9602, -0.9983, 0.9460, 0.0000, 0.0000, - 0.0000, 0.0000, 0.0000, 0.0000, 0.0133, 0.2241, -0.2675, -0.3001, - -0.0715, 0.5097, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, - 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000}; - -float all_ones_yh[] = {-0.9776, -0.9818, -0.2740, -0.6920, 0.9529, -0.8501, - -0.4965, -0.9996, 0.8845, 0.9602, -0.9983, 0.9460, - 0.0133, 0.2241, -0.2675, -0.3001, -0.0715, 0.5097}; -} // namespace RNNSequenceBatchwise_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RangeFloat.ref.hxx b/tmva/sofie/test/input_models/references/RangeFloat.ref.hxx deleted file mode 100644 index 2412befc7c47b..0000000000000 --- a/tmva/sofie/test/input_models/references/RangeFloat.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace RangeFloat_ExpectedOutput{ - float outputs[] = {1., 3., 5., 7., 9.}; -} // namespace RangeFloat_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/RangeInt.ref.hxx b/tmva/sofie/test/input_models/references/RangeInt.ref.hxx deleted file mode 100644 index 483b476aacde0..0000000000000 --- a/tmva/sofie/test/input_models/references/RangeInt.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace RangeInt_ExpectedOutput{ - int64_t outputs[] = {1, 3, 5, 7, 9}; -} // namespace RangeInt_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Reciprocal.ref.hxx b/tmva/sofie/test/input_models/references/Reciprocal.ref.hxx deleted file mode 100644 index d5947497a05d0..0000000000000 --- a/tmva/sofie/test/input_models/references/Reciprocal.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace Reciprocal_ExpectedOutput{ - float output[] = {0.7879, -0.8223, 1.5643, -2.2532, 1.2399, 4.9723}; -} diff --git a/tmva/sofie/test/input_models/references/ReduceMean.ref.hxx b/tmva/sofie/test/input_models/references/ReduceMean.ref.hxx deleted file mode 100644 index 9573e9dafd700..0000000000000 --- a/tmva/sofie/test/input_models/references/ReduceMean.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace ReduceMean_ExpectedOutput{ - float output[] = { - 5.0, 3.5, 3.5 - }; -} // namespace Reduce_mean_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/ReduceProd.ref.hxx b/tmva/sofie/test/input_models/references/ReduceProd.ref.hxx deleted file mode 100644 index af259b4c69d06..0000000000000 --- a/tmva/sofie/test/input_models/references/ReduceProd.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace ReduceProd_ExpectedOutput{ - float output[] = { - 25.0, 10.0, 12.0 - }; -} // namespace Reduce_mean_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Shape.ref.hxx b/tmva/sofie/test/input_models/references/Shape.ref.hxx deleted file mode 100644 index 73dff08011afc..0000000000000 --- a/tmva/sofie/test/input_models/references/Shape.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Shape_ExpectedOutput{ - float outputs[] = { - 2,4,6,8,10,12 - }; -} // namespace Shape_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Slice.ref.hxx b/tmva/sofie/test/input_models/references/Slice.ref.hxx deleted file mode 100644 index 2435d9f87475e..0000000000000 --- a/tmva/sofie/test/input_models/references/Slice.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace Slice{ - std::vector input = {0.16892381, -0.92159724, 0.64389044, 1.8697567, -0.8018371, -1.2693683, -2.093365, 1.8541908, -0.26340157, 0.9572909, 0.34671152, -1.7053558, -0.36417124, -2.3248599, -0.13200487, 2.3006496, 0.46386284, -2.1614797, -1.3742889, -0.40108228, -0.5511143, 0.35275838, -0.70952916, -0.41565117, 0.15577549, -0.8660324, -0.31523043, -1.43095, -0.62599516, -1.2735285, 0.74245137, 0.5401528, 1.2080778, 1.9445739, 0.5149316, 0.5683389, 1.6830992, -1.5869702, -0.9276118, -1.8208988, -0.52550256, 0.082054906, -1.0242202, 0.640871, -0.50823563, -0.13035983, -0.7713898, -1.1191769, 0.59570795, -0.06568418, -1.1858853, -0.085937336, 1.0237325, 0.32681447, -1.3751194, -0.28284678, -2.5314686, -0.36053106, 1.3408105, 0.46642232, -0.7184956, -0.5716407, -0.29177785, -0.29941186, -0.08443816, 0.054849386, -0.582217, 0.5512954, -1.2351213, 1.0514443, 0.2601373, 0.2979866, 1.1088992, -0.41123372, 1.2637646, 0.18790472, -0.16448955, -0.61922485, 0.72030956, -1.8054826, 2.739959, 1.515231, -1.1871477, -0.72046477, -0.49725538, -0.3599622, -2.4750538, -0.11285576, -1.1877617, -0.28629062, -0.5285716, 1.9786791, 2.2289317, -1.2789943, 1.3801973, -1.2113228, 0.16036053, -0.4714372, -1.1011868, 1.4348198, -0.15923952, 1.4626329, -0.7119883, 0.7440471, -1.8418623, 0.2772118, -1.2898343, 0.8006727, -0.47921824, 0.35204977, -0.23730946, -0.9184093, -0.44745374, 1.7422614, -1.2565724, 2.1967077, 0.31261623, -0.89821947, 1.8867549, 0.45231855, 0.8269342, 0.032707807, 0.025322068, 1.1288303, -1.4889454, 1.3964689, -1.5560274, -2.1302202, 0.7437271, 1.5007018, -1.3589836, -0.955504, 0.32147405, -1.4642475, -0.12817268, -0.030474393, 1.7738372, -0.38548046, -1.0957392, 1.3144948, 0.2697103, 1.8592813, 0.4777307, -0.6822411, 1.0501494, -0.87983644, -1.7267572, -0.3565207, -1.1379921, 0.7837413, 0.43398347, -0.30728853, -0.00026109006, -2.0815682, -1.1233135, 1.200373, 1.1735791, 0.80191934, -0.40204743, 0.60110134, 1.0514777, 0.71647906, 1.6119534, -0.7692411, -0.13165821, 1.076266, -0.58777434, 2.1273491, 0.5979284, -0.74737847, -0.16932407, -2.6000056, -0.18568534, -1.7186687, 0.38444906, -1.2328393, -1.166593, -0.749837, 0.6540508, -0.48843417, 0.105534576, -0.19924901, 0.39926815, 0.5520011, 0.78686863, -0.88527286, -0.39068756, 0.800181, 1.0539882, 0.82253766, -0.29349077, -0.95323867, -0.7239985, 0.4156427, 0.054603174, 0.46671128, 0.12290481, -0.9419718, -0.9518065, 0.6800318, 0.7334219, -1.4501665, 0.72601205, -0.009272683, -1.5702912, 2.6023812, -2.550537, 0.41290838, -0.0004515256, 0.7949585, 0.10386975, 1.9759881, -0.88904214, -0.20765586, 0.15403232, 0.090678096, -0.20895411, 0.9813557, 1.4583536, 0.08779892, 1.2651963, 0.34579468, 0.70687234, -1.1209601, 1.0646888, 0.20993355, 0.8882366, -0.4729274, -0.84709066, 0.2017297, -1.216628, 0.13039826, -0.61262065, 1.6169266, -0.1344048, -0.62242454, -0.6336179, 0.39012757, -0.826561, 0.008478365, 1.0602465, -1.0957131, -1.5973436, 1.2533009, 1.632353, -1.3100505, 0.51999503, -0.93459845, -1.1390812, 1.7102306, 0.08346745, 1.533848, -0.14334835, -1.1145127, -0.3083682, 0.08911435, 0.8270216, 0.66675997, -1.434103, 0.055906765, 0.18895805, -0.12091928, -0.07631843, -1.1277905, 0.56415355, -0.42068058, -0.43619972, -0.33488145, 0.46014947, 0.060450263, 0.6036779, 2.9487398, 0.14211768, -1.0608279, -0.5405822, 0.6854363, 0.051226616, -0.006617631, 0.27221313, 0.8168545, -1.4345047, 0.15883587, -1.0407009, -1.0776329, -1.4761366, 0.5077002, -0.18065284, -1.3203033, 1.2343279, 1.0788544, 0.95910555, -0.45996368, -1.1551211, -1.0516672, 0.75456, 0.5729106, 2.0468712, 0.95701927, -0.39028248, 0.7682253, -0.32310373, -0.25830054, 0.79827476, 0.64777404, -0.7693852, 0.13818592, -0.21603993, -0.13035135, 0.36271432, -1.3548849, 0.631066, -0.35979733, 2.012173, 0.5632781, -1.5559843, -1.0903429, -1.7130791, 0.6116188, -0.08399546, -0.28317407, 1.5286123, 0.34003162, 0.13574599, 1.8278462, 0.68333685, 1.5154774, 1.0113451, 2.3652873, -0.48571086, 0.16396068, 0.7627067, 0.64387697, 1.0480355, -1.8542932, 0.3824617, 0.2613266, -0.99953574, -0.51782006, -0.6157211, 1.3795184, 0.7554518, 0.95089144, -0.4212272, -1.2846807, -1.3833915, 0.4969849, 0.43599954, 0.83426636, -0.24071422, -0.41247413, 0.1387651, -0.4410387, -1.0201113, -1.0151287, -0.30920383, -0.8524633, -0.78186303, 1.4333282, -0.14950007, -0.089015275, -0.08387725, 1.1056882, -0.1740884, -1.9291706, 0.38982868, 0.6995906, 1.4180859, 0.75444674, -0.95499, 1.1255932, 0.84249365, 0.3965257, -0.91656125, 0.30407417, 0.04821479, -1.7198461, 0.2624329, -0.4283524, -1.4282044, -0.06547159, 0.80487037, 1.1919813, -1.157512, 0.82863224, -0.42936045, -0.28821445, 1.4708856, -1.4182036, 1.0695099, -0.98250604, -0.2871269, -0.30628875, 1.0268122, 0.1077968, 0.3942135, 2.5741844, -0.22341488, -1.2882922, -0.92537004, -0.29827946, -0.8657189, -1.3523725, 1.2271954, -0.97767305, -1.5279788, -2.1684647, -0.8809741, -1.7020837, -0.77671313, -0.30759412, 0.95844865, 0.1201042, -0.35956126, -0.6732596, -0.66489315, -0.23282625, -2.199095, 0.015637554, 0.9093451, 0.6256771, -1.0440992, -1.2953913, -1.1988038, 0.57272595, 1.3343319, 1.5685514, 0.79896367, -0.33781642, 0.108379155, 0.69055647, -0.17776953, 1.1198257, 1.4672221, -0.25398532, -0.1565034, 1.6918836, -0.8700688, -1.1308992, -1.1974417, -1.1137329, 0.83902305, -0.21537443, -0.3621372, -0.56612146, -0.23607141, 0.06558742, 1.5528702, 0.6764845, -0.9899203, -0.24187809, -0.43976098, -0.17901607, 0.39272916, 0.6076459, -0.7449423, -1.1412064, -0.600098, 0.1454072, 0.68503654, 0.5873987, 0.7652769, 0.912399, -0.58995295, -0.07652284, -0.5957174, 0.1472433, 0.5542278, -1.115277, 0.44539738, -0.039799254, -1.5118825, -0.23560798, 1.2844542, -0.02893157, -1.1343006, -0.3527552, -0.9586529, 0.7139522, -1.7368245, 0.2557312, -0.70883536, -0.41837376, -1.4177307, -1.2666334, 0.59642404, -1.461725, 0.029051205, 1.4515164, 1.2521093, 1.2121066, -0.46119824, -0.42757216, 0.21424922, 0.34615174, -0.4361925, 0.90037245, -0.8620516, 0.37771982, 1.0740494, -0.35472628, -1.7184305, -0.10192693, -0.49839312, -1.2606971, 0.898541, 1.611125, -1.8196648, 1.1042156, -0.90353936, -0.042169813, 0.88219213, -1.8153738, 1.0310693, -1.8895094, -0.3627731, 0.73769325, -0.29475728, 0.20184469, -1.0428863, 0.60270995, 1.2704183, -0.061668225, -0.29045984, -0.1823551, 0.26992062, 0.55780077, 0.03529894, -0.7468571, 0.9940811, -0.61718744, -0.8993642, -0.4772598, 0.58771855, -0.8835732, -1.031474, -0.7897231, 0.99002546, -1.3488675, -0.08344488, -1.6553906, -0.49131376, 0.046392173, -0.5849192, -0.93096536, 0.34290412, 0.056457043, 1.3271558, 0.16145127, -1.6025941, 0.8305644, 0.015047411, -0.7772031, 2.4478736, 1.360108, 0.9110892, 1.506102, -0.45487866, -0.060103003, -0.15757999, -0.3803988, 1.4101455, -0.30708334, 1.0538982, -0.8294986, 0.047576066, -1.3256047, 0.45925236, 1.080683, -0.40040824, 1.111924, 0.5593369, -1.3896682, 1.9023105, 0.39116186, -1.1850232, -2.5139296, 1.7266207, -0.25787568, 0.8259598, 0.18016069, -0.49573916, -0.04785415, -0.04976653, 0.18465424, 0.7601481, 0.11443199, 1.3491508, 1.0334013, 0.51608413, -0.54822063, 1.0440209, 0.95839494, 0.35903192, 1.0515867, -0.69485205, 0.1259807, 0.5945902, 0.93981904, 0.8042134, 0.15225424, -1.1134514, -0.14319238, -0.3946564, 1.5849768, 0.32735464, -1.6741558, -1.2463093, -0.53212994, -0.5394611, 0.96027434, -0.03620187, -1.0707031, 0.0770781, 0.73527884, -0.2964921, -0.9622408, 2.6329126, 0.3759397, -0.6592005, 1.1139793, -0.14716254, -0.045174014, -0.6791271, 0.03255666, -1.0424751, 0.9587916, -0.08317592, 0.31456205, 0.1654861, 0.7260626, -0.58481413, 2.1518521, -0.09424311, -0.341701, -1.6353136, -0.17042917, 0.40579286, -0.019979922, -1.0232186, -0.35566926, 1.1416146, 1.2195485, 2.077471, -0.43837976, -0.540069, 0.7379818, -0.19262947, -1.4484813, 0.83212805, -0.74113214, -0.9538223, -0.05834837, 0.44041303, -0.745651, -0.17320694, 0.49808195, -1.5061892, -1.4944872, 0.8008681, -0.9398744, -0.6182817, -0.30942512, 0.36129692, -2.318599, 0.54687035, 0.56182396, -0.06872349, -1.4240448, -0.9996982, 2.5200498, -2.1654541, 0.47496814, 0.39391482, 0.1450314, 1.4216573, -0.04379695, 0.26455754, -1.5143254, -0.85161084, 1.3674622, 0.070562564, -0.07321006, 0.29007795, -1.1730325, 0.7077345, 0.17599413, -1.507193, 0.033037208, 0.6345246, -0.026505666, -1.3673415, -1.175768, -1.11894, -1.1722083, 0.650109, 0.32472748, 0.77097934, -0.91142863, -1.6627023, 0.23963581, -0.34835646, 1.4858739, -0.17808837, -1.4222599, 0.42851982, 0.91185176, -3.1663878, -1.9458324, 0.17138235, 2.7273235, 0.48435047, 1.4257667, -0.39429623, -0.25928524, -0.6969385, 0.27237153, 0.9719653, -0.94499624, -0.93431616, 0.3313879, 0.5322593, -1.0736529, 1.0660676, -0.3857444, 0.24826482, 1.3510975, -0.29179078, -0.48444024, 0.754738, 0.0317517, 0.88101363, -1.43013, 0.19301237, 0.62407196, 2.5889156, -0.35503194, -1.3965347, 1.492098, 1.0243834, 0.2891013, 0.7667233, 1.203408, -0.3896164, 1.1657643, 2.0440407, -0.03122957, -0.44319737, -0.11672504, -0.41915283, 1.3281194, 0.685727, 0.75879604, -0.073904574, -0.33132726, 1.257834, -0.45057672, -0.6296975, -0.9192257, 1.0221746, 0.9291648, -0.94363177, 1.5092527, 0.34648833, -1.2825301, -1.0486758, 1.5055352, 1.8865529, -0.6334556, -0.024593918, -1.1252753, 0.5185867, 0.6124192, -0.037293382, -1.1181691, -2.355505, 0.63034916, -1.0368301, 0.036144637, -1.3204461, -0.8474016, -0.48407465, 0.87706107, -1.6368544, -0.59363234, -0.27536315, -1.3947005, 0.6367079, 0.080906734, 1.6612034, -1.1942811, -1.3962767, -0.3492455, -0.3317619, 0.8585051, -0.6099857, 0.9731934, -0.33863986, -1.1859555, 2.1923492, -0.20945679, -0.019335553, -0.43917775, 0.17868017, 0.0638598, 0.6821277, -0.52001894, 0.29006997, 1.3569279, 0.04126053, -0.3513845, 1.2705727, 0.61468333, -0.51229066, -0.943082, 0.123694554, 0.08704179, -0.85914665, -1.2665237, 0.120996974, 0.5872544, -0.6498738, -0.7558008, 2.0874078, -1.0826503, 1.2161089, -1.1158899, -0.6995301, 1.5182605, 0.9212444, 0.19732377, -0.49805963, 1.5307648, -0.09824258, -0.17579414, 0.3059942, 0.29013804, 1.6369693, 0.68866324, -0.41122213, 1.6944041, 0.84453344, 0.3998347, -0.632812, 0.09177586, -0.7140142, -0.25561154, 0.6781396, 1.4335965, -0.92604005, 0.47844896, -0.48447236, -0.26535156, 0.5610667, -1.5414823, -1.1018133, 0.45464283, 0.8867224, 0.46265063, 0.13983822, 0.62714416, -0.47083634, -0.582377, -0.95651495, 1.4113004, -1.5234841, -0.54477, 1.0616144, 0.86381114, 0.03474352, 0.8896466, -0.76275426, -0.52808905, 1.6884556, 1.2545907, -0.44361708, 0.049262527, 1.7879602, -0.48884976, 0.62784165, 2.0904067, 0.6360781, -0.24506103, 1.8339422, -0.24874923, 0.31993455, 1.6265831, -0.5266883, 1.8444152, 1.0903536, -0.18320195, -0.67846495, 0.27813777, -1.0786334, 0.36553434, 0.18099804, -0.4765761, -0.47241208, -1.6986724, 0.3840502, 1.0583769, 0.9158794, -0.36690733, 1.0359205, 1.5035034, -1.8313702, 1.0422257, -0.0002647597, 1.6137222, -0.8129771, 1.7378803, 1.3767345, -3.097059, -0.23142079, -0.49518618, 0.07198295, -0.47360966, -0.14493094, -0.903153, -0.8566985, 0.35070956, 0.07519327, -0.8176252, -0.5011129, -2.0338905, 2.0791926, -0.9524556, -0.35013407, 0.69216543, 1.8425413, -0.7101777, 0.9166597, 1.373442, 0.8864508, -0.69209445, 0.722764, 1.6853193, 0.43362904, 0.15304323, 1.2292317, 0.571318, -0.03697805, 1.0155749, 0.017713238, 0.61617565, 0.6086641, 0.17308934, -1.0802362, -1.0679781, -0.17226323, -1.079547, 0.36464852, 2.0566635, -1.5955839, -0.708551, 1.0764654, 1.3606769, -2.1782458, 0.12521815, -1.4049494, -1.893154, -0.9671274, 0.20998928, -0.39094374, 0.41292644, 1.0094323, 0.7236309, 0.729022, -0.093239464, 1.331729, 0.12037584, -0.91795444, -2.681229, -0.06648174, 0.32202816, 0.25560144, -1.2391394, -0.5821641, -0.92049783, 0.08570945, -0.024655689, -1.1845642, 1.3647254, 0.90066713, -0.7882246, 0.11265421, -1.1675286, -1.4266101, 0.07994837, 0.22534218, -0.13602129, -0.37254322, -2.8944714, -0.091046974, -0.15506679, 0.5082102, -1.5789851, -0.2162176, -0.51339483, 0.5204938, 0.11788538}; - float output[] = {0.16892381, -0.92159724, 0.64389044, 1.8697567, -0.8018371, -1.2693683, -2.093365, 1.8541908, -0.26340157, 0.9572909, 0.34671152, -1.7053558, -0.36417124, -2.3248599, -0.13200487, 2.3006496, 0.46386284, -2.1614797, -1.3742889, -0.40108228, -0.5511143, 0.35275838, -0.70952916, -0.41565117, 0.15577549, -0.8660324, -0.31523043, -1.43095, -0.62599516, -1.2735285, 0.74245137, 0.5401528, 1.2080778, 1.9445739, 0.5149316, 0.5683389, 1.6830992, -1.5869702, -0.9276118, -1.8208988, -0.52550256, 0.082054906, -1.0242202, 0.640871, -0.50823563, -0.13035983, -0.7713898, -1.1191769, 0.59570795, -0.06568418, -1.1858853, -0.085937336, 1.0237325, 0.32681447, -1.3751194, -0.28284678, -2.5314686, -0.36053106, 1.3408105, 0.46642232, -0.7184956, -0.5716407, -0.29177785, -0.29941186, -0.08443816, 0.054849386, -0.582217, 0.5512954, -1.2351213, 1.0514443, 0.2601373, 0.2979866, 1.1088992, -0.41123372, 1.2637646, 0.18790472, -0.16448955, -0.61922485, 0.72030956, -1.8054826, 2.739959, 1.515231, -1.1871477, -0.72046477, -0.49725538, -0.3599622, -2.4750538, -0.11285576, -1.1877617, -0.28629062, -0.5285716, 1.9786791, 2.2289317, -1.2789943, 1.3801973, -1.2113228, 0.16036053, -0.4714372, -1.1011868, 1.4348198, -0.15923952, 1.4626329, -0.7119883, 0.7440471, -1.8418623, 0.2772118, -1.2898343, 0.8006727, -0.47921824, 0.35204977, -0.23730946, -0.9184093, -0.44745374, 1.7422614, -1.2565724, 2.1967077, 0.31261623, -0.89821947, 1.8867549, 0.45231855, 0.8269342, 0.032707807, 0.025322068, 1.1288303, -1.4889454, 1.3964689, -1.5560274, -2.1302202, 0.7437271, 1.5007018, -1.3589836, -0.955504, 0.32147405, -1.4642475, -0.12817268, -0.030474393, 1.7738372, -0.38548046, -1.0957392, 1.3144948, 0.2697103, 1.8592813, 0.4777307, -0.6822411, 1.0501494, -0.87983644, -1.7267572, -0.3565207, -1.1379921, 0.7837413}; -} diff --git a/tmva/sofie/test/input_models/references/Slice_Default_Axis.ref.hxx b/tmva/sofie/test/input_models/references/Slice_Default_Axis.ref.hxx deleted file mode 100644 index 09fe065ea53f5..0000000000000 --- a/tmva/sofie/test/input_models/references/Slice_Default_Axis.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace Slice_Default_Axis { - std::vector input = {-0.1461883, -0.016122868, 0.7906066, 1.0770687, 0.8330815, -0.10727052, -1.1016161, -0.6145062, -0.7690668, -1.0544336, -0.58136266, 0.6698605, 0.7147375, 0.0022958783, 0.51871574, 0.6482896, 0.3113063, -0.4734845, -0.5740597, -0.9168964, -0.41645914, -0.49598876, 0.09797197, -1.143795, -0.4667988, -0.63560325, -0.09921953, -0.6377913, -1.9445546, 0.28251606, -1.837604, -0.11723251, -0.2457299, -0.14956762, 0.24271688, 0.2885258, -0.41624215, -0.07236863, -0.88772, -0.22259605, -2.3600693, -0.6008399, -0.9242371, -0.7604781, 0.18364549, -1.8932725, -0.3934923, 0.9908918, -0.82707083, 0.037394904, 0.48888022, 0.35733646, -0.69646317, 0.14467147, 2.0875776, -2.1810489, -0.2571033, -0.55144024, 0.2959311, -0.19067906, -0.75172126, -1.2874966, -1.0975883, -0.9559576, -0.49447343, 1.9475956, 0.4257172, -1.0980548, -0.76810384, 0.58064747, -1.7632297, 0.26826766, 1.3453583, 1.2687472, -1.1958207, -0.16609953, -1.5563438, -0.4938013, 0.5151148, -0.091698416, 1.1415159, 0.426471, 0.6566607, 1.1295458, -0.28391364, 0.79970664, -1.5118104, 0.36721396, 1.7975253, -0.73840666, 0.4420629, -2.2546258, -0.061347473, -1.2929934, 0.5170257, -0.06677258, -0.48366687, -0.6352214, 0.3780832, 0.03586758, 0.3670747, 0.6627743, 0.5272325, -1.0584992, -1.4143002, 0.47498345, -0.8205925, -1.8733176, 1.8025477, 0.06656069, -0.7836851, 0.47841695, -1.2978657, -0.006346132, 0.51665795, -1.4770932, 1.0194303, -0.30320534, -1.2961298, -1.9114046, 1.0950881, -0.10367981, 0.23185624, -1.3055613, -0.5437395, 1.1283166, -1.3763173, 0.07796734, 0.14537609, -0.4749371, 0.6209849, 0.19354947, 0.7213671, 1.3833684, -0.15803675, 0.0047794804, -0.22178061, 1.9866813, 1.2574888, 1.8167769, -0.020589387, -1.9657744, 0.17520925, -1.238028, 0.18338954, 0.7720395, 0.28465885, -0.46973786, 0.09582084, 1.6777899, 0.16898789, 0.37088445, -1.0338578, -0.0052072485, -0.57036436, -1.1178404, 0.6796968, 1.6614155, 1.1149341, 0.7587031, 0.32500324, 0.8289195, -1.1860889, 0.552775, -1.5618576, 1.1355617, -0.019234084, -0.053850766, -0.21276851, 0.38202664, -0.92719686, 0.45522645, -1.4462421, 0.39298248, -0.08499029, -0.4432199, 0.7962805, 0.035947476, -1.159359, -0.60213226, 0.6608978, 0.25666326, -1.6058868, -0.14197825, 0.81879604, 0.06913617, -0.68283623, -0.6830012, 0.9924173, 0.738249, 1.4709839, -0.5562903, -0.45345142, 0.44788426, 1.3294722, -0.2009495, -0.47743958, 0.30325928, 0.28618523, -0.44166443, -1.2473358, 0.24071434, -0.07651104, 0.13556144, 0.6775791, 0.05754586, -0.37290746, 0.9709312, 0.40250617, 0.57110745, -0.4984228, 1.7988355, -0.16423433, -0.6757791, 0.6791431, 1.0340523, 1.9974663, -1.1417656, 0.15521769, -1.6735531, 1.2924621, -1.7712533, 0.31316996, -1.1286432, -0.16561612, 1.4077295, 1.7806652, 1.6394432, -0.26378694, 0.083979696, 1.0437967, -0.1325788, -0.09308595, -2.7445931, -0.9295771, -0.13040234, 0.39286298, -0.23240566, -0.15136135, -1.1185503, 1.5185101, -1.2777773, -1.0749928, -0.69080085, 0.039009497, 1.4085402, -0.45465285, 0.29640433, 2.3633902, 0.38267857, 0.0032249314, 1.0855026, -0.64048296, 0.124470204, 0.017325122, 0.695519, -1.0086539, -1.0865158, -1.5793724, -1.1726278, 1.1974345, -0.6120161, 1.3437238, 1.7283806, -1.3011041, -0.166229, 1.9684845, -1.2849504, -0.017190017, 0.5633989, -2.1813452, 0.19855276, 0.15585509, -0.2397429, -0.07259906, -0.18117818, -1.435192, 0.5535545, 0.91788614, 0.9611421, 0.27218357, -0.8193188, -1.6022354, 1.4913019, 0.07563583, 1.191209, 1.1098686, 1.4217767, -0.062174533, -1.0004618, 0.35559297, -0.29587275, 1.224246, 0.27928728, 1.4012953, 0.004571245, -0.004811227, 0.6884962, -0.31340042, 0.7118886, 0.8218903, -0.6128678, -0.49580857, 0.52445906, -0.15825763, 1.093557, 0.5337642, 0.9011482, -0.85576683, 0.345507, -0.10933566, 0.21388091, -0.7470893, 1.115657, -1.0193942, 1.3795731, 0.16783884, 0.4803627, 1.2138109, 1.762632, -0.55953956, 2.3835013, -0.07254272, 1.2885357, 0.6622172, -1.0122503, -1.8009477, 1.5157818, 0.8476051, 0.13299866, -2.3853347, -0.06983959, 0.49273565, -0.87671894, 0.12512384, -0.82879865, -0.9572407, -0.32495856, 0.06101727, -1.1533537, 0.020594995, -0.9918277, -0.81584674, 1.5852944, -0.5340633, -0.40271887, -0.3721054, -0.005816021, 0.6088237, -1.0743963, 0.88497263, -0.37899604, 0.50920826, -0.88503253, -0.673719, -0.92704546, -0.9064568, -0.5845781, -0.2365786, -0.97428477, -2.083304, -0.22934851, -0.5516302, -0.69631237, 0.36876953, 2.0252135, 0.74653697, 0.5618036, -0.44255832, -0.67436403, -1.0235599, 0.789049, -0.12523027, -2.2393558, 0.14112401, 1.3160639, 0.5901369, -0.008300025, 0.04022059, -0.6193368, 2.676356, 0.73500293, 0.8828043, 1.7149053, -1.2272266, -0.38595983, 0.9880927, 0.28173974, 0.09567761, -0.99841386, 0.55506814, 0.04364348, 3.0956612, -0.39753824, 0.6281927, -0.24912265, 1.2875627, -0.33991942, 0.080732696, 0.6423637, -0.4085811, -1.2270579, 0.27428335, -1.2284294, -1.7676984, -0.9863669, -0.60794735, 0.35996225, -0.83115405, -0.10226897, -1.1846787, -0.9867668, 0.09014541, -0.46956572, 2.334743, 1.1283133, 0.47274005, 0.7801183, 0.20632647, 0.53270394, 1.618369, -0.68861, 1.5393575, 1.0087231, 0.5578767, -1.1502749, 0.9704601, -0.58556443, -0.8638071, 1.6273997, -0.6914098, -1.1505114, 0.22683571, -0.3346126, -0.2779381, 0.44256505, -2.2296052, -1.1183658, -0.25026667, 1.5899142, -0.9656592, -0.52585506, -2.2984645, -0.913809, 0.809646, 1.3930463, 1.5980829, 0.5588279, -0.1415989, -1.0977601, 1.0027899, -0.8581, -1.4768612, -1.6114205, 0.55412006, 0.5285257, 0.07860353, 0.8938196, 1.3999463, 1.6992323, -0.88001025, -0.14953178, 2.8698957, 0.6424969, -0.41471675, -1.9350584, 1.3093637, -0.34622955, 0.35268912, -0.7348358, -0.1637814, -1.217533, 1.7498442, -1.3902655, 0.9558796, 2.215649, 0.4073312, -0.24630588, -0.4336063, -2.1483955, -0.9822753, -0.24802127, -1.9440368, -0.14923008, -0.106288746, 1.3390882, 0.29155636, -0.010580624, -1.6630732, 0.21212313, -0.9744938, -0.93469507, 1.5370817, 0.9331293, -0.6155238, 0.77781016, -1.360782, -0.02083951, 1.6073259, 0.8050398, 1.15108, -1.0778083, -0.29364675, -1.3154548, 1.3826702, 0.83120215, 0.3349555, 0.108244404, 0.0056229704, -1.2478333, -0.30873495, -0.15155567, 0.5545185, -0.17677861, 0.35164872, 0.20997967, 1.397111, -0.56422126, -1.5136795, -1.032756, -0.59829795, -0.392903, -2.4636624, 0.25544158, -0.59832823, -0.7234389, -0.6978005, -0.8573432, 0.12969226, 0.5464562, -0.16188233, 1.380535, -1.0571035, 0.51674634, -1.4579222, 1.5115775, -1.0869778, -0.13404822, -0.5940917, 1.2037292, -0.32398605, -0.29220906, 1.0000731, -0.63900346, 0.24358685, 0.65689164, -0.10265587, 0.6322214, -0.0917442, -0.3694211, 0.93206906, 0.45265195, -0.87861097, 1.6871637, -1.2518704, -2.3056078, 0.9769796, 0.038062252, -0.46498087, 0.8485326, -0.839546, 0.28043613, 2.573216, -0.29004475, 0.31579295, 0.7601751, -0.8611639, -1.9155579, -0.14570755, -0.4572656, -1.6403922, 1.269364, -1.2096163, -0.13851365, 1.0688369, -0.043349892, 0.97961247, -0.29044124, 1.324035, 0.4427559, -2.4195874, -0.05904026, -1.047782, 0.34742212, -0.59459364, 2.2101438, -0.6710455, -0.7346976, -0.19578286, -0.3006533, -0.4168783, 0.11194632, 0.4166033, 0.73106396, 1.5515249, -2.4722917, -0.7615553, 0.775932, 0.40671185, 0.92429924, 1.0650808, -1.5915896, 0.23377, -1.4564233, -0.5552662, 0.7849949, -0.052568533, 0.2778592, 1.3305982, -0.9056904, -1.0874093, 0.6774261, -1.4075345, -0.6792449, -1.9145862, -0.36068064, 0.9614725, 0.7049456, 0.85817826, 1.516153, 1.0643967, 1.2125771, 1.0095186, 0.18826225, 0.17524572, 0.9800971, -0.05518548, 0.76132685, -1.1523248, 0.95912564, -0.8287138, -0.230913, -1.9400084, -0.9241041, -0.4996432, -0.20880367, -0.58793384, 2.5016222, -0.5362384, 0.6342494, -1.6295053, 1.1614339, 0.3722488, -0.9641267, -0.4324223, 0.5987431, -0.09008133, -0.72262436, 0.34580615, 0.54369086, -0.04141991, 0.5681258, -0.024746062, -0.22176632, 1.6875525, -0.8856508, -0.5093772, 0.16131109, 0.13457753, -0.5028758, 0.48031703, 0.34559208, 0.40866286, -0.8627139, -0.43610817, 0.1370359, 0.71395236, 1.0733443, 0.9591038, -1.2339122, 0.51710594, 1.6181912, -1.1786822, -0.49682978, -0.73324996, -0.90021396, -0.917064, -0.82882273, 0.54618657, -0.35091722, 0.18635193, 0.28404334, 0.7419349, 0.22317982, 1.5418407, -0.59588146, -2.2045953, 0.5704977, -1.3579642, 0.6766229, -0.7265069, 1.1195977, -0.05751021, -0.88166755, 1.6513765, 0.83279973, -0.7335223, 0.77010125, 0.106006265, -0.50255, 0.500598, -0.8823614, -0.8286727, -0.7444291, -2.1645043, 0.15058456, 2.1300547, 1.3322825, 0.08238974, 0.47212347, 0.0971547, 0.34920275, 1.14977, 0.2660158, 0.14294139, -0.1682589, -0.2658644, -1.1637232, -0.8218067, 0.9199889, 1.0239819, -0.70528126, 0.0060127624, -0.24274509, -0.65451324, -0.38401487, 1.2616978, 0.3047205, 0.19565456, 0.9565755, -0.014404449, -0.42572787, -0.27978837, -0.86642414, 0.8405607, -0.15055239, -0.16638431, -1.9672482, -1.9616699, -0.058524407, 0.52005005, 1.6248668, -0.6036527, -1.1067222, 1.4944029, 0.21208148, -0.71202946, 0.08290248, -2.2786183, 0.04106648, -2.1124837, 0.11604868, -0.50486493, -1.7176164, 1.7939253, 0.9316365, 1.0395255, 1.3111675, -0.32554156, 2.610884, 1.0958631, -0.13374676, -0.88248503, -0.47524875, -0.5697381, 2.2536426, 0.57177734, 0.089711525, 0.09203127, -0.31630644, 1.4399436, 0.87644094, -0.9510531, 2.1558537, 0.7398341, -0.7479294, 1.6116168, 2.2608933, 0.6935909, 1.8886098, 1.4206983, 0.6459501, -1.4992285, -0.40028575, -1.397525, 1.4820021, 0.69096315, 1.040845, 0.7248607, -1.5581473, -1.163343, 1.0534998, -0.13074964, -1.3512405, 1.7234086, 3.1778047, -0.7669222, 0.2769623, 0.11744058, 2.13683, 0.21798563, -0.37044996, 0.38857397, -0.8483964, -0.38422018, 0.49951142, 0.028199164, 0.9054906, 1.4535757, 0.92591554, 0.53013515, -0.25900427, 0.5950167, 1.3598921, 0.006420622, 0.1600974, 0.0067178584, 0.16290559, 1.33563, -0.3311576, 0.7935676, -0.36323825, -0.18903373, -2.2316182, 0.28740197, 0.006179229, 0.71337485, 0.8837852, -0.20782436, -2.2476697, -0.5218193, -0.33238944, 0.2537466, -1.370611, -1.7223306, 1.5160371, 0.027803194, -0.32390642, 0.3986786, 1.1172193, 1.558993, -0.6832563, -0.20899004, 0.94750255, -0.38843265, 1.1702619, -0.5910523, 0.67201364, -0.23071921, -0.32311478, -0.29928425, -1.4202323, -1.0467842, -0.33493733, -0.06345067, -0.20013566, -0.5673482, 0.3535591, -0.5701964, -1.132469, 0.44864315, 0.28851375, -0.87927747, -1.0867138, 1.7710389, 0.99955666, 0.04848535, -0.6760312, -1.5226128, 0.17691953, -0.55969036, 1.5326198, -1.1423959, -1.0857098, -0.38307127, -0.108541355, 0.6333991, -0.67143476, -0.7309363, -0.8394637, -2.3495052, 0.4552111, 0.694442, 0.88670564, -0.8066063, -0.9832314, 0.5582432, -1.9541792, -0.44915298, -0.8806987, -2.1678388, -0.40057325, 1.402311, -0.749579, 0.9779166, -0.9725332, 0.93724334, 0.7930738, -0.3815982, 0.52829677, -0.59715456, 0.4632079, 0.09168929, -0.64770544, 1.789374, -0.4414639, 1.5570718, 1.2062063, 0.34104025, -0.34750745, 1.6979355, 1.7266192, 1.1891768, 1.5133071, 0.53370464, 1.5988535, -2.4613225, -1.6933792, -0.8667333, 0.7052899, -1.4491802, -0.015342939, -1.3674146, -1.56072, 0.16171443, -1.5806398, 0.4695208, 0.8821774, 0.5689583, 2.1032276, -0.5122946, -0.050347406, 0.3566521, -1.0292819, 0.8163361, 0.89640504, 0.86676586, -0.13297859, 0.24916588, -1.4969269, -0.118957415, 0.12848116, -0.825286, -0.6712518, 0.039900694, 0.19978356, 0.14676023, 0.74267155, 0.70510364, 0.22815554, -0.21663566, -0.80683714, -1.1868128, 0.9666372, 0.22554556, -0.86386347, -0.31636468, 0.8181482, -0.5027156, -1.053451, 1.7066551, -1.261419, 0.075614035, -0.24103126, -0.0016349248, 0.10319547, 0.9757924, 0.5693857, -1.2953516, 0.915416, 1.1547158, 0.56889296, 1.6462102, -0.6902782, -1.8096964, -1.3979508, 0.98242086, 1.4752377, 0.06406855, 0.20497032, -0.28602636, 1.7617588, -0.1947333, -0.011363344, 0.18868288, 0.8202959, 1.5982426, 0.02868123, 0.1815656, -0.6364113, -0.93385684, -1.7666136, 0.2698049, -1.2644852, -0.35387158, 0.93788034, -0.017734949, 0.74502975, -0.09487202, 0.6416881}; - float output[] = {1.0770687, -0.7690668, 0.0022958783, -0.5740597, -1.143795, -1.9445546, -0.14956762, -0.88772, -0.7604781, -0.82707083, 0.14467147, 0.2959311, -0.9559576, -0.76810384, 1.2687472, 0.5151148, 1.1295458, 1.7975253, -1.2929934, 0.3780832, -1.0584992, 1.8025477, -0.006346132, -1.2961298, -1.3055613, 0.14537609, 1.3833684, 1.2574888, -1.238028, 0.09582084, -0.0052072485, 1.1149341, 0.552775, -0.21276851, 0.39298248, -1.159359, -0.14197825, 0.9924173, 0.44788426, 0.28618523, 0.13556144, 0.40250617, -0.6757791, 0.15521769, -1.1286432, -0.26378694, -2.7445931, -0.15136135, -0.69080085, 2.3633902, 0.124470204, -1.5793724, 1.7283806, -0.017190017, -0.2397429, 0.91788614, 1.4913019, -0.062174533, 0.27928728, -0.31340042, 0.52445906, -0.85576683, 1.115657, 1.2138109, 1.2885357, 0.8476051, -0.87671894, 0.06101727, 1.5852944, 0.6088237, -0.88503253, -0.2365786, -0.69631237, -0.44255832, -2.2393558, 0.04022059, 1.7149053, 0.09567761, -0.39753824, 0.080732696, -1.2284294, -0.83115405, -0.46956572, 0.20632647, 1.0087231, -0.8638071, -0.3346126, -0.25026667, -0.913809, -0.1415989, -1.6114205, 1.3999463, 0.6424969, 0.35268912, -1.3902655, -0.4336063, -0.14923008, -1.6630732, 0.9331293, 1.6073259, -1.3154548, 0.0056229704, -0.17677861, -1.5136795, 0.25544158, 0.12969226, 0.51674634, -0.5940917, -0.63900346, -0.0917442, 1.6871637, -0.46498087, -0.29004475, -0.14570755, -0.13851365, 1.324035, 0.34742212, -0.19578286, 0.73106396, 0.40671185, -1.4564233, 1.3305982, -0.6792449, 0.85817826, 0.18826225, -1.1523248, -0.9241041, -0.5362384, -0.9641267, 0.34580615, -0.22176632, 0.13457753, -0.8627139, 0.9591038, -0.49682978, 0.54618657, 0.22317982, -1.3579642, -0.88166755, 0.106006265, -0.7444291, 0.08238974, 0.2660158, -0.8218067, -0.24274509, 0.19565456, -0.86642414, -1.9616699, -1.1067222, -2.2786183, -1.7176164, -0.32554156, -0.47524875, 0.09203127, 2.1558537, 0.6935909, -0.40028575, 0.7248607, -1.3512405, 0.11744058, -0.8483964, 1.4535757, 1.3598921, 1.33563, -2.2316182, -0.20782436, -1.370611, 0.3986786, 0.94750255, -0.23071921, -0.33493733, -0.5701964, -1.0867138, -1.5226128, -1.0857098, -0.7309363, 0.88670564, -0.44915298, -0.749579, -0.3815982, -0.64770544, 0.34104025, 1.5133071, -0.8667333, -1.56072, 0.5689583, -1.0292819, 0.24916588, -0.6712518, 0.70510364, 0.9666372, -0.5027156, -0.24103126, -1.2953516, -0.6902782, 0.06406855, -0.011363344, 0.1815656, -1.2644852, -0.09487202}; -} \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Slice_Default_Steps.ref.hxx b/tmva/sofie/test/input_models/references/Slice_Default_Steps.ref.hxx deleted file mode 100644 index 15b88b5959627..0000000000000 --- a/tmva/sofie/test/input_models/references/Slice_Default_Steps.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace Slice_Neg { - std::vector input = {-0.8470076, -0.617558, 0.024568161, -0.54007053, -0.5732189, 1.0910312, 0.51959157, -0.073640585, -0.60885113, -1.8285086, -0.9326965, -0.3021695, 1.066226, 0.8134058, -1.5457271, 1.1948874, -0.04176423, -0.59385985, 0.011908118, 0.095879026, 0.6736443, -0.48068637, 0.11451639, 1.5323228, -0.8184595, -1.4535367, -0.06812811, 0.71712196, 2.4668334, 0.3803238, 1.5602548, -2.1309204, 2.8248832, -1.3176224, -0.6582828, 0.73314184, 1.8034855, -1.6781946, -0.23040803, -1.3201909, -0.24954909, -0.34502414, -0.7355865, -0.41729373, 0.5724887, 0.71088016, 0.8767546, 0.61704224, 0.25664437, 0.5908548, -0.60789496, 1.0349115, 0.46317944, 0.17278059, -0.78425044, -0.11165529, 0.7919961, 0.35827583, -1.9887244, 0.12787221, 1.095776, 0.28236288, 0.48224112, -0.5900752, 0.9498589, 0.5209434, -0.57806545, 1.3280295, -0.6969055, -2.539957, -0.0030387403, 1.871011, 0.13415621, -0.5734313, 0.09759699, -0.29701954, 0.9157297, -0.62670755, 1.2683886, -0.7024728, 0.6662447, 0.46600792, -0.494909, 0.8643152, -1.2757068, 0.8424522, 0.9383413, 0.49222285, 0.11790963, 0.57665557, -0.2206793, -1.2813573, -1.4700212, 1.9633232, 0.5646655, 0.04624529, 0.5216187, -0.8490203, 0.0040446366, 1.6275132, 0.15718703, -1.256212, 1.7298958, -0.4105028, 0.6821366, -0.72149056, -0.27424803, 0.19525297, 0.5027373, -1.0273383, -0.42891493, 0.31214187, 0.3240255, 0.6148003, -1.4785552, 0.79766524, -1.3977971, -1.9163635, -0.4596946, 0.4611778, 0.4615138, 0.57446766, -1.8127673, 1.0151784, 0.79838765, -0.16945624, -0.29454982, -0.22049658, 1.0656692, 1.9895301, -1.6840646, -0.0068151196, 0.29346943, 0.8048959, 0.50557023, -1.8385066, -0.4750251, 0.3583206, 0.41981372, -0.3146262, -0.79544896, 1.6337428, 1.4349604, -1.5252166, -0.91220444, -0.42145732, -1.4244072, -0.44793433, -1.494974, 0.074361734, 0.7527505, 0.6034745, 0.08402507, 1.0259006, -1.1905016, 0.52963644, -0.6864299, -0.15308455, 0.9455237, 1.000834, -1.828627, -0.5953371, 0.61878735, -2.7202675, -0.13529402, -1.1603078, -0.28340778, 1.6124189, 1.48123, -0.032326907, -1.5110354, -0.60052997, -0.98667, -0.026620502, 0.9869495, 0.9609994, 1.8000636, -0.39040756, 0.662662, -0.35303995, -0.10898638, -0.097712174, -0.13256012, -0.30892372, 0.9536066, 1.0131402, -0.21144608, 0.9224201, -1.2749323, 0.12289531, 0.6637511, 0.0252969, -0.058163885, 0.6347488, 0.13144295, 2.8548353, -1.0804298, 1.3999987, 0.18585795, 0.6911652, 0.29648793, 1.6838806, 1.4852757, -0.29899225, -2.699224, 0.22093739, -0.63045704, -2.3597014, -0.9839067, -1.0647969, 0.8293971, -0.7054954, 1.7537973, 0.22664751, -0.1311305, 0.50954145, -1.7052051, -0.42696014, -0.5314228, -0.56175625, 0.6429764, 1.3670748, 0.46155804, -0.7046119, 0.060639046, -0.113631465, 0.17838268, -0.084968045, 0.67876095, 0.6301664, 1.2548337, -0.2446083, -0.092792444, -0.42515463, -1.0051632, -0.5343044, -0.25070238, 1.3654076, -1.1015171, -1.5554606, 0.62512356, 0.36090285, 0.43128428, 0.097997755, -0.3924458, 1.1851805, 0.2851699, -1.9355323, -1.8260921, -0.57449347, 0.27789333, -1.1954387, 0.22248776, -1.6744449, -1.2109405, 1.0672655, 0.95568365, 0.8194465, 0.15550855, 0.3167771, 0.22519737, 1.2998043, -0.31728703, -0.5346176, 0.907684, -1.5638523, -1.1844252, -0.2738023, 0.051613424, 0.2711231, -2.3651042, -0.44602147, -0.44494528, 0.8535133, 0.24942228, -1.0080348, 0.85422933, -0.48436078, -1.3689119, -1.3511016, -0.48757446, -0.032849748, 0.22983012, -0.032983564, -0.71215105, 0.18651846, -2.0692394, -0.57982725, 0.2421949, -0.004737948, -0.90421754, -0.78182286, 0.12858658, -0.30840445, -1.2161031, 0.26198965, -0.39037564, 0.16168776, -0.4814354, 1.2001693, 0.6076416, -0.8430386, -1.486868, -0.18519744, -0.5284652, -0.5890602, -1.3699012, 0.3797034, -0.6210796, 0.34635258, 0.97299594, -0.73827547, 0.06458698, 0.118863635, 0.5199116, 1.0428258, -0.9279422, -0.86735195, -1.1641119, 0.7890661, -0.13334043, 0.965089, -0.38214856, -0.4918111, -0.5547398, 0.42891094, 1.3179172, 1.3215472, 0.6549405, -0.35108355, -0.053067066, 1.0250593, 0.56519455, 0.62243444, 0.94297016, 1.444416, -1.0421168, -1.2815233, 1.5802842, 1.058067, 1.5861386, 0.2678979, 0.611768, -0.9184742, -0.50267774, -0.18283916, -1.0322441, 0.49051848, 0.23566997, -0.42865896, 1.3114626, -0.8547099, -0.7508762, 0.97122836, 0.83569074, -0.8890005, -1.3588058, 0.52090734, 0.6599851, -1.1082011, 0.6431001, 0.20303106, 1.0637558, -1.6201593, -0.340904, 1.4634577, -0.8336172, -0.8939236, 1.6814111, -1.4717578, -0.10118986, -1.2259562, 1.5268134, 0.5433005, 0.22572087, -1.4068099, -0.4178259, 0.58685875, -0.05888392, 2.8919656, 1.6086674, 0.03694556, -1.1663972, 1.8105648, 0.29895756, 1.8874907, -0.7695107, 0.5690569, 0.030703884, 0.751468, 0.6750975, -1.3655664, 1.1141645, 0.7864459, 0.3947739, 0.03917306, 0.05810123, -0.11991168, -1.729456, -1.5321412, 1.1202441, -0.60260165, -0.47422236, -0.8188005, -0.9895167, 1.1552737, 1.0952479, 0.229527, 0.29695028, -1.6278256, -0.34756196, 0.40587282, -0.2820706, -0.7547495, -0.9610026, -1.7018858, -0.3924324, 1.079949, 0.8248382, 0.94413376, -1.1566157, -0.9842801, 1.6253854, -1.1643112, -0.031547185, -1.3878396, 1.7543691, -0.29027265, -0.013875638, -0.6859403, 0.6589252, -1.2933903, 0.1164802, 0.39297175, -0.11103736, 0.337499, 0.45827693, 1.8881621, -2.3753831, -0.53132796, 0.40727693, -0.2953328, -1.1905057, -1.7966558, 0.22342315, -0.9290645, 0.021880161, 0.13581035, 1.1365031, 0.6181001, 0.713041, 1.293023, 1.3513365, -0.6619178, 2.7537708, -0.43479046, 1.5873258, 0.6956605, -1.9825284, 0.4805659, -1.5420442, 0.08287144, 0.5063851, 0.40049914, 0.075521916, 0.046996634, -2.108652, -0.21822332, -1.1524743, 0.36947966, 0.9477517, -1.1086196, -0.88682616, 0.70022494, -0.986827, -0.1266721, 1.0552126, -0.032320406, 0.030530429, 0.3426037, -0.7678068, 1.5853431, -0.29916266, 0.16663021, 0.3103334, 0.5508472, -1.029247, -0.17085668, -1.2482865, 0.4678677, -0.7913232, -0.4546694, -0.3316058, -1.3343717, 0.015012662, 0.15274923, -0.9795487, -0.7544606, -0.5374836, 1.0032166, 1.3695817, 0.4196725, 0.9586006, -0.6572966, 0.92550796, -0.18838528, 0.03506735, -1.3085735, -1.8863217, 0.8283637, -0.049647644, -1.8473711, 1.2152774, 0.7069548, 0.57567924, -0.5769207, 0.004103885, 1.0740294, -0.6685727, 0.06981487, -0.442179, 1.2116009, -0.73983926, -1.0080059, -0.5856949, 1.263791, 0.75989074, -0.89122176, 0.4892265, -1.2846144, 1.6389104, -0.74073213, -2.5086443, 0.24558564, -2.191976, 0.9695048, -0.73659486, 0.4528519, 1.0352287, 0.91434026, -0.41227826, 1.1801821, -0.5871047, 1.2012802, -0.09350611, -0.65246624, -1.9699491, -0.88186216, -1.8445245, 0.600799, 0.9312934, -0.748986, 0.762986, 0.29536536, 1.5785195, 1.2566115, 0.6400792, -0.3231401, -0.54415464, 0.74289376, -0.5117031, 0.41670632, -0.75640124, 0.7170347, -1.2117789, -0.8108696, 0.6399255, -2.0755427, 0.7917815, -0.7693288, -0.11855151, 1.1035497, -0.7230254, 0.14678578, 2.1342237, 0.20335588, 1.6858623, 0.9036143, -1.3462288, 1.6330013, -0.23667838, -0.62839717, 0.5073823, -1.1040329, 1.8166281, -0.33216733, -1.1290957, -1.484877, -2.5237038, -0.13954702, -0.26784393, 0.31558135, -0.3871223, 0.64323556, 0.5781996, -0.24147224, -0.09671755, 1.8780855, -0.527801, 0.6255921, 0.3025445, -1.5513139, -0.38770792, -0.71166915, 0.9644843, 1.5589895, -0.41667962, 3.0079024, 0.21589102, 0.68024695, 1.0425457, 0.1675615, 1.2254218, -0.11186006, -0.21831718, 0.030340586, 0.6445724, 0.8555139, -0.30397046, -0.7371216, -0.3673983, -0.12570697, -0.63791007, 0.5487183, 0.3812071, -0.7880577, -0.07703689, 2.145892, 0.040550653, -1.1552556, 0.8339612, 0.35333186, 0.8113544, 0.9471309, 1.8389242, -2.1920223, -0.8024482, -0.75866145, -0.46682125, -0.291485, -0.56249285, -0.6120222, -1.3763278, -0.4043958, -0.167957, -2.0174806, 1.0753703, 1.4874343, -0.96017367, -1.1698335, -0.1857909, -0.67057425, 0.04790106, 1.3035606, 0.4013939, 0.84132683, -0.7301506, 0.03734765, 0.12839374, 0.59680045, -1.4596658, -1.9846171, -1.3339622, -0.928884, 1.0592812, -0.08096708, -0.3560848, 0.17055984, 0.44089505, 1.0143852, -1.2609717, 0.39403346, 0.15323427, -0.20655632, 0.2729617, -0.017258333, 0.21113883, -0.037135277, -0.3795276, 1.8731954, -0.95502555, -0.047084603, -1.8833874, -0.17380746, 0.53410834, -0.37984794, -0.83650166, 1.3657289, -0.9089595, 0.11723666, -0.691051, 0.058711946, -0.3596759, -0.5994914, -0.82318157, 0.4013819, -1.2878338, 1.4384826, -1.196757, 0.86787546, -0.8170519, 1.0645616, 0.35892066, 0.16686276, -0.020305071, -0.8255187, 0.39803553, 2.157575, -0.18023075, 1.1010606, 0.14643395, 1.1315295, 0.9770161, 0.42666945, 0.27146822, 0.732228, 0.39469486, -0.84413946, -0.90971494, 0.6502484, -0.16056834, 2.1572785, 0.24662192, 0.66400963, 0.14993827, -0.3131849, 0.6960484, 1.3728433, 0.2414029, 0.32461792, -0.25270006, -0.5310546, 0.44632587, 0.72279614, 1.0306181, 0.6859314, -0.9765316, -1.661137, 1.7164898, 0.2669273, -1.0952786, 0.10285393, -1.5112151, 1.3984389, -0.33049527, 0.086646505, 1.99051, -0.7867809, -0.02740572, -1.0844429, -0.38896164, -0.06757384, 1.1891596, -0.5182803, 1.4854476, 0.68765616, 0.05129343, 0.92384857, -0.04301777, -0.6649576, -0.41715017, 0.596572, -1.9418277, -1.151948, 0.07984562, 0.6323108, 0.63117504, 0.38132355, 0.76422507, -1.071917, 0.46144056, -1.1519856, 0.51360416, -1.2658279, -0.7383204, 1.1194702, 0.37442186, -0.59131896, -0.8329332, 0.41315868, 0.49044436, 1.4959744, -0.25459176, 1.9797194, -0.3676517, -0.7006123, -1.5376753, 2.7518427, 0.4352582, -1.1831497, -0.47213498, -0.53300947, 0.31342745, 1.1631571, 1.0107048, 0.43390697, -1.8759046, -0.74681604, -0.24300711, 0.9583661, 1.8207945, -0.8047002, 1.5142735, 0.06101127, -0.8167485, 1.341735, -1.9998361, -0.31037384, -1.9361457, 2.6424568, 1.7161232, -0.81243795, 1.4176836, 0.46120012, -0.10861592, -0.37943932, -0.53604156, 2.5376189, 1.9996238, 0.37519363, 1.3202821, -0.033361, -0.18681939, -0.64312565, 0.08054325, 0.22469059, 0.49264678, 1.2246869, -1.5528489, 0.7257059, -0.27520436, 1.1922318, 0.23851508, -0.29716906, 0.87747645, -0.26529908, 1.2344409, 2.0770943, 0.33405286, 1.5167257, -0.4284246, -0.6981646, -0.11194946, -0.2014947, -0.06963122, -0.06063814, -0.7429915, -1.9737889, -0.23421544, 0.32240874, -1.3905734, -0.02160562, 2.0077162, -0.70806885, 0.6858733, -0.073999576, 0.58822834, 1.0689219, 0.4202779, -1.8052489, 0.8980629, 1.0188261, 0.24025117, 1.1279254, -2.096736, 0.86583626, 1.0729425, -1.3586196, -0.43458986, 0.85325885, -1.3032721, 1.519603, -0.30039188, 0.011318408, -0.22466156, -0.004637025, 0.20317583, 0.101351805, 0.46223554, 1.6066155, -0.3497661, 0.31206778, -0.16919272, 2.5479598, 0.23946035, 1.0384718, -0.028765468, -0.7647152, -0.1882574, 0.39373857, -1.1616229, -0.15314704, -0.41924948, 0.31844574, -1.4991366, -0.6800134, -1.8221868, -0.13502005, 0.7068314, 1.4567363, -0.29855722, 0.05235714, 0.02478114, 0.13136047, 1.0196488, -0.779426, 0.020566413, -0.8152667, 0.32418823, -0.6030918, 1.3635833, 0.40278813, 0.0014983298, -0.05041781, 0.76405966, -0.6163368, -1.472155, -0.1951552, -0.32755968, -0.22645734, 1.4022243, -0.40418622, 0.7907749, -0.13738912, 0.420996, 0.03924503, 0.62669563, -0.06643237, -1.3050407, 0.16855282, -0.05330854, -0.34347278, -0.06536905, -1.7360572, -1.1509646, 1.3281381, -2.525531, 1.2429549, 0.14453362, 0.2398615, -0.6806504, 0.81042314, 1.4116533, -1.1112533, -0.2704999, 0.7653411, -0.16361058, -0.6862728, 0.9865363, 1.7095964, 1.1570653, -0.37491158, 0.45076278, -0.84477234, 0.48220462, 1.0266485, 0.9100105, -1.786471, 0.64672625, -0.9442402, 0.15980951, 0.2763099, -0.2563906, 0.48786116, 1.2707106, 0.40826705, -1.3636479, 0.59256256, -0.14769381, 0.22855996, -0.23195097, -0.46100956, 1.4071323, 0.588202, -0.063307635, 0.027076863, 0.42972392, -0.74118775, -0.7520948, 0.92107975, 0.3780131, 0.43948358, 1.7412065, -1.8292835, 1.4121022, 0.9102089, 0.2922569, -2.4068086, 0.82316643, 0.14709213, 0.76868147, 0.070829175, 0.5930173, 0.7329806, -0.25992763, 0.22328012, 1.8324057, -0.89981586, 1.4022714, -0.28445876}; - float output[] = {-0.8470076, -0.617558, 0.024568161, -0.54007053, -0.5732189, 1.0910312, 0.51959157, -0.073640585, -0.60885113, -1.8285086, -0.9326965, -0.3021695, 1.066226, 0.8134058, -1.5457271, 1.1948874, -0.04176423, -0.59385985, 0.011908118, 0.095879026, 0.6736443, -0.48068637, 0.11451639, 1.5323228, -0.8184595, -1.4535367, -0.06812811, 0.71712196, 2.4668334, 0.3803238, 1.5602548, -2.1309204, 2.8248832, -1.3176224, -0.6582828, 0.73314184, 1.8034855, -1.6781946, -0.23040803, -1.3201909, -0.24954909, -0.34502414, -0.7355865, -0.41729373, 0.5724887, -0.60789496, 1.0349115, 0.46317944, 0.17278059, -0.78425044, -0.11165529, 0.7919961, 0.35827583, -1.9887244, 0.12787221, 1.095776, 0.28236288, 0.48224112, -0.5900752, 0.9498589, 0.5209434, -0.57806545, 1.3280295, -0.6969055, -2.539957, -0.0030387403, 1.871011, 0.13415621, -0.5734313, 0.09759699, -0.29701954, 0.9157297, -0.62670755, 1.2683886, -0.7024728, 0.6662447, 0.46600792, -0.494909, 0.8643152, -1.2757068, 0.8424522, 0.9383413, 0.49222285, 0.11790963, 0.57665557, -0.2206793, -1.2813573, -1.4700212, 1.9633232, 0.5646655, 0.15718703, -1.256212, 1.7298958, -0.4105028, 0.6821366, -0.72149056, -0.27424803, 0.19525297, 0.5027373, -1.0273383, -0.42891493, 0.31214187, 0.3240255, 0.6148003, -1.4785552, 0.79766524, -1.3977971, -1.9163635, -0.4596946, 0.4611778, 0.4615138, 0.57446766, -1.8127673, 1.0151784, 0.79838765, -0.16945624, -0.29454982, -0.22049658, 1.0656692, 1.9895301, -1.6840646, -0.0068151196, 0.29346943, 0.8048959, 0.50557023, -1.8385066, -0.4750251, 0.3583206, 0.41981372, -0.3146262, -0.79544896, 1.6337428, 1.4349604, -1.5252166, -0.91220444, 0.7527505, 0.6034745, 0.08402507, 1.0259006, -1.1905016, 0.52963644, -0.6864299, -0.15308455, 0.9455237, 1.000834, -1.828627, -0.5953371, 0.61878735, -2.7202675, -0.13529402, -1.1603078, -0.28340778, 1.6124189, 1.48123, -0.032326907, -1.5110354, -0.60052997, -0.98667, -0.026620502, 0.9869495, 0.9609994, 1.8000636, -0.39040756, 0.662662, -0.35303995, -0.10898638, -0.097712174, -0.13256012, -0.30892372, 0.9536066, 1.0131402, -0.21144608, 0.9224201, -1.2749323, 0.12289531, 0.6637511, 0.0252969, -0.058163885, 0.6347488, 0.13144295, 0.29648793, 1.6838806, 1.4852757, -0.29899225, -2.699224, 0.22093739, -0.63045704, -2.3597014, -0.9839067, -1.0647969, 0.8293971, -0.7054954, 1.7537973, 0.22664751, -0.1311305, 0.50954145, -1.7052051, -0.42696014, -0.5314228, -0.56175625, 0.6429764, 1.3670748, 0.46155804, -0.7046119, 0.060639046, -0.113631465, 0.17838268, -0.084968045, 0.67876095, 0.6301664, 1.2548337, -0.2446083, -0.092792444, -0.42515463, -1.0051632, -0.5343044, -0.25070238, 1.3654076, -1.1015171, -1.5554606, 0.62512356, 0.36090285, 0.43128428, 0.097997755, -0.3924458, 0.27789333, -1.1954387, 0.22248776, -1.6744449, -1.2109405, 1.0672655, 0.95568365, 0.8194465, 0.15550855, 0.3167771, 0.22519737, 1.2998043, -0.31728703, -0.5346176, 0.907684, -1.5638523, -1.1844252, -0.2738023, 0.051613424, 0.2711231, -2.3651042, -0.44602147, -0.44494528, 0.8535133, 0.24942228, -1.0080348, 0.85422933, -0.48436078, -1.3689119, -1.3511016, -0.48757446, -0.032849748, 0.22983012, -0.032983564, -0.71215105, 0.18651846, -2.0692394, -0.57982725, 0.2421949, -0.004737948, -0.90421754, -0.78182286, 0.12858658, -0.30840445, -1.2161031, 0.6076416, -0.8430386, -1.486868, -0.18519744, -0.5284652, -0.5890602, -1.3699012, 0.3797034, -0.6210796, 0.34635258, 0.97299594, -0.73827547, 0.06458698, 0.118863635, 0.5199116, 1.0428258, -0.9279422, -0.86735195, -1.1641119, 0.7890661, -0.13334043, 0.965089, -0.38214856, -0.4918111, -0.5547398, 0.42891094, 1.3179172, 1.3215472, 0.6549405, -0.35108355, -0.053067066, 1.0250593, 0.56519455, 0.62243444, 0.94297016, 1.444416, -1.0421168, -1.2815233, 1.5802842, 1.058067, 1.5861386, 0.2678979, 0.611768, -0.9184742, -0.50267774, 1.3114626, -0.8547099, -0.7508762, 0.97122836, 0.83569074, -0.8890005, -1.3588058, 0.52090734, 0.6599851, -1.1082011, 0.6431001, 0.20303106, 1.0637558, -1.6201593, -0.340904, 1.4634577, -0.8336172, -0.8939236, 1.6814111, -1.4717578, -0.10118986, -1.2259562, 1.5268134, 0.5433005, 0.22572087, -1.4068099, -0.4178259, 0.58685875, -0.05888392, 2.8919656, 1.6086674, 0.03694556, -1.1663972, 1.8105648, 0.29895756, 1.8874907, -0.7695107, 0.5690569, 0.030703884, 0.751468, 0.6750975, -1.3655664, 1.1141645, 0.7864459, 0.3947739, 1.1202441, -0.60260165, -0.47422236, -0.8188005, -0.9895167, 1.1552737, 1.0952479, 0.229527, 0.29695028, -1.6278256, -0.34756196, 0.40587282, -0.2820706, -0.7547495, -0.9610026, -1.7018858, -0.3924324, 1.079949, 0.8248382, 0.94413376, -1.1566157, -0.9842801, 1.6253854, -1.1643112, -0.031547185, -1.3878396, 1.7543691, -0.29027265, -0.013875638, -0.6859403, 0.6589252, -1.2933903, 0.1164802, 0.39297175, -0.11103736, 0.337499, 0.45827693, 1.8881621, -2.3753831, -0.53132796, 0.40727693, -0.2953328, -1.1905057, -1.7966558, 0.22342315, 0.713041, 1.293023, 1.3513365, -0.6619178, 2.7537708, -0.43479046, 1.5873258, 0.6956605, -1.9825284, 0.4805659, -1.5420442, 0.08287144, 0.5063851, 0.40049914, 0.075521916, 0.046996634, -2.108652, -0.21822332, -1.1524743, 0.36947966, 0.9477517, -1.1086196, -0.88682616, 0.70022494, -0.986827, -0.1266721, 1.0552126, -0.032320406, 0.030530429, 0.3426037, -0.7678068, 1.5853431, -0.29916266, 0.16663021, 0.3103334, 0.5508472, -1.029247, -0.17085668, -1.2482865, 0.4678677, -0.7913232, -0.4546694, -0.3316058, -1.3343717, 0.015012662, 1.3695817, 0.4196725, 0.9586006, -0.6572966, 0.92550796, -0.18838528, 0.03506735, -1.3085735, -1.8863217, 0.8283637, -0.049647644, -1.8473711, 1.2152774, 0.7069548, 0.57567924, -0.5769207, 0.004103885, 1.0740294, -0.6685727, 0.06981487, -0.442179, 1.2116009, -0.73983926, -1.0080059, -0.5856949, 1.263791, 0.75989074, -0.89122176, 0.4892265, -1.2846144, 1.6389104, -0.74073213, -2.5086443, 0.24558564, -2.191976, 0.9695048, -0.73659486, 0.4528519, 1.0352287, 0.91434026, -0.41227826, 1.1801821, -0.5871047, 1.2012802, -0.09350611, 0.9312934, -0.748986, 0.762986, 0.29536536, 1.5785195, 1.2566115, 0.6400792, -0.3231401, -0.54415464, 0.74289376, -0.5117031, 0.41670632, -0.75640124, 0.7170347, -1.2117789, -0.8108696, 0.6399255, -2.0755427, 0.7917815, -0.7693288, -0.11855151, 1.1035497, -0.7230254, 0.14678578, 2.1342237, 0.20335588, 1.6858623, 0.9036143, -1.3462288, 1.6330013, -0.23667838, -0.62839717, 0.5073823, -1.1040329, 1.8166281, -0.33216733, -1.1290957, -1.484877, -2.5237038, -0.13954702, -0.26784393, 0.31558135, -0.3871223, 0.64323556, 0.5781996, 0.3025445, -1.5513139, -0.38770792, -0.71166915, 0.9644843, 1.5589895, -0.41667962, 3.0079024, 0.21589102, 0.68024695, 1.0425457, 0.1675615, 1.2254218, -0.11186006, -0.21831718, 0.030340586, 0.6445724, 0.8555139, -0.30397046, -0.7371216, -0.3673983, -0.12570697, -0.63791007, 0.5487183, 0.3812071, -0.7880577, -0.07703689, 2.145892, 0.040550653, -1.1552556, 0.8339612, 0.35333186, 0.8113544, 0.9471309, 1.8389242, -2.1920223, -0.8024482, -0.75866145, -0.46682125, -0.291485, -0.56249285, -0.6120222, -1.3763278, -0.4043958, -0.167957, -0.1857909, -0.67057425, 0.04790106, 1.3035606, 0.4013939, 0.84132683, -0.7301506, 0.03734765, 0.12839374, 0.59680045, -1.4596658, -1.9846171, -1.3339622, -0.928884, 1.0592812, -0.08096708, -0.3560848, 0.17055984, 0.44089505, 1.0143852, -1.2609717, 0.39403346, 0.15323427, -0.20655632, 0.2729617, -0.017258333, 0.21113883, -0.037135277, -0.3795276, 1.8731954, -0.95502555, -0.047084603, -1.8833874, -0.17380746, 0.53410834, -0.37984794, -0.83650166, 1.3657289, -0.9089595, 0.11723666, -0.691051, 0.058711946, -0.3596759, -0.5994914, -0.82318157, -0.8170519, 1.0645616, 0.35892066, 0.16686276, -0.020305071, -0.8255187, 0.39803553, 2.157575, -0.18023075, 1.1010606, 0.14643395, 1.1315295, 0.9770161, 0.42666945, 0.27146822, 0.732228, 0.39469486, -0.84413946, -0.90971494, 0.6502484, -0.16056834, 2.1572785, 0.24662192, 0.66400963, 0.14993827, -0.3131849, 0.6960484, 1.3728433, 0.2414029, 0.32461792, -0.25270006, -0.5310546, 0.44632587, 0.72279614, 1.0306181, 0.6859314, -0.9765316, -1.661137, 1.7164898, 0.2669273, -1.0952786, 0.10285393, -1.5112151, 1.3984389, -0.33049527, -0.38896164, -0.06757384, 1.1891596, -0.5182803, 1.4854476, 0.68765616, 0.05129343, 0.92384857, -0.04301777, -0.6649576, -0.41715017, 0.596572, -1.9418277, -1.151948, 0.07984562, 0.6323108, 0.63117504, 0.38132355, 0.76422507, -1.071917, 0.46144056, -1.1519856, 0.51360416, -1.2658279, -0.7383204, 1.1194702, 0.37442186, -0.59131896, -0.8329332, 0.41315868, 0.49044436, 1.4959744, -0.25459176, 1.9797194, -0.3676517, -0.7006123, -1.5376753, 2.7518427, 0.4352582, -1.1831497, -0.47213498, -0.53300947, 0.31342745, 1.1631571, 1.0107048, 1.8207945, -0.8047002, 1.5142735, 0.06101127, -0.8167485, 1.341735, -1.9998361, -0.31037384, -1.9361457, 2.6424568, 1.7161232, -0.81243795, 1.4176836, 0.46120012, -0.10861592, -0.37943932, -0.53604156, 2.5376189, 1.9996238, 0.37519363, 1.3202821, -0.033361, -0.18681939, -0.64312565, 0.08054325, 0.22469059, 0.49264678, 1.2246869, -1.5528489, 0.7257059, -0.27520436, 1.1922318, 0.23851508, -0.29716906, 0.87747645, -0.26529908, 1.2344409, 2.0770943, 0.33405286, 1.5167257, -0.4284246, -0.6981646, -0.11194946, -0.2014947, -0.06963122, -1.3905734, -0.02160562, 2.0077162, -0.70806885, 0.6858733, -0.073999576, 0.58822834, 1.0689219, 0.4202779, -1.8052489, 0.8980629, 1.0188261, 0.24025117, 1.1279254, -2.096736, 0.86583626, 1.0729425, -1.3586196, -0.43458986, 0.85325885, -1.3032721, 1.519603, -0.30039188, 0.011318408, -0.22466156, -0.004637025, 0.20317583, 0.101351805, 0.46223554, 1.6066155, -0.3497661, 0.31206778, -0.16919272, 2.5479598, 0.23946035, 1.0384718, -0.028765468, -0.7647152, -0.1882574, 0.39373857, -1.1616229, -0.15314704, -0.41924948, 0.31844574, -1.4991366, -0.29855722, 0.05235714, 0.02478114, 0.13136047, 1.0196488, -0.779426, 0.020566413, -0.8152667, 0.32418823, -0.6030918, 1.3635833, 0.40278813, 0.0014983298, -0.05041781, 0.76405966, -0.6163368, -1.472155, -0.1951552, -0.32755968, -0.22645734, 1.4022243, -0.40418622, 0.7907749, -0.13738912, 0.420996, 0.03924503, 0.62669563, -0.06643237, -1.3050407, 0.16855282, -0.05330854, -0.34347278, -0.06536905, -1.7360572, -1.1509646, 1.3281381, -2.525531, 1.2429549, 0.14453362, 0.2398615, -0.6806504, 0.81042314, 1.4116533, -1.1112533, -0.2704999, 1.1570653, -0.37491158, 0.45076278, -0.84477234, 0.48220462, 1.0266485, 0.9100105, -1.786471, 0.64672625, -0.9442402, 0.15980951, 0.2763099, -0.2563906, 0.48786116, 1.2707106, 0.40826705, -1.3636479, 0.59256256, -0.14769381, 0.22855996, -0.23195097, -0.46100956, 1.4071323, 0.588202, -0.063307635, 0.027076863, 0.42972392, -0.74118775, -0.7520948, 0.92107975, 0.3780131, 0.43948358, 1.7412065, -1.8292835, 1.4121022, 0.9102089, 0.2922569, -2.4068086, 0.82316643, 0.14709213, 0.76868147, 0.070829175, 0.5930173, 0.7329806, -0.25992763}; -} \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Slice_Neg.ref.hxx b/tmva/sofie/test/input_models/references/Slice_Neg.ref.hxx deleted file mode 100644 index 092b8a2cabe60..0000000000000 --- a/tmva/sofie/test/input_models/references/Slice_Neg.ref.hxx +++ /dev/null @@ -1,4 +0,0 @@ -namespace Slice_Default_Steps { - std::vector input = {1.0451847, 0.6245613, 0.48420018, 2.1407738, 1.4023418, 0.6803044, 1.2552906, 0.23355322, 0.5949201, 0.665767, 0.7255075, 0.61573493, -0.22523554, 0.609465, -1.9059293, 1.3349898, -0.4083868, -0.30549952, 1.7568158, -0.09013642, 0.7510219, -0.052165933, 0.045655653, 0.6894599, 0.6663751, -0.13001254, -0.99388146, 1.1250099, 0.90145993, -3.4663842, 1.4765558, -0.8621666, -0.04465484, 0.51125, 0.8123038, -0.13915698, 1.2800659, 1.1580552, 1.8424264, -0.29321876, 0.031092152, 1.0013733, -0.7283629, 0.3382554, -1.8718901, -0.047066037, -1.9088744, 0.42447698, -0.3465933, -0.5751067, 1.5138085, -1.0871423, 0.6077587, 1.776671, 0.34022397, -0.03549139, -1.329498, 0.8371586, -1.4539177, 0.21200769, 0.76399386, -0.9069966, -0.0950934, 1.3569304, -0.29720822, 0.1822998, -1.1559794, 0.04441483, -1.4136242, 0.23844138, 1.0097063, 0.65586853, -2.0127554, -0.2072184, -0.4014769, -0.3000392, 0.8629856, -0.08507111, -1.1835829, -1.0837615, 0.50113016, -1.141945, 1.4552537, -0.36788568, -1.6010555, -0.15414086, -0.7613445, 1.6708724, 1.4167747, -0.096510775, -0.15186574, 0.4412115, -1.2044533, -0.044650316, -0.6854727, -1.4451612, -0.11577169, -1.2647926, -0.14461602, -0.47596788, 0.10738016, 0.06727146, 0.22507443, 1.2529004, -1.89923, 1.447481, 1.1985252, 0.3427861, -0.4630263, -0.65935296, 1.4358126, -2.2243154, 0.49377045, 1.4613236, -0.1912351, 1.8992213, -0.94443643, 0.6515869, 0.31404996, 0.074261054, 0.42852008, -0.19033097, -0.482317, -2.5970418, -1.2141722, 0.74168557, -0.91024095, 0.18518865, 0.20616573, 0.67188245, -1.9931237, 1.6288077, -0.1337348, -1.0095295, -0.292675, -2.8238084, 1.6436734, -0.66659415, 0.31128094, 0.25534976, -0.08932365, -0.24432416, -1.116715, 0.8437299, 1.5952227, -1.2897215, 0.5800979, -0.75728, 0.82642055, -0.20025311, -0.84525776, -0.4629382, 0.09837887, 0.8285737, 0.34570113, -0.4494489, -0.06607181, 1.880768, 0.95183575, 1.6169115, 0.2602527, -1.2811539, -0.12291974, -0.55588114, -2.4634414, -0.29807645, -0.32441446, -0.60882235, -0.6670523, -0.84318537, -1.1632277, -0.16034018, 0.8423004, 1.5689149, -1.378128, -1.9285303, -0.9074993, -0.25396672, -0.90653914, -1.0881042, 0.56759405, -1.4169359, -2.5133574, -0.96242374, -1.8407485, 0.21979266, -1.5453613, -0.400642, 0.3806829, 1.1271498, 1.1819715, 0.847391, -1.4687508, 0.74352884, -0.6923194, -1.4369518, 0.97722024, 1.0514591, -0.90551496, -0.79178625, 0.19880198, 0.6863783, 0.72862554, 1.763804, 0.2279675, 1.4966544, 0.7106558, -0.41115803, -0.21305746, 0.79997617, 0.7268194, 1.5965521, -1.4865237, -0.44435644, -0.36344638, -0.11310481, 1.4190954, 0.6319442, 0.745741, -0.5167261, -0.16796711, 1.5669242, -1.4218544, 0.61177474, -1.243831, -0.408289, 0.865704, -0.97820926, 1.053678, -1.9482862, 0.54905266, -0.9755587, -1.8869104, 0.0044822586, -1.1138756, -0.71788013, 0.7361194, -0.7153275, -1.6451069, 1.7545587, -0.75075376, -1.3882002, -0.5430022, -1.2329432, 0.21638516, -0.326573, 0.5647263, -1.8826942, -0.5760186, 0.51380414, -1.5062225, 0.3432146, 0.14499806, -1.1523787, 2.335982, -2.4507418, 0.5823965, 0.7784748, 1.2795119, -0.39526865, -0.74181443, 1.476051, -0.07681689, 0.0067599732, -0.98287404, -1.3786954, 0.4984134, 1.0468203, -0.7151032, -2.0332944, 0.05419711, -2.3168552, 1.122624, -0.53438026, -2.3934145, -0.49050105, -0.9205437, -0.15586168, 1.6762931, 0.5607007, 0.07048273, -0.7124037, -1.819932, 1.0152652, 1.8492514, 0.09532632, -0.47131425, 0.10136383, 1.6027571, -0.055490978, -0.53033817, 0.47595662, -0.124515995, 0.8248915, -0.50315917, -0.09490088, 2.1328678, 0.26436484, -0.3090177, 0.66534674, -1.2549512, -0.25315812, -1.0608811, 0.08174163, 2.3469543, 0.18253551, 1.4174005, 0.5833562, 0.7734026, 0.8875707, 0.46253937, -0.59789574, 0.3320457, 0.7252614, 0.2282751, 0.6393503, 0.3354368, -2.2898176, 0.08617805, -0.98621976, 1.4499558, -0.10378551, 1.4655052, 0.57472426, -0.8805005, -0.73588294, 0.6668061, 0.81059366, -0.59290576, -0.31642014, 0.5465175, -0.16706206, -0.68133485, 1.0575606, 0.415264, -1.7762902, 0.35459134, -0.036745973, 0.28332543, -0.0061813043, -0.8579742, -1.266533, -0.69849193, -1.4563639, 0.9827122, 0.7408832, -1.514766, -1.0668796, 0.1426218, -0.09352196, -1.4858966, -0.80005354, -0.731151, 0.5344746, 0.38867953, 0.5330557, 0.50632566, 0.6302994, -0.569997, 0.7838313, -0.28514034, -2.2912836, -0.6982049, 0.7933591, -1.1312126, 1.3734623, 1.100901, -0.7409093, 0.38863868, 0.24726652, -0.26152653, -1.6399634, 0.32046428, -0.06809312, 1.6628146, -2.0482807, -0.13053721, -1.700966, 0.3613013, 0.024943631, 0.73767537, 0.35799584, -1.1839654, -0.816691, 1.2237171, -1.9319222, -0.14407313, 1.75666, 1.7709233, 0.21359767, 0.9950233, -0.4615518, 0.44868615, 1.4312615, 1.3808835, -0.18940794, 1.0416954, -0.24796851, 0.48987696, 1.2978021, 0.05604007, -0.3529608, -1.3806872, 2.2423518, 0.38141087, 1.1842633, -0.3420007, -0.28834683, -0.52113175, -0.08655031, 0.66746104, 0.4264375, 0.08894845, 1.361398, -1.1102597, 0.8127054, -0.25339708, 0.7393206, 0.54270566, 0.72499883, 1.0655539, -0.43516365, 1.53332, -1.3317435, 0.9998057, 0.41541678, 0.98901755, -0.7852148, 1.9416982, -0.72119594, -0.034244604, -0.011740846, -0.25054318, -1.4232942, 0.9649547, 0.010748758, 0.13203041, 0.25134632, 1.7783864, 0.0403642, 2.4485521, -0.5401216, -0.3214275, -0.7718592, 1.0362864, -0.7257519, -0.53041863, 0.27436903, 0.08478759, 1.3883367, -0.66223633, 0.51782465, -1.1076697, 0.15442872, 1.6057725, -0.5522208, 0.6561317, 0.17577524, 0.4332249, -0.28804585, -0.5691257, 2.25104, -1.1636895, 0.22430561, 1.0721023, 0.792772, -0.47398332, -0.76994264, 1.0576593, 0.88267803, -1.4782726, 0.8926852, -0.46385735, -0.0716391, -1.665406, 0.11861658, 0.37563065, 0.85860866, -1.8741595, -0.5219604, -1.0582875, 1.7154264, 0.1313024, 1.4848208, 0.11640747, -1.7609112, 0.7769073, 0.48588625, -1.2146038, 0.73792857, -0.9774584, 0.07676499, -1.0037707, 0.015130967, -1.2565023, 1.7358211, 1.4210244, 0.053746346, -1.5248967, 1.1289326, -0.53315526, -1.3237956, -0.21802673, 0.5033034, -0.9388878, -2.9923463, 0.8051657, 0.9151123, 0.017421184, -1.4353907, 1.781005, 0.95736814, 1.1634779, 0.64479274, -0.23042154, -0.55330545, 0.41722617, -0.007924688, 1.9704095, -0.52791095, -0.25249967, 1.217987, -0.26531398, 0.31962937, -1.1676388, 0.17290594, -0.68421125, -0.34032997, -1.4233708, -0.9743128, 0.9177001, -0.14544213, -0.27916044, -1.4160591, 0.096208386, -1.4026262, -0.51816446, 0.9189864, 1.0548416, -0.8247552, -0.7701502, -0.98002684, 1.1631306, 0.8712015, -0.5758766, -1.6995598, 0.09796931, 0.27600157, -0.2175099, -1.2554561, -0.07213151, 2.4231257, 0.7729675, 0.030608136, -1.8162596, 0.7449758, 0.6113035, -0.22608364, -0.6480759, 0.4915602, 1.1545128, 0.35355297, 1.6369073, 0.411864, -1.0840435, -0.075121745, 2.2060554, -0.24247673, -1.1374276, 0.10677125, 1.9537716, -1.108019, -0.32708606, 0.5778413, 1.2812556, 0.21232277, 0.13396217, 0.80973107, 0.26933447, -0.20669563, 1.9351953, 0.7844493, 0.10339695, -1.7368128, 0.823303, 0.67611474, -0.14529933, -0.94407207, 0.6184946, -1.1973552, 0.94807374, -1.9689158, -0.95736796, -0.36089993, 0.97640216, -0.5079678, -0.13345084, -0.09096543, 1.6033889, 0.20670862, -0.27726498, 0.068673365, -0.1626727, 0.13826686, 0.55320334, -1.5936158, -0.82023424, 0.27161613, 0.41867435, -0.9805353, -0.4154204, 0.49877793, 0.0093282405, 0.59771943, 0.09775646, 0.58804435, -0.65016276, 0.73460424, 0.8446652, 2.0283346, 1.2307235, 1.1308593, -0.5006046, 0.334564, -0.97043395, -0.5636059, -1.4977788, 0.87005043, -1.1603388, 0.31635118, -1.8745527, 0.7862731, -1.041438, -0.9785689, -0.014248349, -1.222529, -0.5575574, 2.4933984, -0.064805016, 0.39413083, -1.2988446, 0.7563059, -0.79205245, -1.0542104, 0.5979833, 1.5992491, -1.7063024, -0.5771334, 1.6361665, -0.60626614, 0.44358745, 0.36404964, -0.17300287, -1.4895558, 0.93172455, -0.66854924, 0.4801032, 0.09470631, 0.19432715, -0.39213803, 0.23912194, 1.1788458, -0.20358092, 1.2247528, -1.7846833, 1.7758663, 0.87859154, -0.4107461, -0.32997409, -1.5755576, -1.4550736, -0.31620994, 0.81590563, 0.21436447, -0.0009418542, 0.3039241, -0.14782928, -0.779694, -0.26116168, -0.5875628, 1.064051, 1.520253, 0.68341565, -1.9807853, 0.74206716, -2.8454256, 1.2709564, 1.7051587, -0.23825008, 0.13465987, -0.25501144, 0.13449395, -0.08085852, -0.9345905, -0.9593099, 0.6859107, -1.1454093, -1.3381015, 0.2353102, -0.13322814, 0.11062508, 0.17510203, 0.00516871, -1.0370462, -0.32723942, 1.2823414, -0.042340446, -0.3114818, -8.870333e-05, -0.5615099, -0.20567372, -1.2969033, -0.18617158, 0.58420277, -0.9223417, -0.8050735, -0.36499628, -0.76930875, 1.4448764, -0.1731726, -0.19603184, -0.23324072, -0.109300986, 1.0571263, 1.178747, -0.5669078, -0.6129132, 0.2746348, -0.072358064, 0.3385931, -0.31736866, -0.4328864, 0.9560206, -0.44862372, -0.350604, 0.37914753, 0.76631945, 0.5211334, -1.1975573, -0.39863473, 1.7790956, 0.036023278, 0.85484296, -0.14574684, -2.1517622, 1.4256386, 0.07762644, 0.76923335, -1.452289, -0.44079757, 1.5147146, 0.057785936, 1.7878892, -0.61763746, -0.7521893, 0.7968369, 0.2493956, 0.23879473, 0.047723737, 0.45276004, -0.5033289, 0.84546775, 0.087485075, -0.29491672, -0.7279333, 1.047645, -1.5160652, -0.7238233, -1.4873251, -0.9596354, -0.09308696, 0.9633187, 0.17714372, 0.38465348, -0.13031037, -0.48849452, -0.5216643, -0.7692474, -0.4057824, 0.024406806, 0.33862096, -0.4138596, 0.4039324, 0.18644312, -0.61818093, 0.13876703, -2.164961, -0.31688243, 0.7040236, 0.59295374, -0.8303941, -0.9530634, -0.48112786, -1.3758682, 0.23894647, 0.44065222, -0.7498823, 0.4367827, -0.8626759, -0.819069, 0.6019, 0.40171462, -0.989695, 0.9679922, 0.60419935, 0.5596958, 0.5186218, 0.4689634, -0.28469092, 0.007876219, -0.017619386, 0.65712726, 0.28158224, 0.42113513, -0.5614362, 1.1735151, 0.2318658, -0.60902905, -0.83569163, 1.2109544, -1.7506728, 1.1711022, 0.18666989, -1.4357256, 1.7505751, 2.359068, -0.69469744, -0.17320465, -0.49060386, 1.9384009, -0.8286886, -1.9119048, -0.0867032, 1.675301, -0.15963833, 0.47802424, -0.93921524, 0.21669552, 0.5973385, -0.3897737, -0.96138793, -1.1460986, -0.6993545, 0.48859787, 0.49144292, 0.884664, -0.45526063, 0.06822358, 1.2684873, 1.2708554, 0.08385541, 0.788578, 0.038803414, -0.58519393, 1.4615723, 0.36900017, -0.8346276, 0.04170542, -0.41653165, 1.0975499, 2.0970829, 0.18264593, 1.5489473, 0.5285782, -1.0232004, 0.050813664, -1.0207909, -0.064489454, -1.2171016, -0.4630668, -0.4305054, 1.0489885, -0.3447226, 0.47696728, 0.085851595, 0.45969304, 0.9397857, 0.9925845, 0.84165156, 0.58367836, 0.44830862, 0.79763794, 1.1915636, 0.20407252, -1.1486843, 1.3992747, -0.76383877, 2.411353, 0.48628262, 0.3500077, -0.300855, 0.6324427, 0.34935966, 0.54504216, -1.1055669, -0.09944116, 0.95708686, 1.5737662, -0.5069417, -0.7603594, 0.16570005, 0.38484627, 0.7854822, -0.5289874, -0.20853232, -0.25366986, 0.93255436, 2.1678638, 2.5284173, 0.09104326, -0.25922984, 0.104944386, 0.46791264, -0.1947828, 0.2517247, -0.0018040794, -0.36763376, -2.4569225, 1.2765278, -0.96315217, -1.2554164, -0.2874503, 0.9034364, 0.6889874, -1.4450033, 1.6024436, 0.21677066, -0.008955182, -0.16781831, -1.0223466, -0.96528006, -2.1202044, 0.3416743, 0.021002049, -0.12881091, -1.4332885, -0.12481898, 0.93586546, -1.5900887, -1.0640641, 0.8249464, -0.47171867, 0.1742785, 0.6709329, -1.7259985, 0.78818256, -1.2866964, -1.4600148, -1.4257796, 0.34334445, -2.1116593, 0.25954735, -0.4888973, 0.19879743, -0.27516934, 1.6078179, 1.5662538, 0.14704464, -0.93423027, -0.6393435, -1.1420057, 0.9135534, 0.57406884, 0.1670467, 0.90328616, -1.3994925, -0.31774673, 0.46857116, 0.77330434, 0.45956635, -0.9270845, -1.0549059, -0.5243828, -0.85040414, -1.5719082, 1.0715257, 1.9476706, -1.4326566, 0.97081816, 0.7446318, -0.34977925, -0.9901644, 1.5866337, -0.97141254, -1.1351146, -0.09391565, 0.31912678, -0.13078365, 1.498845, 0.3680228, 0.76907545, 0.37397268, -0.56707764, -0.8323829, 1.3317215, -0.3441633, -2.1597042, -1.7520211, -0.47263923, -0.8540615}; - float output[] = {2.1407738, 0.5949201, 0.609465, 1.7568158, 0.6894599, 0.90145993, 0.51125, 1.8424264, 0.3382554, -0.3465933, 1.776671, -1.4539177, 1.3569304, -1.4136242, -0.2072184, -1.1835829, -0.36788568, 1.4167747, -0.044650316, -0.14461602, 1.2529004, -0.4630263, 1.4613236, 0.31404996, -2.5970418, 0.20616573, -1.0095295, 0.31128094, 0.8437299, 0.82642055, 0.8285737, 0.95183575, -0.55588114, -0.6670523, 1.5689149, -0.90653914, -0.96242374, 0.3806829, 0.74352884, -0.90551496, 1.763804, -0.21305746, -0.44435644, 0.745741, 0.61177474, 1.053678, 0.0044822586, -1.6451069, -1.2329432, -0.5760186, -1.1523787, 1.2795119, 0.0067599732, -0.7151032, -0.53438026, 1.6762931, 1.0152652, 1.6027571, 0.8248915, -0.3090177, 0.08174163, 0.7734026, 0.7252614, 0.08617805, 0.57472426, -0.59290576, 1.0575606, 0.28332543, -1.4563639, 0.1426218, 0.5344746, -0.569997, 0.7933591, 0.38863868, -0.06809312, 0.3613013, -0.816691, 1.7709233, 1.4312615, 0.48987696, 2.2423518, -0.52113175, 1.361398, 0.54270566, -1.3317435, 1.9416982, -1.4232942, 1.7783864, -0.7718592, 0.08478759, 0.15442872, 0.4332249, 0.22430561, 1.0576593, -0.0716391, -1.8741595, 1.4848208, -1.2146038, 0.015130967, -1.5248967, 0.5033034, 0.017421184, 0.64479274, 1.9704095, 0.31962937, -1.4233708, -1.4160591, 1.0548416, 0.8712015, -0.2175099, 0.030608136, -0.6480759, 0.411864, -1.1374276, 0.5778413, 0.26933447, -1.7368128, 0.6184946, -0.36089993, 1.6033889, 0.13826686, 0.41867435, 0.59771943, 0.8446652, 0.334564, -1.1603388, -0.9785689, -0.064805016, -1.0542104, 1.6361665, -1.4895558, 0.19432715, 1.2247528, -0.32997409, 0.21436447, -0.26116168, -1.9807853, -0.23825008, -0.9345905, 0.2353102, -1.0370462, -8.870333e-05, 0.58420277, 1.4448764, 1.0571263, -0.072358064, -0.44862372, -1.1975573, -0.14574684, -1.452289, -0.61763746, 0.047723737, -0.29491672, -1.4873251, 0.38465348, -0.4057824, 0.18644312, 0.7040236, -1.3758682, -0.8626759, 0.9679922, -0.28469092, 0.42113513, -0.83569163, -1.4357256, -0.49060386, 1.675301, 0.5973385, 0.48859787, 1.2684873, -0.58519393, -0.41653165, 0.5285782, -1.2171016, 0.47696728, 0.84165156, 0.20407252, 0.48628262, 0.54504216, -0.5069417, -0.5289874, 2.5284173, -0.1947828, 1.2765278, 0.6889874, -0.16781831, 0.021002049, -1.5900887, 0.6709329, -1.4257796, 0.19879743, -0.93423027, 0.1670467, 0.77330434, -0.85040414, 0.97081816, -0.97141254, 1.498845, -0.8323829, -0.47263923}; -} \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Softmax1d.ref.hxx b/tmva/sofie/test/input_models/references/Softmax1d.ref.hxx deleted file mode 100644 index 44fb41382cb0c..0000000000000 --- a/tmva/sofie/test/input_models/references/Softmax1d.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace Softmax1d_ExpectedOutput{ - float output[] = {0.09003058, 0.24472848, 0.66524094}; -} diff --git a/tmva/sofie/test/input_models/references/Softmax2d.ref.hxx b/tmva/sofie/test/input_models/references/Softmax2d.ref.hxx deleted file mode 100644 index 68f3b6c64b8ff..0000000000000 --- a/tmva/sofie/test/input_models/references/Softmax2d.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace Softmax2d_ExpectedOutput{ - float output[] = {0.09003058, 0.24472848, 0.66524094}; -} diff --git a/tmva/sofie/test/input_models/references/Softmax3d.ref.hxx b/tmva/sofie/test/input_models/references/Softmax3d.ref.hxx deleted file mode 100644 index bbcb0c36310d0..0000000000000 --- a/tmva/sofie/test/input_models/references/Softmax3d.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace Softmax3d_ExpectedOutput{ - float output[] = { - 0.2135, 0.1206, 0.2700, 0.6262, 0.3266, 0.5932, 0.0588, 0.1167, 0.4600, - 0.2861, 0.6713, 0.2572, 0.3993, 0.1286, 0.0133, 0.7877, 0.3260, 0.7496, - 0.0604, 0.0992, 0.2747, 0.1218, 0.9263, 0.1131}; -} diff --git a/tmva/sofie/test/input_models/references/Softmax4d.ref.hxx b/tmva/sofie/test/input_models/references/Softmax4d.ref.hxx deleted file mode 100644 index 1043b215c9694..0000000000000 --- a/tmva/sofie/test/input_models/references/Softmax4d.ref.hxx +++ /dev/null @@ -1,9 +0,0 @@ -namespace Softmax4d_ExpectedOutput{ - float output[] = { - 0.1683, 0.0874, 0.2593, 0.3676, 0.3589, 0.3785, 0.2136, 0.1664, 0.2643, - 0.0800, 0.0464, 0.0429, 0.4629, 0.0690, 0.2264, 0.8081, 0.1058, 0.6774, - 0.1157, 0.1123, 0.4818, 0.1500, 0.2968, 0.0603, 0.1334, 0.1897, 0.0721, - 0.1808, 0.6827, 0.2801, 0.1118, 0.3495, 0.1004, 0.3916, 0.6719, 0.2052, - 0.1388, 0.0549, 0.0889, 0.3483, 0.0288, 0.2722, 0.0887, 0.5564, 0.7794, - 0.0642, 0.1031, 0.1072}; -} diff --git a/tmva/sofie/test/input_models/references/Sqrt.ref.hxx b/tmva/sofie/test/input_models/references/Sqrt.ref.hxx deleted file mode 100644 index e847a35d24e6b..0000000000000 --- a/tmva/sofie/test/input_models/references/Sqrt.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace Sqrt_ExpectedOutput{ - float output[] = {0.9135, 0.6868, 0.7891, 0.9191, 0.4983, 0.9730}; -} diff --git a/tmva/sofie/test/input_models/references/Sub.ref.hxx b/tmva/sofie/test/input_models/references/Sub.ref.hxx deleted file mode 100644 index bd2ac99126068..0000000000000 --- a/tmva/sofie/test/input_models/references/Sub.ref.hxx +++ /dev/null @@ -1,5 +0,0 @@ -namespace Sub_ExpectedOutput{ - float outputs[] = { - 1, 1 - }; -} // namespace Sub_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/SumMultidirectionalBroadcast.ref.hxx b/tmva/sofie/test/input_models/references/SumMultidirectionalBroadcast.ref.hxx deleted file mode 100644 index 48ff0d9fe8c6a..0000000000000 --- a/tmva/sofie/test/input_models/references/SumMultidirectionalBroadcast.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace SumMultidirectionalBroadcast_ExpectedOutput { -float output[] = {0.7040715799999999, 0.65284213, 1.68048673, 1.1749307, -3.0888683, - -3.1400977500000002, -2.1124531500000003, -2.61800918, 0.19356718, 0.14233773, - 1.1699823299999998, 0.6644263, -0.20102366999999996, -0.25225312, 0.77539148, - 0.26983545000000003, -2.54073318, -2.5919626300000003, -1.5643180300000001, -2.06987406, - -0.15768401999999998, -0.20891347, 0.81873113, 0.31317510000000004}; -} diff --git a/tmva/sofie/test/input_models/references/Swish.ref.hxx b/tmva/sofie/test/input_models/references/Swish.ref.hxx deleted file mode 100644 index d7fc0427c4b49..0000000000000 --- a/tmva/sofie/test/input_models/references/Swish.ref.hxx +++ /dev/null @@ -1,3 +0,0 @@ -namespace Swish_ExpectedOutput { - float outputs[] = {0.731059f, -0.238406f, 2.857723f, 0.311230f, -0.268941f, 1.761594f}; -} // namespace Swish_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/Tanh.ref.hxx b/tmva/sofie/test/input_models/references/Tanh.ref.hxx deleted file mode 100644 index 2ba47d8a12e1c..0000000000000 --- a/tmva/sofie/test/input_models/references/Tanh.ref.hxx +++ /dev/null @@ -1,7 +0,0 @@ -namespace Tanh_ExpectedOutput{ - float outputs[] = { - -0.3710, -0.3382, 0.0363, 0.7991, 0.4688, -0.6923, -0.5893, 0.2375, - 0.9212, 0.8826, -0.2081, -0.5976, -0.4675, -0.9727, -0.6099, 0.8229, - 0.8739, 0.6714, 0.9373, -0.6982, -0.1946, 0.0411, -0.5125, -0.2464 - }; -} // namespace Tanh_ExpectedOutput \ No newline at end of file diff --git a/tmva/sofie/test/input_models/references/Tile5D.ref.hxx b/tmva/sofie/test/input_models/references/Tile5D.ref.hxx deleted file mode 100644 index 88c55c2ad39f9..0000000000000 --- a/tmva/sofie/test/input_models/references/Tile5D.ref.hxx +++ /dev/null @@ -1,177 +0,0 @@ -namespace Tile5D_ExpectedOutput { -float output[] = { - 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, 0.2386120855808258, 0.5549510717391968, - -1.8190287351608276, 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, 0.5724563598632812, - -0.6596977710723877, 0.17560836672782898, 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, - 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, 0.7608169317245483, 0.08603227883577347, - -0.049375515431165695, 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, 0.7608169317245483, - 0.08603227883577347, -0.049375515431165695, 0.2705111503601074, 1.42119562625885, 0.032626643776893616, - 0.2705111503601074, 1.42119562625885, 0.032626643776893616, 0.2705111503601074, 1.42119562625885, - 0.032626643776893616, -1.212586522102356, -0.5129594802856445, -0.43296414613723755, -1.212586522102356, - -0.5129594802856445, -0.43296414613723755, -1.212586522102356, -0.5129594802856445, -0.43296414613723755, - -0.1606937050819397, 1.1884371042251587, -0.662174642086029, -0.1606937050819397, 1.1884371042251587, - -0.662174642086029, -0.1606937050819397, 1.1884371042251587, -0.662174642086029, 0.2386120855808258, - 0.5549510717391968, -1.8190287351608276, 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, - 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, 0.5724563598632812, -0.6596977710723877, - 0.17560836672782898, 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, 0.5724563598632812, - -0.6596977710723877, 0.17560836672782898, 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, - 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, 0.7608169317245483, 0.08603227883577347, - -0.049375515431165695, 0.2705111503601074, 1.42119562625885, 0.032626643776893616, 0.2705111503601074, - 1.42119562625885, 0.032626643776893616, 0.2705111503601074, 1.42119562625885, 0.032626643776893616, - -1.212586522102356, -0.5129594802856445, -0.43296414613723755, -1.212586522102356, -0.5129594802856445, - -0.43296414613723755, -1.212586522102356, -0.5129594802856445, -0.43296414613723755, -0.1606937050819397, - 1.1884371042251587, -0.662174642086029, -0.1606937050819397, 1.1884371042251587, -0.662174642086029, - -0.1606937050819397, 1.1884371042251587, -0.662174642086029, -2.291109323501587, -0.6852569580078125, - 2.325223922729492, -2.291109323501587, -0.6852569580078125, 2.325223922729492, -2.291109323501587, - -0.6852569580078125, 2.325223922729492, -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, - -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, -0.19389064610004425, -0.5784135460853577, - -0.39328137040138245, 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, 0.2831517457962036, - 0.4496127665042877, -0.2029038816690445, 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, - 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, 0.35477763414382935, 0.4266718924045563, - 0.24683749675750732, 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, 1.90426504611969, - -0.4861580729484558, 0.9139055013656616, 1.90426504611969, -0.4861580729484558, 0.9139055013656616, - 1.90426504611969, -0.4861580729484558, 0.9139055013656616, -0.5031066536903381, 0.9583520293235779, - -0.23210509121418, -0.5031066536903381, 0.9583520293235779, -0.23210509121418, -0.5031066536903381, - 0.9583520293235779, -0.23210509121418, -2.291109323501587, -0.6852569580078125, 2.325223922729492, - -2.291109323501587, -0.6852569580078125, 2.325223922729492, -2.291109323501587, -0.6852569580078125, - 2.325223922729492, -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, -0.19389064610004425, - -0.5784135460853577, -0.39328137040138245, -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, - 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, 0.2831517457962036, 0.4496127665042877, - -0.2029038816690445, 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, 0.35477763414382935, - 0.4266718924045563, 0.24683749675750732, 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, - 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, 1.90426504611969, -0.4861580729484558, - 0.9139055013656616, 1.90426504611969, -0.4861580729484558, 0.9139055013656616, 1.90426504611969, - -0.4861580729484558, 0.9139055013656616, -0.5031066536903381, 0.9583520293235779, -0.23210509121418, - -0.5031066536903381, 0.9583520293235779, -0.23210509121418, -0.5031066536903381, 0.9583520293235779, - -0.23210509121418, 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, 1.3183971643447876, - 1.7042455673217773, -0.3201166093349457, 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, - -0.14444805681705475, -0.8829464912414551, 1.725736141204834, -0.14444805681705475, -0.8829464912414551, - 1.725736141204834, -0.14444805681705475, -0.8829464912414551, 1.725736141204834, 0.45657631754875183, - 0.4920198321342468, -1.088847041130066, 0.45657631754875183, 0.4920198321342468, -1.088847041130066, - 0.45657631754875183, 0.4920198321342468, -1.088847041130066, 0.49437597393989563, -0.006085286382585764, - 2.475630760192871, 0.49437597393989563, -0.006085286382585764, 2.475630760192871, 0.49437597393989563, - -0.006085286382585764, 2.475630760192871, 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, - 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, 0.12170185893774033, -0.8953945636749268, - 1.1430096626281738, 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, 1.3278610706329346, - 0.3076854348182678, 0.036237504333257675, 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, - 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, 1.3183971643447876, 1.7042455673217773, - -0.3201166093349457, 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, -0.14444805681705475, - -0.8829464912414551, 1.725736141204834, -0.14444805681705475, -0.8829464912414551, 1.725736141204834, - -0.14444805681705475, -0.8829464912414551, 1.725736141204834, 0.45657631754875183, 0.4920198321342468, - -1.088847041130066, 0.45657631754875183, 0.4920198321342468, -1.088847041130066, 0.45657631754875183, - 0.4920198321342468, -1.088847041130066, 0.49437597393989563, -0.006085286382585764, 2.475630760192871, - 0.49437597393989563, -0.006085286382585764, 2.475630760192871, 0.49437597393989563, -0.006085286382585764, - 2.475630760192871, 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, 0.12170185893774033, - -0.8953945636749268, 1.1430096626281738, 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, - 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, 1.3278610706329346, 0.3076854348182678, - 0.036237504333257675, 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, 0.05180325731635094, - 0.2802475392818451, 0.5289335250854492, 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, - 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, 0.9356630444526672, 0.7863689064979553, - 0.4239695370197296, 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, 0.9356630444526672, - 0.7863689064979553, 0.4239695370197296, 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, - 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, 0.8723016977310181, -0.2248474359512329, - 0.3891502320766449, 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, 0.5463842153549194, - -0.7782878875732422, -0.8570080399513245, 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, - -2.593783378601074, -0.11392943561077118, 0.5637082457542419, -2.593783378601074, -0.11392943561077118, - 0.5637082457542419, -2.593783378601074, -0.11392943561077118, 0.5637082457542419, 2.075004816055298, - -1.0598397254943848, 1.0823975801467896, 2.075004816055298, -1.0598397254943848, 1.0823975801467896, - 2.075004816055298, -1.0598397254943848, 1.0823975801467896, 0.05180325731635094, 0.2802475392818451, - 0.5289335250854492, 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, 0.05180325731635094, - 0.2802475392818451, 0.5289335250854492, 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, - 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, 0.9356630444526672, 0.7863689064979553, - 0.4239695370197296, 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, 0.8723016977310181, - -0.2248474359512329, 0.3891502320766449, 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, - 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, 0.5463842153549194, -0.7782878875732422, - -0.8570080399513245, 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, -2.593783378601074, - -0.11392943561077118, 0.5637082457542419, -2.593783378601074, -0.11392943561077118, 0.5637082457542419, - -2.593783378601074, -0.11392943561077118, 0.5637082457542419, 2.075004816055298, -1.0598397254943848, - 1.0823975801467896, 2.075004816055298, -1.0598397254943848, 1.0823975801467896, 2.075004816055298, - -1.0598397254943848, 1.0823975801467896, 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, - 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, 0.2386120855808258, 0.5549510717391968, - -1.8190287351608276, 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, 0.5724563598632812, - -0.6596977710723877, 0.17560836672782898, 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, - 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, 0.7608169317245483, 0.08603227883577347, - -0.049375515431165695, 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, 0.2705111503601074, - 1.42119562625885, 0.032626643776893616, 0.2705111503601074, 1.42119562625885, 0.032626643776893616, - 0.2705111503601074, 1.42119562625885, 0.032626643776893616, -1.212586522102356, -0.5129594802856445, - -0.43296414613723755, -1.212586522102356, -0.5129594802856445, -0.43296414613723755, -1.212586522102356, - -0.5129594802856445, -0.43296414613723755, -0.1606937050819397, 1.1884371042251587, -0.662174642086029, - -0.1606937050819397, 1.1884371042251587, -0.662174642086029, -0.1606937050819397, 1.1884371042251587, - -0.662174642086029, 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, 0.2386120855808258, - 0.5549510717391968, -1.8190287351608276, 0.2386120855808258, 0.5549510717391968, -1.8190287351608276, - 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, 0.5724563598632812, -0.6596977710723877, - 0.17560836672782898, 0.5724563598632812, -0.6596977710723877, 0.17560836672782898, 0.7608169317245483, - 0.08603227883577347, -0.049375515431165695, 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, - 0.7608169317245483, 0.08603227883577347, -0.049375515431165695, 0.2705111503601074, 1.42119562625885, - 0.032626643776893616, 0.2705111503601074, 1.42119562625885, 0.032626643776893616, 0.2705111503601074, - 1.42119562625885, 0.032626643776893616, -1.212586522102356, -0.5129594802856445, -0.43296414613723755, - -1.212586522102356, -0.5129594802856445, -0.43296414613723755, -1.212586522102356, -0.5129594802856445, - -0.43296414613723755, -0.1606937050819397, 1.1884371042251587, -0.662174642086029, -0.1606937050819397, - 1.1884371042251587, -0.662174642086029, -0.1606937050819397, 1.1884371042251587, -0.662174642086029, - -2.291109323501587, -0.6852569580078125, 2.325223922729492, -2.291109323501587, -0.6852569580078125, - 2.325223922729492, -2.291109323501587, -0.6852569580078125, 2.325223922729492, -0.19389064610004425, - -0.5784135460853577, -0.39328137040138245, -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, - -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, 0.2831517457962036, 0.4496127665042877, - -0.2029038816690445, 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, 0.2831517457962036, - 0.4496127665042877, -0.2029038816690445, 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, - 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, 0.35477763414382935, 0.4266718924045563, - 0.24683749675750732, 1.90426504611969, -0.4861580729484558, 0.9139055013656616, 1.90426504611969, - -0.4861580729484558, 0.9139055013656616, 1.90426504611969, -0.4861580729484558, 0.9139055013656616, - -0.5031066536903381, 0.9583520293235779, -0.23210509121418, -0.5031066536903381, 0.9583520293235779, - -0.23210509121418, -0.5031066536903381, 0.9583520293235779, -0.23210509121418, -2.291109323501587, - -0.6852569580078125, 2.325223922729492, -2.291109323501587, -0.6852569580078125, 2.325223922729492, - -2.291109323501587, -0.6852569580078125, 2.325223922729492, -0.19389064610004425, -0.5784135460853577, - -0.39328137040138245, -0.19389064610004425, -0.5784135460853577, -0.39328137040138245, -0.19389064610004425, - -0.5784135460853577, -0.39328137040138245, 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, - 0.2831517457962036, 0.4496127665042877, -0.2029038816690445, 0.2831517457962036, 0.4496127665042877, - -0.2029038816690445, 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, 0.35477763414382935, - 0.4266718924045563, 0.24683749675750732, 0.35477763414382935, 0.4266718924045563, 0.24683749675750732, - 1.90426504611969, -0.4861580729484558, 0.9139055013656616, 1.90426504611969, -0.4861580729484558, - 0.9139055013656616, 1.90426504611969, -0.4861580729484558, 0.9139055013656616, -0.5031066536903381, - 0.9583520293235779, -0.23210509121418, -0.5031066536903381, 0.9583520293235779, -0.23210509121418, - -0.5031066536903381, 0.9583520293235779, -0.23210509121418, 1.3183971643447876, 1.7042455673217773, - -0.3201166093349457, 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, 1.3183971643447876, - 1.7042455673217773, -0.3201166093349457, -0.14444805681705475, -0.8829464912414551, 1.725736141204834, - -0.14444805681705475, -0.8829464912414551, 1.725736141204834, -0.14444805681705475, -0.8829464912414551, - 1.725736141204834, 0.45657631754875183, 0.4920198321342468, -1.088847041130066, 0.45657631754875183, - 0.4920198321342468, -1.088847041130066, 0.45657631754875183, 0.4920198321342468, -1.088847041130066, - 0.49437597393989563, -0.006085286382585764, 2.475630760192871, 0.49437597393989563, -0.006085286382585764, - 2.475630760192871, 0.49437597393989563, -0.006085286382585764, 2.475630760192871, 0.12170185893774033, - -0.8953945636749268, 1.1430096626281738, 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, - 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, 1.3278610706329346, 0.3076854348182678, - 0.036237504333257675, 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, 1.3278610706329346, - 0.3076854348182678, 0.036237504333257675, 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, - 1.3183971643447876, 1.7042455673217773, -0.3201166093349457, 1.3183971643447876, 1.7042455673217773, - -0.3201166093349457, -0.14444805681705475, -0.8829464912414551, 1.725736141204834, -0.14444805681705475, - -0.8829464912414551, 1.725736141204834, -0.14444805681705475, -0.8829464912414551, 1.725736141204834, - 0.45657631754875183, 0.4920198321342468, -1.088847041130066, 0.45657631754875183, 0.4920198321342468, - -1.088847041130066, 0.45657631754875183, 0.4920198321342468, -1.088847041130066, 0.49437597393989563, - -0.006085286382585764, 2.475630760192871, 0.49437597393989563, -0.006085286382585764, 2.475630760192871, - 0.49437597393989563, -0.006085286382585764, 2.475630760192871, 0.12170185893774033, -0.8953945636749268, - 1.1430096626281738, 0.12170185893774033, -0.8953945636749268, 1.1430096626281738, 0.12170185893774033, - -0.8953945636749268, 1.1430096626281738, 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, - 1.3278610706329346, 0.3076854348182678, 0.036237504333257675, 1.3278610706329346, 0.3076854348182678, - 0.036237504333257675, 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, 0.05180325731635094, - 0.2802475392818451, 0.5289335250854492, 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, - 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, 0.9356630444526672, 0.7863689064979553, - 0.4239695370197296, 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, 0.8723016977310181, - -0.2248474359512329, 0.3891502320766449, 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, - 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, 0.5463842153549194, -0.7782878875732422, - -0.8570080399513245, 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, 0.5463842153549194, - -0.7782878875732422, -0.8570080399513245, -2.593783378601074, -0.11392943561077118, 0.5637082457542419, - -2.593783378601074, -0.11392943561077118, 0.5637082457542419, -2.593783378601074, -0.11392943561077118, - 0.5637082457542419, 2.075004816055298, -1.0598397254943848, 1.0823975801467896, 2.075004816055298, - -1.0598397254943848, 1.0823975801467896, 2.075004816055298, -1.0598397254943848, 1.0823975801467896, - 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, 0.05180325731635094, 0.2802475392818451, - 0.5289335250854492, 0.05180325731635094, 0.2802475392818451, 0.5289335250854492, 0.9356630444526672, - 0.7863689064979553, 0.4239695370197296, 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, - 0.9356630444526672, 0.7863689064979553, 0.4239695370197296, 0.8723016977310181, -0.2248474359512329, - 0.3891502320766449, 0.8723016977310181, -0.2248474359512329, 0.3891502320766449, 0.8723016977310181, - -0.2248474359512329, 0.3891502320766449, 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, - 0.5463842153549194, -0.7782878875732422, -0.8570080399513245, 0.5463842153549194, -0.7782878875732422, - -0.8570080399513245, -2.593783378601074, -0.11392943561077118, 0.5637082457542419, -2.593783378601074, - -0.11392943561077118, 0.5637082457542419, -2.593783378601074, -0.11392943561077118, 0.5637082457542419, - 2.075004816055298, -1.0598397254943848, 1.0823975801467896, 2.075004816055298, -1.0598397254943848, - 1.0823975801467896, 2.075004816055298, -1.0598397254943848, 1.0823975801467896, -}; -} // namespace ComplexTile_ExpectedOutput diff --git a/tmva/sofie/test/input_models/references/TopK.ref.hxx b/tmva/sofie/test/input_models/references/TopK.ref.hxx deleted file mode 100644 index 71537a019f183..0000000000000 --- a/tmva/sofie/test/input_models/references/TopK.ref.hxx +++ /dev/null @@ -1,6 +0,0 @@ -namespace TopK_ExpectedOutput { -float values[] = { - 9.0000, 8.0000, 7.4000, 4.5000, 4.0000}; - -float indexes[] = {0, 1, 8, 2, 6}; -} // namespace TopK_ExpectedOutput diff --git a/tmva/sofie/test/test_helpers.h b/tmva/sofie/test/test_helpers.h index 66bd31fe150ac..277366db32bce 100644 --- a/tmva/sofie/test/test_helpers.h +++ b/tmva/sofie/test/test_helpers.h @@ -2,14 +2,109 @@ #include #include #include +#include #include #include +#include #include #include +#include "gtest/gtest.h" + constexpr float DEFAULT_TOLERANCE = 1e-3f; +/// Reference data for one model: the test inputs and the expected outputs, +/// read from the references/.ref file that generate_input_models.py +/// writes next to the generated ONNX models. Entries are keyed "input0", +/// "input1", ... (one per graph input, in graph order) and "output0", ... +/// (one per graph output). +class SofieReference { +public: + const std::vector &f32(std::string const &key) const { return at(fF32, key); } + const std::vector &f64(std::string const &key) const { return at(fF64, key); } + const std::vector &i64(std::string const &key) const { return at(fI64, key); } + const std::vector &u8(std::string const &key) const { return at(fU8, key); } + + std::map> fF32; + std::map> fF64; + std::map> fI64; + std::map> fU8; + +private: + template + static const typename Map::mapped_type &at(Map const &m, std::string const &key) + { + auto it = m.find(key); + if (it == m.end()) + throw std::runtime_error("no reference data entry \"" + key + "\" of this type"); + return it->second; + } +}; + +inline SofieReference readReference(std::string const &modelName) +{ + const std::string path = "input_models/references/" + modelName + ".ref"; + std::ifstream in(path); + if (!in) + throw std::runtime_error("cannot open reference data file " + path + + " (it is written by the SofieGenerateModels_ONNX test)"); + SofieReference ref; + std::string key, type; + std::size_t count; + while (in >> key >> type >> count) { + bool ok = true; + if (type == "f32") { + auto &v = ref.fF32[key]; + v.resize(count); + for (auto &x : v) + ok &= bool(in >> x); + } else if (type == "f64") { + auto &v = ref.fF64[key]; + v.resize(count); + for (auto &x : v) + ok &= bool(in >> x); + } else if (type == "i64") { + auto &v = ref.fI64[key]; + v.resize(count); + for (auto &x : v) + ok &= bool(in >> x); + } else if (type == "u8") { + auto &v = ref.fU8[key]; + v.resize(count); + for (auto &x : v) { + int tmp; + ok &= bool(in >> tmp); + x = static_cast(tmp); + } + } else { + ok = false; + } + if (!ok) + throw std::runtime_error("malformed reference data file " + path + " at entry \"" + key + "\""); + } + return ref; +} + +/// Element-wise |output - expected| <= tolerance +template +void expectNear(std::vector const &output, std::vector const &expected, float tolerance) +{ + ASSERT_EQ(output.size(), expected.size()); + for (std::size_t i = 0; i < output.size(); ++i) + EXPECT_LE(std::abs(static_cast(output[i]) - static_cast(expected[i])), tolerance) + << "at output index " << i; +} + +/// Element-wise exact equality +template +void expectEqual(std::vector const &output, std::vector const &expected) +{ + ASSERT_EQ(output.size(), expected.size()); + for (std::size_t i = 0; i < output.size(); ++i) + EXPECT_EQ(static_cast(output[i]), static_cast(expected[i])) << "at output index " << i; +} + bool includeModel(std::string const &modelName) { const std::string header = modelName + modelHeaderSuffix; diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 3297527a27e8f..6897acce3dbd0 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -384,11 +384,18 @@ else() list(APPEND tmva_veto machine_learning/TMVA_SOFIE_GNN.py) list(APPEND tmva_veto machine_learning/TMVA_SOFIE_GNN_Application.C) endif() - if (NOT tmva-sofie) + if (NOT tmva-sofie OR NOT ROOT_ONNX_FOUND) list(APPEND tmva_veto machine_learning/TMVA_SOFIE_ONNX.C) else() - #copy ONNX file needed for the tutorial - configure_file(${CMAKE_SOURCE_DIR}/tmva/sofie/test/input_models/Linear_16.onnx ${CMAKE_BINARY_DIR}/tutorials/machine_learning/Linear_16.onnx COPYONLY) + #generate ONNX file needed for the tutorial + execute_process( + COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tmva/sofie/test/generate_input_models.py + --no-references --outdir ${CMAKE_BINARY_DIR}/tutorials/machine_learning Linear_16 + RESULT_VARIABLE _sofie_onnx_gen_status) + if (NOT _sofie_onnx_gen_status EQUAL 0) + message(WARNING "Could not generate Linear_16.onnx: the TMVA_SOFIE_ONNX.C tutorial will be disabled.") + list(APPEND tmva_veto machine_learning/TMVA_SOFIE_ONNX.C) + endif() endif() endif()