// Generated from cast.mod.py // DO NOT EDIT // clang-format off #include "TestHarness.h" using namespace test_helper; namespace generated_tests::cast { const TestModel& get_test_model_float16_to_float16() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_float16 = TestModelManager::get().add("cast_float16_to_float16", get_test_model_float16_to_float16()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_float16_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // input0_new .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // placeholder .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // param .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_float16_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_float16_all_inputs_as_internal", get_test_model_float16_to_float16_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_float32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_float32 = TestModelManager::get().add("cast_float16_to_float32", get_test_model_float16_to_float32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_float32_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // input0_new .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // placeholder1 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // param1 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_float32_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_float32_all_inputs_as_internal", get_test_model_float16_to_float32_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_float32_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_float32_relaxed = TestModelManager::get().add("cast_float16_to_float32_relaxed", get_test_model_float16_to_float32_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_float32_relaxed_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {2}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // input0_new .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // placeholder2 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_float32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_float32_relaxed_all_inputs_as_internal", get_test_model_float16_to_float32_relaxed_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_int32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_int32 = TestModelManager::get().add("cast_float16_to_int32", get_test_model_float16_to_int32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_int32_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // input0_new .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // placeholder3 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // param3 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_int32_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_int32_all_inputs_as_internal", get_test_model_float16_to_int32_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_quant8() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_quant8 = TestModelManager::get().add("cast_float16_to_quant8", get_test_model_float16_to_quant8()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_quant8_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // input0_new .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // placeholder4 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // param4 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_quant8_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_quant8_all_inputs_as_internal", get_test_model_float16_to_quant8_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float16() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float16 = TestModelManager::get().add("cast_float32_to_float16", get_test_model_float32_to_float16()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float16_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder5 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param5 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float16_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float16_all_inputs_as_internal", get_test_model_float32_to_float16_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float16_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float16_relaxed = TestModelManager::get().add("cast_float32_to_float16_relaxed", get_test_model_float32_to_float16_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float16_relaxed_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder6 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param6 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float16_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float16_relaxed_all_inputs_as_internal", get_test_model_float32_to_float16_relaxed_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float32 = TestModelManager::get().add("cast_float32_to_float32", get_test_model_float32_to_float32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float32_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder7 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param7 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float32_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float32_all_inputs_as_internal", get_test_model_float32_to_float32_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float32_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float32_relaxed = TestModelManager::get().add("cast_float32_to_float32_relaxed", get_test_model_float32_to_float32_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_float32_relaxed_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder8 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param8 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_float32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_float32_relaxed_all_inputs_as_internal", get_test_model_float32_to_float32_relaxed_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_int32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_int32 = TestModelManager::get().add("cast_float32_to_int32", get_test_model_float32_to_int32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_int32_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder9 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param9 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_int32_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_int32_all_inputs_as_internal", get_test_model_float32_to_int32_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_int32_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_int32_relaxed = TestModelManager::get().add("cast_float32_to_int32_relaxed", get_test_model_float32_to_int32_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_int32_relaxed_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder10 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param10 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_int32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_int32_relaxed_all_inputs_as_internal", get_test_model_float32_to_int32_relaxed_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8 = TestModelManager::get().add("cast_float32_to_quant8", get_test_model_float32_to_quant8()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder11 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param11 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_all_inputs_as_internal", get_test_model_float32_to_quant8_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8_relaxed = TestModelManager::get().add("cast_float32_to_quant8_relaxed", get_test_model_float32_to_quant8_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8_relaxed_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {2}, .operands = {{ // input01 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // input01_new .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder12 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param12 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_relaxed_all_inputs_as_internal", get_test_model_float32_to_quant8_relaxed_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_int32_to_float16() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_int32_to_float16 = TestModelManager::get().add("cast_int32_to_float16", get_test_model_int32_to_float16()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_int32_to_float32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_int32_to_float32 = TestModelManager::get().add("cast_int32_to_float32", get_test_model_int32_to_float32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_int32_to_float32_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_int32_to_float32_relaxed = TestModelManager::get().add("cast_int32_to_float32_relaxed", get_test_model_int32_to_float32_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_int32_to_int32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_int32_to_int32 = TestModelManager::get().add("cast_int32_to_int32", get_test_model_int32_to_int32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_int32_to_quant8() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_int32_to_quant8 = TestModelManager::get().add("cast_int32_to_quant8", get_test_model_int32_to_quant8()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_float16() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_float16 = TestModelManager::get().add("cast_quant8_to_float16", get_test_model_quant8_to_float16()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_float16_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output0 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // input03_new .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // placeholder13 .channelQuant = {}, .data = TestBuffer::createFromVector({100}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // param13 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_float16_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_float16_all_inputs_as_internal", get_test_model_quant8_to_float16_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_float32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_float32 = TestModelManager::get().add("cast_quant8_to_float32", get_test_model_quant8_to_float32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_float32_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // input03_new .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // placeholder14 .channelQuant = {}, .data = TestBuffer::createFromVector({100}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // param14 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_float32_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_float32_all_inputs_as_internal", get_test_model_quant8_to_float32_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_float32_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_float32_relaxed = TestModelManager::get().add("cast_quant8_to_float32_relaxed", get_test_model_quant8_to_float32_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_float32_relaxed_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {2}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output01 .channelQuant = {}, .data = TestBuffer::createFromVector({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // input03_new .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // placeholder15 .channelQuant = {}, .data = TestBuffer::createFromVector({100}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // param15 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_float32_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_float32_relaxed_all_inputs_as_internal", get_test_model_quant8_to_float32_relaxed_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_int32() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_int32 = TestModelManager::get().add("cast_quant8_to_int32", get_test_model_quant8_to_int32()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_int32_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output02 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // input03_new .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // placeholder16 .channelQuant = {}, .data = TestBuffer::createFromVector({100}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // param16 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_int32_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_int32_all_inputs_as_internal", get_test_model_quant8_to_int32_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_quant8() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_quant8 = TestModelManager::get().add("cast_quant8_to_quant8", get_test_model_quant8_to_quant8()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_quant8_to_quant8_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input03 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // output03 .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // input03_new .channelQuant = {}, .data = TestBuffer::createFromVector({1, 2, 3, 4, 5, 6}), .dimensions = {2, 3}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // placeholder17 .channelQuant = {}, .data = TestBuffer::createFromVector({100}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // param17 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_quant8_to_quant8_all_inputs_as_internal = TestModelManager::get().add("cast_quant8_to_quant8_all_inputs_as_internal", get_test_model_quant8_to_quant8_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_quant8_overflow() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input04 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({-1.0f, 256.0f}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output04 .channelQuant = {}, .data = TestBuffer::createFromVector({0, 255}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_quant8_overflow = TestModelManager::get().add("cast_float16_to_quant8_overflow", get_test_model_float16_to_quant8_overflow()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float16_to_quant8_overflow_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input04 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // output04 .channelQuant = {}, .data = TestBuffer::createFromVector({0, 255}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // input04_new .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({-1.0f, 256.0f}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // placeholder18 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 }, { // param18 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float16_to_quant8_overflow_all_inputs_as_internal = TestModelManager::get().add("cast_float16_to_quant8_overflow_all_inputs_as_internal", get_test_model_float16_to_quant8_overflow_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8_overflow() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input05 .channelQuant = {}, .data = TestBuffer::createFromVector({-1.0f, 256.0f}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output05 .channelQuant = {}, .data = TestBuffer::createFromVector({0, 255}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8_overflow = TestModelManager::get().add("cast_float32_to_quant8_overflow", get_test_model_float32_to_quant8_overflow()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8_overflow_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {2}, .operands = {{ // input05 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output05 .channelQuant = {}, .data = TestBuffer::createFromVector({0, 255}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // input05_new .channelQuant = {}, .data = TestBuffer::createFromVector({-1.0f, 256.0f}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder19 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param19 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8_overflow_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_overflow_all_inputs_as_internal", get_test_model_float32_to_quant8_overflow_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8_overflow_relaxed() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {0}, .operands = {{ // input05 .channelQuant = {}, .data = TestBuffer::createFromVector({-1.0f, 256.0f}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output05 .channelQuant = {}, .data = TestBuffer::createFromVector({0, 255}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8_overflow_relaxed = TestModelManager::get().add("cast_float32_to_quant8_overflow_relaxed", get_test_model_float32_to_quant8_overflow_relaxed()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_float32_to_quant8_overflow_relaxed_all_inputs_as_internal() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = true, .main = { .inputIndexes = {2}, .operands = {{ // input05 .channelQuant = {}, .data = TestBuffer::createFromVector({}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // output05 .channelQuant = {}, .data = TestBuffer::createFromVector({0, 255}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }, { // input05_new .channelQuant = {}, .data = TestBuffer::createFromVector({-1.0f, 256.0f}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // placeholder20 .channelQuant = {}, .data = TestBuffer::createFromVector({0.0f}), .dimensions = {1}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 }, { // param20 .channelQuant = {}, .data = TestBuffer::createFromVector({0}), .dimensions = {}, .isIgnored = false, .lifetime = TestOperandLifeTime::CONSTANT_COPY, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::INT32, .zeroPoint = 0 }}, .operations = {{ .inputs = {2, 3, 4}, .outputs = {0}, .type = TestOperationType::ADD }, { .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::UNKNOWN, .referenced = {} }; return model; } const auto dummy_test_model_float32_to_quant8_overflow_relaxed_all_inputs_as_internal = TestModelManager::get().add("cast_float32_to_quant8_overflow_relaxed_all_inputs_as_internal", get_test_model_float32_to_quant8_overflow_relaxed_all_inputs_as_internal()); } // namespace generated_tests::cast namespace generated_tests::cast { const TestModel& get_test_model_int32_to_quant8_overflow() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, .isRelaxed = false, .main = { .inputIndexes = {0}, .operands = {{ // input06 .channelQuant = {}, .data = TestBuffer::createFromVector({-1, 256}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, .numberOfConsumers = 1, .scale = 0.0f, .type = TestOperandType::TENSOR_INT32, .zeroPoint = 0 }, { // output06 .channelQuant = {}, .data = TestBuffer::createFromVector({0, 255}), .dimensions = {2}, .isIgnored = false, .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, .numberOfConsumers = 0, .scale = 4.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 100 }}, .operations = {{ .inputs = {0}, .outputs = {1}, .type = TestOperationType::CAST }}, .outputIndexes = {1} }, .minSupportedVersion = TestHalVersion::V1_2, .referenced = {} }; return model; } const auto dummy_test_model_int32_to_quant8_overflow = TestModelManager::get().add("cast_int32_to_quant8_overflow", get_test_model_int32_to_quant8_overflow()); } // namespace generated_tests::cast