diff options
Diffstat (limited to 'nn/runtime/test')
94 files changed, 23391 insertions, 1235 deletions
diff --git a/nn/runtime/test/Android.bp b/nn/runtime/test/Android.bp index 8874eee69..aed0c4e60 100644 --- a/nn/runtime/test/Android.bp +++ b/nn/runtime/test/Android.bp @@ -63,8 +63,6 @@ cc_defaults { // // Changes to this list must be reflected in the "CtsNNAPITests_static" // library to ensure CTS tests coverage. - // TODO(xusongw): Re-enable once b/141294076 is fixed. - // "TestUnspecifiedDimensions.cpp", "GeneratedTestUtils.cpp", "TestAssertions.cpp", "TestControlFlow.cpp", @@ -75,6 +73,7 @@ cc_defaults { "TestOperandExtraParams.cpp", "TestTrivialModel.cpp", "TestUnknownDimensions.cpp", + "TestUnspecifiedDimensions.cpp", "TestValidateModel.cpp", "TestValidateOperations.cpp", @@ -131,6 +130,7 @@ cc_defaults { "TestPartitioning.cpp", "TestPartitioningRandom.cpp", "TestRemoveDefaultArguments.cpp", + "TestVersionedInterfaces.cpp", "fibonacci_extension/FibonacciDriver.cpp", "fibonacci_extension/FibonacciExtensionTest.cpp", @@ -140,7 +140,9 @@ cc_defaults { ], static_libs: [ "android.hardware.neuralnetworks@1.0-adapter-helper", + "android.hardware.neuralnetworks@1.1-adapter-helper", "android.hardware.neuralnetworks@1.2-adapter-helper", + "android.hardware.neuralnetworks@1.3-adapter-helper", "libSampleDriver", "libgmock", "libhidladapter", @@ -153,6 +155,7 @@ cc_defaults { ], header_libs: [ "libneuralnetworks_private_headers", + "libutils_headers", "neuralnetworks_example_fibonacci_extension", ], } diff --git a/nn/runtime/test/TestIntrospectionControl.cpp b/nn/runtime/test/TestIntrospectionControl.cpp index b33e06a69..913e6ed15 100644 --- a/nn/runtime/test/TestIntrospectionControl.cpp +++ b/nn/runtime/test/TestIntrospectionControl.cpp @@ -361,7 +361,7 @@ std::ostream& operator<<(std::ostream& os, Success success) { {Success::PASS_FENCED_DRIVER_BIT, "FENCED_DRIVER"}, }; bool gotOutput = false; - for (const auto b : bits) { + for (const auto& b : bits) { if (hasBit(success, b.first)) { if (gotOutput) { os << '|'; @@ -430,6 +430,7 @@ class TestPreparedModelLatest : public SamplePreparedModel { }).detach(); return V1_0::ErrorStatus::NONE; case Success::FAIL_LAUNCH: + dummyExecution(); callback->notify(V1_0::ErrorStatus::GENERAL_FAILURE); return V1_0::ErrorStatus::GENERAL_FAILURE; case Success::FAIL_WAIT: @@ -459,6 +460,7 @@ class TestPreparedModelLatest : public SamplePreparedModel { }).detach(); return V1_0::ErrorStatus::NONE; case Success::FAIL_LAUNCH: + dummyExecution(); callback->notify(V1_0::ErrorStatus::GENERAL_FAILURE); return V1_0::ErrorStatus::GENERAL_FAILURE; case Success::FAIL_WAIT: @@ -497,9 +499,9 @@ class TestPreparedModelLatest : public SamplePreparedModel { // runtime may call it even for asynchronous execution, so we // need to tolerate Success::FAIL_WAIT here, not just // Success::FAIL_LAUNCH. - dummyExecution(); FALLTHROUGH_INTENDED; case Success::FAIL_LAUNCH: + dummyExecution(); cb(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kBadTiming); return Void(); default: @@ -540,6 +542,7 @@ class TestPreparedModelLatest : public SamplePreparedModel { const OptionalTimeoutDuration&, executeFenced_cb callback) override { EXPECT_EQ(measure, MeasureTiming::YES); if (hasBit(mSuccess, Success::PASS_BIT)) { + dummyExecution(); const auto expectedTiming = getExpectedTiming(mSuccess, true); sp<SampleFencedExecutionCallback> fencedExecutionCallback = new SampleFencedExecutionCallback(expectedTiming.first, expectedTiming.second, @@ -548,19 +551,16 @@ class TestPreparedModelLatest : public SamplePreparedModel { return Void(); } switch (mSuccess) { + case Success::FAIL_WAIT: + // Due to the limitation of the SampleDriver, + // FAIL_WAIT behaves the same as FAIL_LAUNCH. + // If the SampleDriver is updated to return real + // sync fences, this must be updated. + FALLTHROUGH_INTENDED; case Success::FAIL_LAUNCH: + dummyExecution(); callback(V1_3::ErrorStatus::GENERAL_FAILURE, hidl_handle(nullptr), nullptr); return Void(); - case Success::FAIL_WAIT: - std::thread([callback] { - dummyExecution(); - // Due to the limitation of the SampleDriver, - // FAIL_WAIT behaves the same as FAIL_LAUNCH. - // If the SampleDriver is updated to return real - // sync fences, this must be updated. - callback(V1_3::ErrorStatus::GENERAL_FAILURE, hidl_handle(nullptr), nullptr); - }).detach(); - return Void(); default: ADD_FAILURE() << "Unexpected Success kind"; return Void(); @@ -579,7 +579,7 @@ class TestPreparedModelLatest : public SamplePreparedModel { // - // thread B: pauseExecutions(false); static void waitForExecutionToBegin() { CHECK(mPauseExecutions.load()); - while (mExecutionsInFlight.load()) { + while (mExecutionsInFlight.load() == 0) { } } @@ -875,7 +875,7 @@ TEST_P(TimingTest, Test) { isPass ? ANEURALNETWORKS_NO_ERROR : ANEURALNETWORKS_BAD_STATE; const auto getDurationWhileRunning = [this] { - if (kDriverKind == DriverKind::CPU && kSuccess == Success::FAIL_LAUNCH) { + if (kDriverKind == DriverKind::CPU) { // Testing DriverKind::CPU would require modifying the CPU execution // path to control execution completion, similarly to how this test // case does with TestPreparedModel::dummyExecution(). This does not diff --git a/nn/runtime/test/TestRemoveDefaultArguments.cpp b/nn/runtime/test/TestRemoveDefaultArguments.cpp index 6142aa610..ac4ad7d14 100644 --- a/nn/runtime/test/TestRemoveDefaultArguments.cpp +++ b/nn/runtime/test/TestRemoveDefaultArguments.cpp @@ -137,6 +137,10 @@ class TestDriver : public SampleDriverPartial { class TestRemoveDefaultArguments : public ::testing::Test { virtual void SetUp() { + // skip the tests if useCpuOnly = 1 + if (DeviceManager::get()->getUseCpuOnly()) { + GTEST_SKIP(); + } mTestDriver = new TestDriver(); DeviceManager::get()->forTest_registerDevice(kTestDriverName, mTestDriver); mTestDevice = getDeviceByName(kTestDriverName); diff --git a/nn/runtime/test/TestVersionedInterfaces.cpp b/nn/runtime/test/TestVersionedInterfaces.cpp new file mode 100644 index 000000000..6d1306d57 --- /dev/null +++ b/nn/runtime/test/TestVersionedInterfaces.cpp @@ -0,0 +1,2916 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <android-base/logging.h> +#include <android/hardware/neuralnetworks/1.0/ADevice.h> +#include <android/hardware/neuralnetworks/1.1/ADevice.h> +#include <android/hardware/neuralnetworks/1.2/ADevice.h> +#include <android/hardware/neuralnetworks/1.3/ADevice.h> +#include <gmock/gmock.h> +#include <gtest/gtest.h> +#include <hidl/Status.h> +#include <utils/Errors.h> + +#include <limits> +#include <memory> +#include <utility> +#include <vector> + +#include "HalInterfaces.h" +#include "MemoryUtils.h" +#include "MetaModel.h" +#include "VersionedInterfaces.h" + +namespace android::nn { +namespace { + +using namespace hal; +using testing::_; +using testing::Invoke; +using testing::InvokeWithoutArgs; +using testing::MockFunction; +using MockDeviceFactory = MockFunction<sp<V1_0::IDevice>(bool blocking)>; + +constexpr uint32_t kNoCacheFilesNeeded = 0; +constexpr uint32_t kMaxNumberOfCacheFiles = + static_cast<uint32_t>(Constant::MAX_NUMBER_OF_CACHE_FILES); +constexpr Timing kNoTiming = {.timeOnDevice = std::numeric_limits<uint64_t>::max(), + .timeInDriver = std::numeric_limits<uint64_t>::max()}; + +template <typename... Args> +auto makeCallbackReturn(Args&&... args) { + return [argPack = std::make_tuple(std::forward<Args>(args)...)](const auto& cb) { + std::apply(cb, argPack); + return Void(); + }; +}; + +class MockDevice : public IDevice { + public: + static sp<MockDevice> create() { + const sp<MockDevice> mockDevice = new MockDevice(); + + const auto linkToDeathRet_ret = []() -> Return<bool> { return true; }; + const auto getCapabilities_ret = + makeCallbackReturn(V1_0::ErrorStatus::NONE, V1_0::Capabilities{}); + const auto getCapabilities_1_1_ret = + makeCallbackReturn(V1_0::ErrorStatus::NONE, V1_1::Capabilities{}); + const auto getVersionString_ret = + makeCallbackReturn(V1_0::ErrorStatus::NONE, "Google-MockV1"); + const auto getType_ret = makeCallbackReturn(V1_0::ErrorStatus::NONE, DeviceType::OTHER); + const auto getCapabilities_1_2_ret = + makeCallbackReturn(V1_0::ErrorStatus::NONE, V1_2::Capabilities{}); + const auto getSupportedExtensions_ret = + makeCallbackReturn(V1_0::ErrorStatus::NONE, hidl_vec<Extension>{}); + const auto getNumberOfCacheFilesNeeded_ret = makeCallbackReturn( + V1_0::ErrorStatus::NONE, kMaxNumberOfCacheFiles, kMaxNumberOfCacheFiles); + const auto getCapabilities_1_3_ret = + makeCallbackReturn(V1_3::ErrorStatus::NONE, V1_3::Capabilities{}); + + ON_CALL(*mockDevice, linkToDeathRet()).WillByDefault(Invoke(linkToDeathRet_ret)); + ON_CALL(*mockDevice, getCapabilities(_)).WillByDefault(Invoke(getCapabilities_ret)); + ON_CALL(*mockDevice, getCapabilities_1_1(_)).WillByDefault(Invoke(getCapabilities_1_1_ret)); + ON_CALL(*mockDevice, getVersionString(_)).WillByDefault(Invoke(getVersionString_ret)); + ON_CALL(*mockDevice, getType(_)).WillByDefault(Invoke(getType_ret)); + ON_CALL(*mockDevice, getCapabilities_1_2(_)).WillByDefault(Invoke(getCapabilities_1_2_ret)); + ON_CALL(*mockDevice, getSupportedExtensions(_)) + .WillByDefault(Invoke(getSupportedExtensions_ret)); + ON_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)) + .WillByDefault(Invoke(getNumberOfCacheFilesNeeded_ret)); + ON_CALL(*mockDevice, getCapabilities_1_3(_)).WillByDefault(Invoke(getCapabilities_1_3_ret)); + + // These EXPECT_CALL(...).Times(testing::AnyNumber()) calls are to + // suppress warnings on the uninteresting methods calls. + EXPECT_CALL(*mockDevice, linkToDeathRet()).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getCapabilities(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getCapabilities_1_1(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getVersionString(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getType(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getCapabilities_1_2(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, getCapabilities_1_3(_)).Times(testing::AnyNumber()); + + return mockDevice; + } + + // IBase methods below. + Return<bool> linkToDeath(const sp<hidl_death_recipient>& recipient, + uint64_t /*cookie*/) override { + mDeathRecipient = recipient; + return linkToDeathRet(); + } + MOCK_METHOD(Return<void>, ping, (), (override)); + + // V1_0 methods below. + MOCK_METHOD(Return<void>, getCapabilities, (getCapabilities_cb cb), (override)); + MOCK_METHOD(Return<void>, getSupportedOperations, + (const V1_0::Model& model, getSupportedOperations_cb cb), (override)); + MOCK_METHOD(Return<V1_0::ErrorStatus>, prepareModel, + (const V1_0::Model& model, const sp<V1_0::IPreparedModelCallback>& callback), + (override)); + MOCK_METHOD(Return<DeviceStatus>, getStatus, (), (override)); + + // V1_1 methods below. + MOCK_METHOD(Return<void>, getCapabilities_1_1, (getCapabilities_1_1_cb cb), (override)); + MOCK_METHOD(Return<void>, getSupportedOperations_1_1, + (const V1_1::Model& model, getSupportedOperations_1_1_cb cb), (override)); + MOCK_METHOD(Return<V1_0::ErrorStatus>, prepareModel_1_1, + (const V1_1::Model& model, ExecutionPreference preference, + const sp<V1_0::IPreparedModelCallback>& callback), + (override)); + + // V1_2 methods below. + MOCK_METHOD(Return<void>, getVersionString, (getVersionString_cb cb), (override)); + MOCK_METHOD(Return<void>, getType, (getType_cb cb), (override)); + MOCK_METHOD(Return<void>, getCapabilities_1_2, (getCapabilities_1_2_cb cb), (override)); + MOCK_METHOD(Return<void>, getSupportedExtensions, (getSupportedExtensions_cb cb), (override)); + MOCK_METHOD(Return<void>, getSupportedOperations_1_2, + (const V1_2::Model& model, getSupportedOperations_1_2_cb cb), (override)); + MOCK_METHOD(Return<void>, getNumberOfCacheFilesNeeded, (getNumberOfCacheFilesNeeded_cb cb), + (override)); + MOCK_METHOD(Return<V1_0::ErrorStatus>, prepareModel_1_2, + (const V1_2::Model& model, ExecutionPreference preference, + const hidl_vec<hidl_handle>& modelCache, const hidl_vec<hidl_handle>& dataCache, + const CacheToken& token, const sp<V1_2::IPreparedModelCallback>& callback), + (override)); + MOCK_METHOD(Return<V1_0::ErrorStatus>, prepareModelFromCache, + (const hidl_vec<hidl_handle>& modelCache, const hidl_vec<hidl_handle>& dataCache, + const CacheToken& token, const sp<V1_2::IPreparedModelCallback>& callback), + (override)); + + // V1_3 methods below. + MOCK_METHOD(Return<void>, getCapabilities_1_3, (getCapabilities_1_3_cb cb), (override)); + MOCK_METHOD(Return<void>, getSupportedOperations_1_3, + (const V1_3::Model& model, getSupportedOperations_1_3_cb cb), (override)); + MOCK_METHOD(Return<V1_3::ErrorStatus>, prepareModel_1_3, + (const V1_3::Model& model, ExecutionPreference preference, Priority priority, + const OptionalTimePoint& deadline, const hidl_vec<hidl_handle>& modelCache, + const hidl_vec<hidl_handle>& dataCache, const CacheToken& token, + const sp<V1_3::IPreparedModelCallback>& callback), + (override)); + MOCK_METHOD(Return<V1_3::ErrorStatus>, prepareModelFromCache_1_3, + (const OptionalTimePoint& deadline, const hidl_vec<hidl_handle>& modelCache, + const hidl_vec<hidl_handle>& dataCache, const CacheToken& token, + const sp<V1_3::IPreparedModelCallback>& callback), + (override)); + MOCK_METHOD(Return<void>, allocate, + (const BufferDesc& desc, const hidl_vec<sp<V1_3::IPreparedModel>>& preparedModels, + const hidl_vec<BufferRole>& inputRoles, const hidl_vec<BufferRole>& outputRoles, + allocate_cb cb), + (override)); + + // Helper methods. + MOCK_METHOD(Return<bool>, linkToDeathRet, ()); + void simulateCrash() { + ASSERT_NE(nullptr, mDeathRecipient.get()); + + // Currently, the VersionedInterfaces code will not use the `cookie` or + // `who` arguments, so we pass in 0 and nullptr for these arguments + // instead. Normally, they are used by the hidl_death_recipient to + // determine which object is dead. However, the VersionedInterfaces + // code only pairs a single death recipient with a single HIDL + // interface object, so these arguments are redundant. + mDeathRecipient->serviceDied(0, nullptr); + } + + private: + // Members. + sp<hidl_death_recipient> mDeathRecipient; +}; + +class MockPreparedModel : public IPreparedModel { + public: + static sp<MockPreparedModel> create() { + const sp<MockPreparedModel> mockPreparedModel = new MockPreparedModel(); + + const auto linkToDeathRet_ret = []() -> Return<bool> { return true; }; + ON_CALL(*mockPreparedModel, linkToDeathRet()).WillByDefault(Invoke(linkToDeathRet_ret)); + + // This EXPECT_CALL(...).Times(testing::AnyNumber()) calls are to + // suppress warnings on the uninteresting methods calls. + EXPECT_CALL(*mockPreparedModel, linkToDeathRet()).Times(testing::AnyNumber()); + + return mockPreparedModel; + } + + // IBase methods below. + Return<bool> linkToDeath(const sp<hidl_death_recipient>& recipient, + uint64_t /*cookie*/) override { + mDeathRecipient = recipient; + return linkToDeathRet(); + } + MOCK_METHOD(Return<void>, ping, (), (override)); + + // V1_0 methods below. + MOCK_METHOD(Return<V1_0::ErrorStatus>, execute, + (const V1_0::Request& request, const sp<V1_0::IExecutionCallback>& callback), + (override)); + + // V1_2 methods below. + MOCK_METHOD(Return<V1_0::ErrorStatus>, execute_1_2, + (const V1_0::Request& request, MeasureTiming measure, + const sp<V1_2::IExecutionCallback>& callback), + (override)); + MOCK_METHOD(Return<void>, executeSynchronously, + (const V1_0::Request& request, MeasureTiming measure, executeSynchronously_cb cb), + (override)); + MOCK_METHOD(Return<void>, configureExecutionBurst, + (const sp<V1_2::IBurstCallback>& callback, + const hardware::MQDescriptorSync<V1_2::FmqRequestDatum>& requestChannel, + const hardware::MQDescriptorSync<V1_2::FmqResultDatum>& resultChannel, + configureExecutionBurst_cb cb), + (override)); + + // V1_3 methods below. + MOCK_METHOD(Return<ErrorStatus>, execute_1_3, + (const V1_3::Request& request, MeasureTiming measure, + const OptionalTimePoint& deadline, + const OptionalTimeoutDuration& loopTimeoutDuration, + const sp<IExecutionCallback>& callback), + (override)); + MOCK_METHOD(Return<void>, executeSynchronously_1_3, + (const V1_3::Request& request, MeasureTiming measure, + const OptionalTimePoint& deadline, + const OptionalTimeoutDuration& loopTimeoutDuration, + executeSynchronously_1_3_cb cb), + (override)); + MOCK_METHOD(Return<void>, executeFenced, + (const V1_3::Request& request, const hidl_vec<hidl_handle>& waitFor, + MeasureTiming measure, const OptionalTimePoint& deadline, + const OptionalTimeoutDuration& loopTimeoutDuration, + const OptionalTimeoutDuration& duration, executeFenced_cb cb), + (override)); + + // Helper methods. + MOCK_METHOD(Return<bool>, linkToDeathRet, ()); + void simulateCrash() { + ASSERT_NE(nullptr, mDeathRecipient.get()); + + // Currently, the VersionedInterfaces code will not use the `cookie` or + // `who` arguments, so we pass in 0 and nullptr for these arguments + // instead. Normally, they are used by the hidl_death_recipient to + // determine which object is dead. However, the VersionedInterfaces + // code only pairs a single death recipient with a single HIDL + // interface object, so these arguments are redundant. + mDeathRecipient->serviceDied(0, nullptr); + } + + private: + // Members. + sp<hidl_death_recipient> mDeathRecipient; +}; + +class MockBurstContext : public V1_2::IBurstContext { + public: + // V1_2 methods below. + MOCK_METHOD(Return<void>, freeMemory, (int32_t slot), (override)); +}; + +class MockFencedExecutionCallback : public IFencedExecutionCallback { + public: + // V1_3 methods below. + MOCK_METHOD(Return<void>, getExecutionInfo, (getExecutionInfo_cb cb), (override)); +}; + +class MockBuffer : public IBuffer { + public: + // V1_3 methods below. + MOCK_METHOD(Return<ErrorStatus>, copyTo, (const hidl_memory& dst), (override)); + MOCK_METHOD(Return<ErrorStatus>, copyFrom, + (const hidl_memory& src, const hidl_vec<uint32_t>& dimensions), (override)); +}; + +enum class Version { V1_0, V1_1, V1_2, V1_3, MOCK }; + +sp<V1_0::IDevice> adaptAs(const sp<MockDevice>& mockDevice, Version version) { + switch (version) { + case Version::V1_0: + return new V1_0::ADevice(mockDevice); + case Version::V1_1: + return new V1_1::ADevice(mockDevice); + case Version::V1_2: + return new V1_2::ADevice(mockDevice); + case Version::V1_3: + return new V1_3::ADevice(mockDevice); + case Version::MOCK: + return mockDevice; + } + LOG(FATAL) << "unrecognized version: " << static_cast<int>(version); + return nullptr; +} + +auto makePreparedModelReturn(V1_0::ErrorStatus launchStatus, V1_0::ErrorStatus returnStatus, + const sp<MockPreparedModel>& preparedModel) { + return [launchStatus, returnStatus, preparedModel]( + const V1_0::Model& /*model*/, + const sp<V1_0::IPreparedModelCallback>& cb) -> Return<V1_0::ErrorStatus> { + cb->notify(returnStatus, preparedModel).isOk(); + return launchStatus; + }; +} +auto makePreparedModel_1_1Return(V1_0::ErrorStatus launchStatus, V1_0::ErrorStatus returnStatus, + const sp<MockPreparedModel>& preparedModel) { + return [launchStatus, returnStatus, preparedModel]( + const V1_1::Model& /*model*/, ExecutionPreference /*preference*/, + const sp<V1_0::IPreparedModelCallback>& cb) -> Return<V1_0::ErrorStatus> { + cb->notify(returnStatus, preparedModel).isOk(); + return launchStatus; + }; +} +auto makePreparedModel_1_2Return(V1_0::ErrorStatus launchStatus, V1_0::ErrorStatus returnStatus, + const sp<MockPreparedModel>& preparedModel) { + return [launchStatus, returnStatus, preparedModel]( + const V1_2::Model& /*model*/, ExecutionPreference /*preference*/, + const auto& /*modelCache*/, const auto& /*dataCache*/, const auto& /*token*/, + const sp<V1_2::IPreparedModelCallback>& cb) -> Return<V1_0::ErrorStatus> { + cb->notify_1_2(returnStatus, preparedModel).isOk(); + return launchStatus; + }; +} +auto makePreparedModel_1_3Return(V1_3::ErrorStatus launchStatus, V1_3::ErrorStatus returnStatus, + const sp<MockPreparedModel>& preparedModel) { + return [launchStatus, returnStatus, preparedModel]( + const V1_3::Model& /*model*/, ExecutionPreference /*preference*/, + Priority /*priority*/, const OptionalTimePoint& /*deadline*/, + const hidl_vec<hidl_handle>& /*modelCache*/, + const hidl_vec<hidl_handle>& /*dataCache*/, const CacheToken& /*token*/, + const sp<V1_3::IPreparedModelCallback>& cb) -> Return<V1_3::ErrorStatus> { + cb->notify_1_3(returnStatus, preparedModel).isOk(); + return launchStatus; + }; +} + +auto makeExecuteReturn(V1_0::ErrorStatus launchStatus, V1_0::ErrorStatus returnStatus) { + return [launchStatus, returnStatus]( + const V1_0::Request& /*request*/, + const sp<V1_0::IExecutionCallback>& cb) -> Return<V1_0::ErrorStatus> { + cb->notify(returnStatus); + return launchStatus; + }; +} +auto makeExecute_1_2Return(V1_0::ErrorStatus launchStatus, V1_0::ErrorStatus returnStatus, + const std::vector<OutputShape>& outputShapes, const Timing& timing) { + return [launchStatus, returnStatus, outputShapes, timing]( + const V1_0::Request& /*request*/, MeasureTiming /*measureTiming*/, + const sp<V1_2::IExecutionCallback>& cb) -> Return<V1_0::ErrorStatus> { + cb->notify_1_2(returnStatus, outputShapes, timing); + return launchStatus; + }; +} +auto makeExecute_1_3Return(V1_3::ErrorStatus launchStatus, V1_3::ErrorStatus returnStatus, + const std::vector<OutputShape>& outputShapes, const Timing& timing) { + return [launchStatus, returnStatus, outputShapes, timing]( + const V1_3::Request& /*request*/, MeasureTiming /*measureTiming*/, + const OptionalTimePoint& /*deadline*/, + const OptionalTimeoutDuration& /*loopTimeoutDuration*/, + const sp<V1_3::IExecutionCallback>& cb) -> Return<V1_3::ErrorStatus> { + cb->notify_1_3(returnStatus, outputShapes, timing); + return launchStatus; + }; +} +auto makeExecuteSynchronouslyReturn(V1_0::ErrorStatus status, + const std::vector<OutputShape>& outputShapes, + const Timing& timing) { + return [status, outputShapes, timing](const V1_0::Request& /*request*/, + MeasureTiming /*measureTiming*/, + const V1_2::IPreparedModel::executeSynchronously_cb& cb) { + cb(status, outputShapes, timing); + return Void(); + }; +} +auto makeExecuteSynchronously_1_3Return(V1_3::ErrorStatus status, + const std::vector<OutputShape>& outputShapes, + const Timing& timing) { + return [status, outputShapes, timing]( + const V1_3::Request& /*request*/, MeasureTiming /*measureTiming*/, + const OptionalTimePoint& /*deadline*/, + const OptionalTimeoutDuration& /*loopTimeoutDuration*/, + const V1_3::IPreparedModel::executeSynchronously_1_3_cb& cb) { + cb(status, outputShapes, timing); + return Void(); + }; +} +auto makeConfigureExecutionBurst(V1_0::ErrorStatus status, + const sp<MockBurstContext>& burstContext) { + return [status, burstContext]( + const sp<V1_2::IBurstCallback>& /*callback*/, + const hardware::MQDescriptorSync<V1_2::FmqRequestDatum>& /*requestChannel*/, + const hardware::MQDescriptorSync<V1_2::FmqResultDatum>& /*resultChannel*/, + V1_2::IPreparedModel::configureExecutionBurst_cb cb) { + cb(status, burstContext); + return Void(); + }; +} +auto makeExecuteFencedReturn(V1_3::ErrorStatus status, const hidl_handle& syncFence, + const sp<IFencedExecutionCallback>& dispatchCallback) { + return [status, syncFence, dispatchCallback]( + const V1_3::Request& /*request*/, const hidl_vec<hidl_handle>& /*waitFor*/, + MeasureTiming /*measure*/, const OptionalTimePoint& /*deadline*/, + const OptionalTimeoutDuration& /*loopTimeoutDuration*/, + const OptionalTimeoutDuration& /*duration*/, + V1_3::IPreparedModel::executeFenced_cb cb) { + cb(status, syncFence, dispatchCallback); + return Void(); + }; +} + +// TODO: The "setupInitializationExpectation*" calls below re-specify the +// number of expected times each initialization method is called. Because +// this was originally set to `testing::AnyNumber()` when the object was +// created, do these calls act as no-ops, do they override the previous +// expectations, or are both expectations still active? + +void setupInitializationExpectationsV1_0(const sp<MockDevice>& mockDevice) { + EXPECT_CALL(*mockDevice, getCapabilities_1_1(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_2(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_3(_)).Times(0); + EXPECT_CALL(*mockDevice, getVersionString(_)).Times(0); + EXPECT_CALL(*mockDevice, getType(_)).Times(0); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)).Times(0); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)).Times(0); +} + +void setupInitializationExpectationsV1_1(const sp<MockDevice>& mockDevice) { + EXPECT_CALL(*mockDevice, getCapabilities(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_2(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_3(_)).Times(0); + EXPECT_CALL(*mockDevice, getVersionString(_)).Times(0); + EXPECT_CALL(*mockDevice, getType(_)).Times(0); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)).Times(0); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)).Times(0); +} + +void setupInitializationExpectationsV1_2(const sp<MockDevice>& mockDevice) { + EXPECT_CALL(*mockDevice, getCapabilities(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_1(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_3(_)).Times(0); +} + +void setupInitializationExpectationsV1_3(const sp<MockDevice>& mockDevice) { + EXPECT_CALL(*mockDevice, getCapabilities(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_1(_)).Times(0); + EXPECT_CALL(*mockDevice, getCapabilities_1_2(_)).Times(0); +} + +void setupInitializationExpectations(const sp<MockDevice>& mockDevice, Version version) { + switch (version) { + case Version::V1_0: + setupInitializationExpectationsV1_0(mockDevice); + return; + case Version::V1_1: + setupInitializationExpectationsV1_1(mockDevice); + return; + case Version::V1_2: + setupInitializationExpectationsV1_2(mockDevice); + return; + case Version::V1_3: + setupInitializationExpectationsV1_3(mockDevice); + return; + case Version::MOCK: + setupInitializationExpectationsV1_3(mockDevice); + return; + } + LOG(FATAL) << "unrecognized version: " << static_cast<int>(version); +} + +void setupSuccessfulInitializationExpectations(const sp<MockDevice>& mockDevice, Version version) { + EXPECT_CALL(*mockDevice, linkToDeathRet()).Times(testing::AnyNumber()); + + const int numCallsForV1_0 = (version == Version::V1_0 ? 1 : 0); + EXPECT_CALL(*mockDevice, getCapabilities(_)).Times(numCallsForV1_0); + + const int numCallsForV1_1 = (version == Version::V1_1 ? 1 : 0); + EXPECT_CALL(*mockDevice, getCapabilities_1_1(_)).Times(numCallsForV1_1); + + const int numCallsForV1_2 = (version == Version::V1_2 ? 1 : 0); + EXPECT_CALL(*mockDevice, getCapabilities_1_2(_)).Times(numCallsForV1_2); + + const int numCallsForAtLeastV1_3 = (version >= Version::V1_3 ? 1 : 0); + EXPECT_CALL(*mockDevice, getCapabilities_1_3(_)).Times(numCallsForAtLeastV1_3); + + const int numCallsForAtLeastV1_2 = (version >= Version::V1_2 ? 1 : 0); + EXPECT_CALL(*mockDevice, getVersionString(_)).Times(numCallsForAtLeastV1_2); + EXPECT_CALL(*mockDevice, getType(_)).Times(numCallsForAtLeastV1_2); + EXPECT_CALL(*mockDevice, getSupportedExtensions(_)).Times(numCallsForAtLeastV1_2); + EXPECT_CALL(*mockDevice, getNumberOfCacheFilesNeeded(_)).Times(numCallsForAtLeastV1_2); +} + +std::shared_ptr<VersionedIDevice> makeVersionedIDeviceFrom(const sp<MockDevice>& mockDevice, + MockDeviceFactory* mockDeviceFactory, + Version version) { + setupInitializationExpectations(mockDevice, version); + const auto device = adaptAs(mockDevice, version); + ON_CALL(*mockDeviceFactory, Call(_)).WillByDefault(testing::Return(device)); + EXPECT_CALL(*mockDeviceFactory, Call(/*blocking=*/true)).Times(testing::AtLeast(1)); + const DeviceFactory makeDevice = mockDeviceFactory->AsStdFunction(); + return VersionedIDevice::create("MockDevice", makeDevice); +} + +std::shared_ptr<VersionedIDevice> makeVersionedIDeviceSuccessfulInitializationFrom( + const sp<MockDevice>& device, MockDeviceFactory* mockDeviceFactory, Version version) { + setupSuccessfulInitializationExpectations(device, version); + return makeVersionedIDeviceFrom(device, mockDeviceFactory, version); +} + +std::function<hardware::Status()> makeTransportFailure(status_t status) { + return [status] { return hardware::Status::fromStatusT(status); }; +} + +const auto makeGeneralTransportFailure = makeTransportFailure(NO_MEMORY); +const auto makeDeadObjectFailure = makeTransportFailure(DEAD_OBJECT); + +class VersionedIDeviceTest : public testing::Test { + protected: + const sp<MockDevice> kMockDevice = MockDevice::create(); + const std::unique_ptr<MockDeviceFactory> kMockMakeDevice = + std::make_unique<MockDeviceFactory>(); +}; + +class VersionedIDeviceInitializationTest : public VersionedIDeviceTest {}; + +template <Version version> +class VersionedIDeviceInitializedTest : public VersionedIDeviceTest { + protected: + void SetUp() override { + VersionedIDeviceTest::SetUp(); + ASSERT_NE(nullptr, kDevice.get()); + } + + const std::shared_ptr<VersionedIDevice> kDevice = + makeVersionedIDeviceSuccessfulInitializationFrom(kMockDevice, kMockMakeDevice.get(), + version); +}; + +class VersionedIDeviceV1_0Test : public VersionedIDeviceInitializedTest<Version::V1_0> {}; +class VersionedIDeviceV1_1Test : public VersionedIDeviceInitializedTest<Version::V1_1> {}; +class VersionedIDeviceV1_2Test : public VersionedIDeviceInitializedTest<Version::V1_2> {}; +class VersionedIDeviceV1_3Test : public VersionedIDeviceInitializedTest<Version::V1_3> {}; +class VersionedIDeviceMockTest : public VersionedIDeviceInitializedTest<Version::MOCK> {}; + +// Simulate initialization/link error + +TEST_F(VersionedIDeviceInitializationTest, creationFailure) { + // setup failure + EXPECT_CALL(*kMockMakeDevice, Call(_)).Times(1).WillOnce(testing::Return(nullptr)); + const DeviceFactory makeDevice = kMockMakeDevice->AsStdFunction(); + + // run test + const auto device = VersionedIDevice::create("MockDevice", makeDevice); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, linkToDeathTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, linkToDeathRet()) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + EXPECT_CALL(*kMockMakeDevice, Call(_)).Times(1).WillOnce(testing::Return(kMockDevice)); + const DeviceFactory makeDevice = kMockMakeDevice->AsStdFunction(); + + // run test + const auto device = VersionedIDevice::create("MockDevice", makeDevice); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, linkToDeathReturnError) { + // setup failure + const auto ret = []() -> Return<bool> { return false; }; + EXPECT_CALL(*kMockMakeDevice, Call(_)).Times(1).WillOnce(testing::Return(kMockDevice)); + EXPECT_CALL(*kMockDevice, linkToDeathRet()).Times(1).WillOnce(InvokeWithoutArgs(ret)); + const DeviceFactory makeDevice = kMockMakeDevice->AsStdFunction(); + + // run test + const auto device = VersionedIDevice::create("MockDevice", makeDevice); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilitiesFailure) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::GENERAL_FAILURE, V1_0::Capabilities{}); + EXPECT_CALL(*kMockDevice, getCapabilities(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_0); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilities_1_1Failure) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::GENERAL_FAILURE, V1_1::Capabilities{}); + EXPECT_CALL(*kMockDevice, getCapabilities_1_1(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_1); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilities_1_2Failure) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::GENERAL_FAILURE, V1_2::Capabilities{}); + EXPECT_CALL(*kMockDevice, getCapabilities_1_2(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilities_1_3Failure) { + // setup failure + const auto ret = makeCallbackReturn(V1_3::ErrorStatus::GENERAL_FAILURE, V1_3::Capabilities{}); + EXPECT_CALL(*kMockDevice, getCapabilities_1_3(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_3); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getVersionStringFailure) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::GENERAL_FAILURE, ""); + EXPECT_CALL(*kMockDevice, getVersionString(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getTypeFailure) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::GENERAL_FAILURE, DeviceType::OTHER); + EXPECT_CALL(*kMockDevice, getType(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getSupportedExtensionsFailure) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::GENERAL_FAILURE, hidl_vec<Extension>{}); + EXPECT_CALL(*kMockDevice, getSupportedExtensions(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getNumberOfCacheFilesNeededFailure) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::GENERAL_FAILURE, kMaxNumberOfCacheFiles, + kMaxNumberOfCacheFiles); + EXPECT_CALL(*kMockDevice, getNumberOfCacheFilesNeeded(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, dataCacheFilesExceedsSpecifiedMax) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::NONE, kMaxNumberOfCacheFiles + 1, + kMaxNumberOfCacheFiles); + EXPECT_CALL(*kMockDevice, getNumberOfCacheFilesNeeded(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, modelCacheFilesExceedsSpecifiedMax) { + // setup failure + const auto ret = makeCallbackReturn(V1_0::ErrorStatus::NONE, kMaxNumberOfCacheFiles, + kMaxNumberOfCacheFiles + 1); + EXPECT_CALL(*kMockDevice, getNumberOfCacheFilesNeeded(_)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilitiesTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getCapabilities(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_0); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilities_1_1TransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getCapabilities_1_1(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_1); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilities_1_2TransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getCapabilities_1_2(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getCapabilities_1_3TransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getCapabilities_1_3(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_3); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getVersionStringTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getVersionString(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getTypeTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getType(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getSupportedExtensionsTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getSupportedExtensions(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +TEST_F(VersionedIDeviceInitializationTest, getNumberOfCacheFilesNeededTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getNumberOfCacheFilesNeeded(_)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto device = makeVersionedIDeviceFrom(kMockDevice, kMockMakeDevice.get(), Version::V1_2); + + // verify failure + EXPECT_EQ(nullptr, device.get()); +} + +// Ensure device has cached metadata + +TEST_F(VersionedIDeviceV1_0Test, getCapabilities) { + // run test + const auto capabilities = kDevice->getCapabilities(); + const auto cached = kDevice->getCapabilities(); + + // verify success + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceScalar); + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceTensor); + EXPECT_LT(0u, capabilities.operandPerformance.size()); + EXPECT_EQ(cached, capabilities); +} + +TEST_F(VersionedIDeviceV1_1Test, getCapabilities) { + // run test + const auto capabilities = kDevice->getCapabilities(); + const auto cached = kDevice->getCapabilities(); + + // verify success + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceScalar); + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceTensor); + EXPECT_LT(0u, capabilities.operandPerformance.size()); + EXPECT_EQ(cached, capabilities); +} + +TEST_F(VersionedIDeviceV1_2Test, getCapabilities) { + // run test + const auto capabilities = kDevice->getCapabilities(); + const auto cached = kDevice->getCapabilities(); + + // verify success + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceScalar); + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceTensor); + EXPECT_EQ(0u, capabilities.operandPerformance.size()); + EXPECT_EQ(cached, capabilities); +} + +TEST_F(VersionedIDeviceV1_3Test, getCapabilities) { + // run test + const auto capabilities = kDevice->getCapabilities(); + const auto cached = kDevice->getCapabilities(); + + // verify success + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceScalar); + EXPECT_EQ(PerformanceInfo{}, capabilities.relaxedFloat32toFloat16PerformanceTensor); + EXPECT_EQ(0u, capabilities.operandPerformance.size()); + EXPECT_EQ(cached, capabilities); +} + +TEST_F(VersionedIDeviceV1_0Test, getVersionString) { + // run test + const auto versionString = kDevice->getVersionString(); + const auto cached = kDevice->getVersionString(); + + // verify success + EXPECT_EQ("UNKNOWN", versionString); + EXPECT_EQ(cached, versionString); +} + +TEST_F(VersionedIDeviceV1_1Test, getVersionString) { + // run test + const auto versionString = kDevice->getVersionString(); + const auto cached = kDevice->getVersionString(); + + // verify success + EXPECT_EQ("UNKNOWN", versionString); + EXPECT_EQ(cached, versionString); +} + +TEST_F(VersionedIDeviceV1_2Test, getVersionString) { + // run test + const auto versionString = kDevice->getVersionString(); + const auto cached = kDevice->getVersionString(); + + // verify success + EXPECT_EQ("Google-MockV1", versionString); + EXPECT_EQ(cached, versionString); +} + +TEST_F(VersionedIDeviceV1_3Test, getVersionString) { + // run test + const auto versionString = kDevice->getVersionString(); + const auto cached = kDevice->getVersionString(); + + // verify success + EXPECT_EQ("Google-MockV1", versionString); + EXPECT_EQ(cached, versionString); +} + +TEST_F(VersionedIDeviceV1_0Test, getType) { + // run test + const auto type = kDevice->getType(); + const auto cached = kDevice->getType(); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_DEVICE_UNKNOWN, type); + EXPECT_EQ(cached, type); +} + +TEST_F(VersionedIDeviceV1_1Test, getType) { + // run test + const auto type = kDevice->getType(); + const auto cached = kDevice->getType(); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_DEVICE_UNKNOWN, type); + EXPECT_EQ(cached, type); +} + +TEST_F(VersionedIDeviceV1_2Test, getType) { + // run test + const auto type = kDevice->getType(); + const auto cached = kDevice->getType(); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_DEVICE_OTHER, type); + EXPECT_EQ(cached, type); +} + +TEST_F(VersionedIDeviceV1_3Test, getType) { + // run test + const auto type = kDevice->getType(); + const auto cached = kDevice->getType(); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_DEVICE_OTHER, type); + EXPECT_EQ(cached, type); +} + +TEST_F(VersionedIDeviceV1_0Test, getSupportedExtensions) { + // run test + const auto supportedExtensions = kDevice->getSupportedExtensions(); + const auto cached = kDevice->getSupportedExtensions(); + + // verify success + EXPECT_EQ(0u, supportedExtensions.size()); + EXPECT_EQ(cached, supportedExtensions); +} + +TEST_F(VersionedIDeviceV1_1Test, getSupportedExtensions) { + // run test + const auto supportedExtensions = kDevice->getSupportedExtensions(); + const auto cached = kDevice->getSupportedExtensions(); + + // verify success + EXPECT_EQ(0u, supportedExtensions.size()); + EXPECT_EQ(cached, supportedExtensions); +} + +TEST_F(VersionedIDeviceV1_2Test, getSupportedExtensions) { + // run test + const auto supportedExtensions = kDevice->getSupportedExtensions(); + const auto cached = kDevice->getSupportedExtensions(); + + // verify success + EXPECT_EQ(0u, supportedExtensions.size()); + EXPECT_EQ(cached, supportedExtensions); +} + +TEST_F(VersionedIDeviceV1_3Test, getSupportedExtensions) { + // run test + const auto supportedExtensions = kDevice->getSupportedExtensions(); + const auto cached = kDevice->getSupportedExtensions(); + + // verify success + EXPECT_EQ(0u, supportedExtensions.size()); + EXPECT_EQ(cached, supportedExtensions); +} + +TEST_F(VersionedIDeviceV1_0Test, getNumberOfCacheFilesNeeded) { + // run test + const auto [dataCacheFilesNeeded, modelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + const auto [cachedDataCacheFilesNeeded, cachedModelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + + // verify success + EXPECT_EQ(kNoCacheFilesNeeded, dataCacheFilesNeeded); + EXPECT_EQ(kNoCacheFilesNeeded, modelCacheFilesNeeded); + EXPECT_EQ(cachedDataCacheFilesNeeded, dataCacheFilesNeeded); + EXPECT_EQ(cachedModelCacheFilesNeeded, modelCacheFilesNeeded); +} + +TEST_F(VersionedIDeviceV1_1Test, getNumberOfCacheFilesNeeded) { + // run test + const auto [dataCacheFilesNeeded, modelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + const auto [cachedDataCacheFilesNeeded, cachedModelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + + // verify success + EXPECT_EQ(kNoCacheFilesNeeded, dataCacheFilesNeeded); + EXPECT_EQ(kNoCacheFilesNeeded, modelCacheFilesNeeded); + EXPECT_EQ(cachedDataCacheFilesNeeded, dataCacheFilesNeeded); + EXPECT_EQ(cachedModelCacheFilesNeeded, modelCacheFilesNeeded); +} + +TEST_F(VersionedIDeviceV1_2Test, getNumberOfCacheFilesNeeded) { + // run test + const auto [dataCacheFilesNeeded, modelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + const auto [cachedDataCacheFilesNeeded, cachedModelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + + // verify success + EXPECT_EQ(kMaxNumberOfCacheFiles, dataCacheFilesNeeded); + EXPECT_EQ(kMaxNumberOfCacheFiles, modelCacheFilesNeeded); + EXPECT_EQ(cachedDataCacheFilesNeeded, dataCacheFilesNeeded); + EXPECT_EQ(cachedModelCacheFilesNeeded, modelCacheFilesNeeded); +} + +TEST_F(VersionedIDeviceV1_3Test, getNumberOfCacheFilesNeeded) { + // run test + const auto [dataCacheFilesNeeded, modelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + const auto [cachedDataCacheFilesNeeded, cachedModelCacheFilesNeeded] = + kDevice->getNumberOfCacheFilesNeeded(); + + // verify success + EXPECT_EQ(kMaxNumberOfCacheFiles, dataCacheFilesNeeded); + EXPECT_EQ(kMaxNumberOfCacheFiles, modelCacheFilesNeeded); + EXPECT_EQ(cachedDataCacheFilesNeeded, dataCacheFilesNeeded); + EXPECT_EQ(cachedModelCacheFilesNeeded, modelCacheFilesNeeded); +} + +TEST_F(VersionedIDeviceV1_0Test, getFeatureLevel) { + // run test + const auto featureLevel = kDevice->getFeatureLevel(); + const auto cached = kDevice->getFeatureLevel(); + + // verify success + constexpr int64_t expectedFeatureLevel = __ANDROID_API_O_MR1__; + EXPECT_EQ(expectedFeatureLevel, featureLevel); + EXPECT_EQ(cached, featureLevel); +} + +TEST_F(VersionedIDeviceV1_1Test, getFeatureLevel) { + // run test + const auto featureLevel = kDevice->getFeatureLevel(); + const auto cached = kDevice->getFeatureLevel(); + + // verify success + constexpr int64_t expectedFeatureLevel = __ANDROID_API_P__; + EXPECT_EQ(expectedFeatureLevel, featureLevel); + EXPECT_EQ(cached, featureLevel); +} + +TEST_F(VersionedIDeviceV1_2Test, getFeatureLevel) { + // run test + const auto featureLevel = kDevice->getFeatureLevel(); + const auto cached = kDevice->getFeatureLevel(); + + // verify success + constexpr int64_t expectedFeatureLevel = __ANDROID_API_Q__; + EXPECT_EQ(expectedFeatureLevel, featureLevel); + EXPECT_EQ(cached, featureLevel); +} + +TEST_F(VersionedIDeviceV1_3Test, getFeatureLevel) { + // run test + const auto featureLevel = kDevice->getFeatureLevel(); + const auto cached = kDevice->getFeatureLevel(); + + // verify success + constexpr int64_t expectedFeatureLevel = __ANDROID_API_R__; + EXPECT_EQ(expectedFeatureLevel, featureLevel); + EXPECT_EQ(cached, featureLevel); +} + +// Simulate successful test + +TEST_F(VersionedIDeviceV1_0Test, getSupportedOperations) { + // setup call + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_0::ErrorStatus::NONE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::NONE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_1Test, getSupportedOperations) { + // setup call + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_0::ErrorStatus::NONE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_1(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::NONE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_2Test, getSupportedOperations) { + // setup call + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_0::ErrorStatus::NONE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_2(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::NONE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_3Test, getSupportedOperations) { + // setup call + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_3::ErrorStatus::NONE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_3(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::NONE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_0Test, prepareModel) { + // setup call + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModelReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_NE(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_1Test, prepareModel) { + // setup call + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_1Return(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_1(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_NE(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_2Test, prepareModel) { + // setup call + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_2Return(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_2(_, _, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_NE(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_3Test, prepareModel) { + // setup call + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_3Return(V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_NE(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_0Test, allocate) { + // run test + const auto [status, buffer, token] = kDevice->allocate({}, {}, {}, {}); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, status); + EXPECT_EQ(nullptr, buffer.get()); + EXPECT_EQ(0u, token); +} + +TEST_F(VersionedIDeviceV1_1Test, allocate) { + // run test + const auto [status, buffer, token] = kDevice->allocate({}, {}, {}, {}); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, status); + EXPECT_EQ(nullptr, buffer.get()); + EXPECT_EQ(0u, token); +} + +TEST_F(VersionedIDeviceV1_2Test, allocate) { + // run test + const auto [status, buffer, token] = kDevice->allocate({}, {}, {}, {}); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, status); + EXPECT_EQ(nullptr, buffer.get()); + EXPECT_EQ(0u, token); +} + +TEST_F(VersionedIDeviceV1_3Test, allocate) { + // setup call + const sp<MockBuffer> mockBuffer = new MockBuffer(); + constexpr uint32_t mockToken = 1; + const auto ret = [mockBuffer](const BufferDesc& /*desc*/, + const hidl_vec<sp<V1_3::IPreparedModel>>& /*preparedModels*/, + const hidl_vec<BufferRole>& /*inputRoles*/, + const hidl_vec<BufferRole>& /*outputRoles*/, + V1_3::IDevice::allocate_cb cb) -> Return<void> { + cb(V1_3::ErrorStatus::NONE, mockBuffer, mockToken); + return Void(); + }; + EXPECT_CALL(*kMockDevice, allocate(_, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [status, buffer, token] = kDevice->allocate({}, {}, {}, {}); + + // verify success + EXPECT_EQ(V1_3::ErrorStatus::NONE, status); + EXPECT_NE(nullptr, buffer.get()); + EXPECT_NE(0u, token); +} + +TEST_F(VersionedIDeviceMockTest, wait) { + // setup call + const auto ret = []() -> Return<void> { return {}; }; + EXPECT_CALL(*kMockDevice, ping()).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto resultCode = kDevice->wait(); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); +} + +// Simulate general failure + +TEST_F(VersionedIDeviceV1_0Test, getSupportedOperationsFailure) { + // setup failure + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_0::ErrorStatus::GENERAL_FAILURE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_1Test, getSupportedOperationsFailure) { + // setup failure + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_0::ErrorStatus::GENERAL_FAILURE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_1(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_2Test, getSupportedOperationsFailure) { + // setup failure + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_0::ErrorStatus::GENERAL_FAILURE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_2(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_3Test, getSupportedOperationsFailure) { + // setup failure + const auto ret = [](const auto& /*model*/, const auto cb) { + cb(V1_3::ErrorStatus::GENERAL_FAILURE, {}); + return Void(); + }; + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_3(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_0Test, prepareModelLaunchFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModelReturn(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::NONE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_1Test, prepareModelLaunchFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_1Return(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::NONE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_1(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_2Test, prepareModelLaunchFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_2Return(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::NONE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_2(_, _, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_3Test, prepareModelLaunchFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_3Return(V1_3::ErrorStatus::GENERAL_FAILURE, + V1_3::ErrorStatus::NONE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_0Test, prepareModelReturnFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModelReturn(V1_0::ErrorStatus::NONE, + V1_0::ErrorStatus::GENERAL_FAILURE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_1Test, prepareModelReturnFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_1Return( + V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_1(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_2Test, prepareModelReturnFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_2Return( + V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_2(_, _, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_3Test, prepareModelReturnFailure) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_3Return( + V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::GENERAL_FAILURE, mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_0Test, prepareModelNullptrError) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = nullptr; + const auto ret = makePreparedModelReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_1Test, prepareModelNullptrError) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = nullptr; + const auto ret = makePreparedModel_1_1Return(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_1(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_2Test, prepareModelNullptrError) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = nullptr; + const auto ret = makePreparedModel_1_2Return(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_2(_, _, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_3Test, prepareModelNullptrError) { + // setup failure + const sp<MockPreparedModel> mockPreparedModel = nullptr; + const auto ret = makePreparedModel_1_3Return(V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_3Test, allocateFailure) { + // setup failure + const auto ret = [](const BufferDesc& /*desc*/, + const hidl_vec<sp<V1_3::IPreparedModel>>& /*preparedModels*/, + const hidl_vec<BufferRole>& /*inputRoles*/, + const hidl_vec<BufferRole>& /*outputRoles*/, + V1_3::IDevice::allocate_cb cb) -> Return<void> { + cb(V1_3::ErrorStatus::GENERAL_FAILURE, nullptr, 0); + return Void(); + }; + EXPECT_CALL(*kMockDevice, allocate(_, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [status, buffer, token] = kDevice->allocate({}, {}, {}, {}); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, status); + EXPECT_EQ(nullptr, buffer.get()); + EXPECT_EQ(0u, token); +} + +// Simulate transport failure + +TEST_F(VersionedIDeviceV1_0Test, getSupportedOperationsTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getSupportedOperations(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_1Test, getSupportedOperationsTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_1(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_2Test, getSupportedOperationsTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_2(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_3Test, getSupportedOperationsTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, getSupportedOperations_1_3(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto metaModel = MetaModel({}, /*strictSlicing=*/true); + const auto [resultCode, supportedOperations] = kDevice->getSupportedOperations(metaModel); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, resultCode); + EXPECT_EQ(0u, supportedOperations.size()); +} + +TEST_F(VersionedIDeviceV1_0Test, prepareModelTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, prepareModel(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_1Test, prepareModelTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, prepareModel_1_1(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_2Test, prepareModelTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, prepareModel_1_2(_, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_3Test, prepareModelTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceV1_3Test, allocateTransportFailure) { + // setup failure + EXPECT_CALL(*kMockDevice, allocate(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [status, buffer, token] = kDevice->allocate({}, {}, {}, {}); + + // verify failure + EXPECT_EQ(V1_3::ErrorStatus::GENERAL_FAILURE, status); + EXPECT_EQ(nullptr, buffer.get()); + EXPECT_EQ(0u, token); +} + +TEST_F(VersionedIDeviceMockTest, waitTransportFailure) { + // setup call + EXPECT_CALL(*kMockDevice, ping()) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto resultCode = kDevice->wait(); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); +} + +// Simulate service crash + +// TODO: enable this test once b/154183300 is fixed. +TEST_F(VersionedIDeviceMockTest, DISABLED_prepareModelRecoverCrash) { + // setup original device calls + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + EXPECT_CALL(*kMockDevice, ping()).Times(1).WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // setup recovery call + const sp<MockDevice> mockRecoveredDevice = MockDevice::create(); + EXPECT_CALL(*kMockMakeDevice, Call(/*blocking=*/false)) + .Times(1) + .WillOnce(testing::Return(mockRecoveredDevice)); + + // setup recovered device calls + const sp<MockPreparedModel> mockPreparedModel = MockPreparedModel::create(); + const auto ret = makePreparedModel_1_3Return(V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, + mockPreparedModel); + EXPECT_CALL(*mockRecoveredDevice, linkToDeathRet()).Times(1); + EXPECT_CALL(*mockRecoveredDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_NE(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceMockTest, prepareModelFullCrash) { + // setup failure + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillRepeatedly(InvokeWithoutArgs(makeDeadObjectFailure)); + EXPECT_CALL(*kMockDevice, ping()) + .Times(1) + .WillRepeatedly(InvokeWithoutArgs(makeDeadObjectFailure)); + EXPECT_CALL(*kMockMakeDevice, Call(/*blocking=*/false)) + .Times(1) + .WillOnce(testing::Return(nullptr)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceMockTest, prepareModelAsyncCrash) { + // setup failure + const auto ret = [this]() -> Return<V1_3::ErrorStatus> { + kMockDevice->simulateCrash(); + return V1_3::ErrorStatus::NONE; + }; + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIDeviceMockTest, waitCrash) { + // setup failure + EXPECT_CALL(*kMockDevice, ping()) + .Times(1) + .WillRepeatedly(InvokeWithoutArgs(makeDeadObjectFailure)); + EXPECT_CALL(*kMockMakeDevice, Call(/*blocking=*/true)) + .Times(1) + .WillOnce(testing::Return(nullptr)); + + // run test + const auto resultCode = kDevice->wait(); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); +} + +TEST_F(VersionedIDeviceMockTest, waitRecoverCrash) { + // setup original device calls + EXPECT_CALL(*kMockDevice, ping()).Times(1).WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // setup recovery call + const sp<MockDevice> mockRecoveredDevice = MockDevice::create(); + EXPECT_CALL(*kMockMakeDevice, Call(/*blocking=*/true)) + .Times(1) + .WillOnce(testing::Return(mockRecoveredDevice)); + + // setup recovered device calls + const auto ret = []() -> Return<bool> { return true; }; + EXPECT_CALL(*mockRecoveredDevice, linkToDeathRet()).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto resultCode = kDevice->wait(); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); +} + +TEST_F(VersionedIDeviceMockTest, waitFailedRecoverCrash) { + // setup original device calls + EXPECT_CALL(*kMockDevice, ping()).Times(1).WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // setup recovery call + const sp<MockDevice> mockRecoveredDevice = MockDevice::create(); + EXPECT_CALL(*kMockMakeDevice, Call(/*blocking=*/true)) + .Times(1) + .WillOnce(testing::Return(mockRecoveredDevice)); + + // setup recovered device calls + EXPECT_CALL(*mockRecoveredDevice, linkToDeathRet()) + .Times(1) + .WillOnce(makeGeneralTransportFailure); + + // run test + const auto resultCode = kDevice->wait(); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); +} + +// Harness for VersionedIPreparedModel failures. + +class VersionedIPreparedModelInitializationTest : public VersionedIDeviceMockTest { + protected: + const sp<MockPreparedModel> kMockPreparedModel = MockPreparedModel::create(); +}; + +std::shared_ptr<VersionedIPreparedModel> makeVersionedIPreparedModelSuccessfulInitializationFrom( + const sp<MockDevice>& mockDevice, const sp<MockPreparedModel>& mockPreparedModel, + const VersionedIDevice& device) { + const auto retV1_0 = makePreparedModelReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, + mockPreparedModel); + const auto retV1_1 = makePreparedModel_1_1Return(V1_0::ErrorStatus::NONE, + V1_0::ErrorStatus::NONE, mockPreparedModel); + const auto retV1_2 = makePreparedModel_1_2Return(V1_0::ErrorStatus::NONE, + V1_0::ErrorStatus::NONE, mockPreparedModel); + const auto retV1_3 = makePreparedModel_1_3Return(V1_3::ErrorStatus::NONE, + V1_3::ErrorStatus::NONE, mockPreparedModel); + + ON_CALL(*mockDevice, prepareModel(_, _)).WillByDefault(Invoke(retV1_0)); + ON_CALL(*mockDevice, prepareModel_1_1(_, _, _)).WillByDefault(Invoke(retV1_1)); + ON_CALL(*mockDevice, prepareModel_1_2(_, _, _, _, _, _)).WillByDefault(Invoke(retV1_2)); + ON_CALL(*mockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)).WillByDefault(Invoke(retV1_3)); + + EXPECT_CALL(*mockDevice, prepareModel(_, _)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, prepareModel_1_1(_, _, _)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, prepareModel_1_2(_, _, _, _, _, _)).Times(testing::AnyNumber()); + EXPECT_CALL(*mockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)).Times(testing::AnyNumber()); + + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = device.prepareModel(makeModel, {}, {}, {}, {}, {}); + + CHECK_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + CHECK(preparedModel != nullptr); + + return preparedModel; +} + +template <Version version> +class VersionedIPreparedModelTest : public VersionedIDeviceInitializedTest<version> { + using Base = VersionedIDeviceInitializedTest<version>; + + protected: + void SetUp() override { + VersionedIDeviceInitializedTest<version>::SetUp(); + ASSERT_NE(nullptr, kPreparedModel.get()); + } + + const sp<MockPreparedModel> kMockPreparedModel = MockPreparedModel::create(); + const std::shared_ptr<VersionedIPreparedModel> kPreparedModel = + makeVersionedIPreparedModelSuccessfulInitializationFrom( + Base::kMockDevice, kMockPreparedModel, *Base::kDevice); +}; + +class VersionedIPreparedModelV1_0Test : public VersionedIPreparedModelTest<Version::V1_0> {}; +class VersionedIPreparedModelV1_1Test : public VersionedIPreparedModelTest<Version::V1_1> {}; +class VersionedIPreparedModelV1_2Test : public VersionedIPreparedModelTest<Version::V1_2> {}; +class VersionedIPreparedModelV1_3Test : public VersionedIPreparedModelTest<Version::V1_3> {}; +class VersionedIPreparedModelMockTest : public VersionedIPreparedModelTest<Version::MOCK> {}; + +// Simulate initialization/link error + +TEST_F(VersionedIPreparedModelInitializationTest, linkToDeathTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, linkToDeathRet()) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + const auto ret = makePreparedModel_1_3Return(V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, + kMockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIPreparedModelInitializationTest, linkToDeathDeadObject) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, linkToDeathRet()) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + const auto ret = makePreparedModel_1_3Return(V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, + kMockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +TEST_F(VersionedIPreparedModelInitializationTest, linkToDeathReturnError) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, linkToDeathRet()) + .Times(1) + .WillOnce(InvokeWithoutArgs([]() -> Return<bool> { return false; })); + const auto ret = makePreparedModel_1_3Return(V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, + kMockPreparedModel); + EXPECT_CALL(*kMockDevice, prepareModel_1_3(_, _, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const ModelFactory makeModel = [] { return V1_3::Model{}; }; + const auto [resultCode, preparedModel] = kDevice->prepareModel(makeModel, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, preparedModel.get()); +} + +// Simulate successful test + +TEST_F(VersionedIPreparedModelV1_0Test, executeAsync) { + // setup call + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeAsync) { + // setup call + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeAsync) { + // setup call + const auto ret = + makeExecute_1_2Return(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, execute_1_2(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeAsync) { + // setup call + const auto ret = + makeExecute_1_3Return(V1_3::ErrorStatus::NONE, V1_3::ErrorStatus::NONE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, execute_1_3(_, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, executePreferSync) { + // setup call + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executePreferSync) { + // setup call + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executePreferSync) { + // setup call + const auto ret = makeExecuteSynchronouslyReturn(V1_0::ErrorStatus::NONE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, executeSynchronously(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executePreferSync) { + // setup call + const auto ret = makeExecuteSynchronously_1_3Return(V1_3::ErrorStatus::NONE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, executeSynchronously_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, executeFenced) { + // setup call + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeFenced) { + // setup call + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeFenced) { + // setup call + const auto ret = makeExecuteSynchronouslyReturn(V1_0::ErrorStatus::NONE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, executeSynchronously(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeFenced) { + // setup call + auto memory = allocateSharedMemory(4); + hidl_handle fakeSyncFence(memory.handle()); + const sp<IFencedExecutionCallback> callback = new MockFencedExecutionCallback(); + const auto ret = makeExecuteFencedReturn(V1_3::ErrorStatus::NONE, fakeSyncFence, callback); + EXPECT_CALL(*kMockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify success + EXPECT_EQ(ANEURALNETWORKS_NO_ERROR, resultCode); + EXPECT_NE(nullptr, syncFence.getNativeHandle()); + EXPECT_NE(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, configureExecutionBurst) { + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify success + EXPECT_EQ(nullptr, executionBurstController); +} + +TEST_F(VersionedIPreparedModelV1_1Test, configureExecutionBurst) { + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify success + EXPECT_EQ(nullptr, executionBurstController); +} + +TEST_F(VersionedIPreparedModelV1_2Test, configureExecutionBurst) { + // setup call + const sp<MockBurstContext> burstContext = new MockBurstContext(); + const auto ret = makeConfigureExecutionBurst(V1_0::ErrorStatus::NONE, burstContext); + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify success + EXPECT_NE(nullptr, executionBurstController); +} + +TEST_F(VersionedIPreparedModelV1_3Test, configureExecutionBurst) { + // setup call + const sp<MockBurstContext> burstContext = new MockBurstContext(); + const auto ret = makeConfigureExecutionBurst(V1_0::ErrorStatus::NONE, burstContext); + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify success + EXPECT_NE(nullptr, executionBurstController); +} + +// Simulate general failure + +TEST_F(VersionedIPreparedModelV1_0Test, executeAsyncLaunchFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::GENERAL_FAILURE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeAsyncLaunchFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::GENERAL_FAILURE, V1_0::ErrorStatus::NONE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeAsyncLaunchFailure) { + // setup failure + const auto ret = makeExecute_1_2Return(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::NONE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, execute_1_2(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeAsyncLaunchFailure) { + // setup failure + const auto ret = makeExecute_1_3Return(V1_3::ErrorStatus::GENERAL_FAILURE, + V1_3::ErrorStatus::NONE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, execute_1_3(_, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, executeAsyncReturnFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeAsyncReturnFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::NONE, V1_0::ErrorStatus::GENERAL_FAILURE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeAsyncReturnFailure) { + // setup failure + const auto ret = makeExecute_1_2Return(V1_0::ErrorStatus::NONE, + V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, execute_1_2(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeAsyncReturnFailure) { + // setup failure + const auto ret = makeExecute_1_3Return(V1_3::ErrorStatus::NONE, + V1_3::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, execute_1_3(_, _, _, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, executePreferSyncFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::GENERAL_FAILURE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executePreferSyncFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::GENERAL_FAILURE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executePreferSyncFailure) { + // setup failure + const auto ret = + makeExecuteSynchronouslyReturn(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, executeSynchronously(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executePreferSyncFailure) { + // setup failure + const auto ret = + makeExecuteSynchronously_1_3Return(V1_3::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, executeSynchronously_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, executeFencedFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::GENERAL_FAILURE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeFencedFailure) { + // setup failure + const auto ret = makeExecuteReturn(V1_0::ErrorStatus::GENERAL_FAILURE, + V1_0::ErrorStatus::GENERAL_FAILURE); + EXPECT_CALL(*kMockPreparedModel, execute(_, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeFencedFailure) { + // setup failure + const auto ret = + makeExecuteSynchronouslyReturn(V1_0::ErrorStatus::GENERAL_FAILURE, {}, kNoTiming); + EXPECT_CALL(*kMockPreparedModel, executeSynchronously(_, _, _)).Times(1).WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeFencedFailure) { + // setup failure + auto memory = allocateSharedMemory(4); + hidl_handle fakeSyncFence(memory.handle()); + const sp<IFencedExecutionCallback> callback = new MockFencedExecutionCallback(); + const auto ret = + makeExecuteFencedReturn(V1_3::ErrorStatus::GENERAL_FAILURE, fakeSyncFence, callback); + EXPECT_CALL(*kMockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, configureExecutionBurstFailure) { + // setup failure + const sp<MockBurstContext> burstContext = new MockBurstContext(); + const auto ret = makeConfigureExecutionBurst(V1_0::ErrorStatus::GENERAL_FAILURE, burstContext); + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify failure + EXPECT_EQ(nullptr, executionBurstController); +} + +TEST_F(VersionedIPreparedModelV1_3Test, configureExecutionBurstFailure) { + // setup failure + const sp<MockBurstContext> burstContext = new MockBurstContext(); + const auto ret = makeConfigureExecutionBurst(V1_0::ErrorStatus::GENERAL_FAILURE, burstContext); + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify failure + EXPECT_EQ(nullptr, executionBurstController); +} + +TEST_F(VersionedIPreparedModelV1_2Test, configureExecutionBurstNullptrError) { + // setup failure + const auto ret = makeConfigureExecutionBurst(V1_0::ErrorStatus::NONE, nullptr); + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify failure + EXPECT_EQ(nullptr, executionBurstController); +} + +TEST_F(VersionedIPreparedModelV1_3Test, configureExecutionBurstNullptrError) { + // setup failure + const auto ret = makeConfigureExecutionBurst(V1_0::ErrorStatus::NONE, nullptr); + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(Invoke(ret)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify failure + EXPECT_EQ(nullptr, executionBurstController); +} + +// Simulate transport failure + +TEST_F(VersionedIPreparedModelV1_0Test, executeAsyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeAsyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeAsyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute_1_2(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeAsyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, executePreferSyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executePreferSyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executePreferSyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, executeSynchronously(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executePreferSyncTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, executeSynchronously_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_0Test, executeFencedTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeFencedTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeFencedTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, executeSynchronously(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeFencedTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, executeFenced(_, _, _, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto [resultCode, syncFence, dispatchCallback, timing] = + kPreparedModel->executeFenced({}, {}, {}, {}, {}, {}); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_OP_FAILED, resultCode); + EXPECT_EQ(nullptr, syncFence.getNativeHandle()); + EXPECT_EQ(nullptr, dispatchCallback.get()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, configureExecutionBurstTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify failure + EXPECT_EQ(nullptr, executionBurstController); +} + +TEST_F(VersionedIPreparedModelV1_3Test, configureExecutionBurstTransportFailure) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, configureExecutionBurst(_, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeGeneralTransportFailure)); + + // run test + const auto executionBurstController = + kPreparedModel->configureExecutionBurst(/*preferPowerOverLatency=*/false); + + // verify failure + EXPECT_EQ(nullptr, executionBurstController); +} + +// Simulate service crash + +TEST_F(VersionedIPreparedModelV1_0Test, executeAsyncLaunchCrash) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_1Test, executeAsyncLaunchCrash) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute(_, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executeAsyncLaunchCrash) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute_1_2(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executeAsyncLaunchCrash) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, execute_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_2Test, executePreferSyncCrash) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, executeSynchronously(_, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelV1_3Test, executePreferSyncCrash) { + // setup failure + EXPECT_CALL(*kMockPreparedModel, executeSynchronously_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(makeDeadObjectFailure)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/true); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +TEST_F(VersionedIPreparedModelMockTest, executeAsyncReturnCrash) { + // setup failure + const auto ret = [this]() -> Return<V1_3::ErrorStatus> { + kMockPreparedModel->simulateCrash(); + return V1_3::ErrorStatus::NONE; + }; + EXPECT_CALL(*kMockPreparedModel, execute_1_3(_, _, _, _, _)) + .Times(1) + .WillOnce(InvokeWithoutArgs(ret)); + + // run test + const auto [resultCode, outputShapes, timing] = + kPreparedModel->execute({}, {}, {}, {}, /*preferSynchronous=*/false); + + // verify failure + EXPECT_EQ(ANEURALNETWORKS_DEAD_OBJECT, resultCode); + EXPECT_EQ(0u, outputShapes.size()); + EXPECT_EQ(kNoTiming, timing); +} + +} // namespace +} // namespace android::nn diff --git a/nn/runtime/test/fuzzing/TestRandomGraph.cpp b/nn/runtime/test/fuzzing/TestRandomGraph.cpp index 979855922..f575e9d5a 100644 --- a/nn/runtime/test/fuzzing/TestRandomGraph.cpp +++ b/nn/runtime/test/fuzzing/TestRandomGraph.cpp @@ -211,13 +211,13 @@ class RandomGraphTest : public ::testing::TestWithParam<uint32_t> { featureLevel <= __ANDROID_API_Q__) { return true; } - // TODO(xusongw): Remove after b/151328024, b/152446228, b/152445711, and b/152446298 - // are resolved. - if ((op.type == TestOperationType::ROI_ALIGN || op.type == TestOperationType::ADD || - op.type == TestOperationType::SUB || op.type == TestOperationType::MAXIMUM || - op.type == TestOperationType::MINIMUM) && + // Skip the following operations for 1.2 and earlier devices. + if ((op.type == TestOperationType::ADD || op.type == TestOperationType::SUB || + op.type == TestOperationType::MAXIMUM || op.type == TestOperationType::MINIMUM || + op.type == TestOperationType::ROI_ALIGN) && mTestModel.main.operands[op.inputs[0]].type == - TestOperandType::TENSOR_QUANT8_ASYMM) { + TestOperandType::TENSOR_QUANT8_ASYMM && + featureLevel <= __ANDROID_API_Q__) { return true; } } diff --git a/nn/runtime/test/fuzzing/operation_signatures/Selection.cpp b/nn/runtime/test/fuzzing/operation_signatures/Selection.cpp index 6d45d0433..02612c0df 100644 --- a/nn/runtime/test/fuzzing/operation_signatures/Selection.cpp +++ b/nn/runtime/test/fuzzing/operation_signatures/Selection.cpp @@ -320,24 +320,23 @@ static void stridedSliceFinalizer(RandomOperation* op) { // arbitrary value. if (beginMask[i]) begin[i] = getUniform<int32_t>(-inputSize, inputSize - 1); if (endMask[i]) end[i] = getUniform<int32_t>(-inputSize, inputSize - 1); + + // Switch to negative stride. + if (getBernoulli(0.2f)) { + op->inputs[3]->value<int32_t>(i) = -stride; + std::swap(begin[i], end[i]); + std::swap(beginMask[i], endMask[i]); + begin[i]--; + end[i]--; + // end = -1 will be interpreted to inputSize - 1 if not setting endMask. + if (end[i] < 0) endMask[i] = true; + } } else { // When shrink mask is set, the begin and end must define a slice of size 1, e.g. // begin[i] = x, end[i] = x + 1. begin[i] = getUniform<int32_t>(0, inputSize - 1); end[i] = begin[i] + 1; } - - // Switch to negative stride. - // TODO(b/154639297): shrinkMask with negative stride will produce uninitialized output. - if (!shrink && getBernoulli(0.2f)) { - op->inputs[3]->value<int32_t>(i) = -stride; - std::swap(begin[i], end[i]); - std::swap(beginMask[i], endMask[i]); - begin[i]--; - end[i]--; - // end = -1 will be intepreted to inputSize - 1 if not setting endMask. - if (end[i] < 0) endMask[i] = true; - } } op->inputs[4]->setScalarValue<int32_t>(convertToBitMask(beginMask)); op->inputs[5]->setScalarValue<int32_t>(convertToBitMask(endMask)); diff --git a/nn/runtime/test/generated/spec_V1_0/reshape.example.cpp b/nn/runtime/test/generated/spec_V1_0/reshape.example.cpp index 6d3e7765f..1b9ac597d 100644 --- a/nn/runtime/test/generated/spec_V1_0/reshape.example.cpp +++ b/nn/runtime/test/generated/spec_V1_0/reshape.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::reshape +namespace generated_tests::reshape { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("reshape_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::reshape + +namespace generated_tests::reshape { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("reshape_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::reshape + diff --git a/nn/runtime/test/generated/spec_V1_0/reshape_quant8.example.cpp b/nn/runtime/test/generated/spec_V1_0/reshape_quant8.example.cpp index aac9b68cb..9b01c4f63 100644 --- a/nn/runtime/test/generated/spec_V1_0/reshape_quant8.example.cpp +++ b/nn/runtime/test/generated/spec_V1_0/reshape_quant8.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::reshape_quant8 +namespace generated_tests::reshape_quant8 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("reshape_quant8_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::reshape_quant8 + +namespace generated_tests::reshape_quant8 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("reshape_quant8_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_quant8 + diff --git a/nn/runtime/test/generated/spec_V1_0/reshape_quant8_weights_as_inputs.example.cpp b/nn/runtime/test/generated/spec_V1_0/reshape_quant8_weights_as_inputs.example.cpp index 928568f0e..0fae8ca9f 100644 --- a/nn/runtime/test/generated/spec_V1_0/reshape_quant8_weights_as_inputs.example.cpp +++ b/nn/runtime/test/generated/spec_V1_0/reshape_quant8_weights_as_inputs.example.cpp @@ -4,3 +4,151 @@ #include "TestHarness.h" using namespace test_helper; +namespace generated_tests::reshape_quant8_weights_as_inputs { + +const TestModel& get_test_model() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model = TestModelManager::get().add("reshape_quant8_weights_as_inputs", get_test_model()); + +} // namespace generated_tests::reshape_quant8_weights_as_inputs + +namespace generated_tests::reshape_quant8_weights_as_inputs { + +const TestModel& get_test_model_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("reshape_quant8_weights_as_inputs_all_inputs_as_internal", get_test_model_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_quant8_weights_as_inputs + diff --git a/nn/runtime/test/generated/spec_V1_0/reshape_weights_as_inputs.example.cpp b/nn/runtime/test/generated/spec_V1_0/reshape_weights_as_inputs.example.cpp index 22cf7cb24..eb8bc792f 100644 --- a/nn/runtime/test/generated/spec_V1_0/reshape_weights_as_inputs.example.cpp +++ b/nn/runtime/test/generated/spec_V1_0/reshape_weights_as_inputs.example.cpp @@ -4,3 +4,151 @@ #include "TestHarness.h" using namespace test_helper; +namespace generated_tests::reshape_weights_as_inputs { + +const TestModel& get_test_model() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model = TestModelManager::get().add("reshape_weights_as_inputs", get_test_model()); + +} // namespace generated_tests::reshape_weights_as_inputs + +namespace generated_tests::reshape_weights_as_inputs { + +const TestModel& get_test_model_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_0, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("reshape_weights_as_inputs_all_inputs_as_internal", get_test_model_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_weights_as_inputs + diff --git a/nn/runtime/test/generated/spec_V1_1/mean.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean.example.cpp index 93141b4dc..bd3c63bda 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean +namespace generated_tests::mean { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}), + .dimensions = {1, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean + +namespace generated_tests::mean { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}), + .dimensions = {1, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean + diff --git a/nn/runtime/test/generated/spec_V1_1/mean_float_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_float_1.example.cpp index 15bee71c8..2a60edc67 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean_float_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean_float_1.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_float_1 +namespace generated_tests::mean_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({12.0f, 13.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_float_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_float_1 + +namespace generated_tests::mean_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({12.0f, 13.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_float_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_float_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/mean_float_1_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_float_1_relaxed.example.cpp index 090910e58..adf1aa15b 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean_float_1_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean_float_1_relaxed.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_float_1_relaxed +namespace generated_tests::mean_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({12.0f, 13.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_float_1_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_float_1_relaxed + +namespace generated_tests::mean_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({12.0f, 13.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_float_1_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_float_1_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/mean_float_2.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_float_2.example.cpp index af3947875..c11386637 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean_float_2.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean_float_2.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_float_2 +namespace generated_tests::mean_float_2 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({10.5f, 12.5f, 14.5f}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_float_2_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_float_2 + +namespace generated_tests::mean_float_2 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({10.5f, 12.5f, 14.5f}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_float_2_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_float_2 + diff --git a/nn/runtime/test/generated/spec_V1_1/mean_float_2_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_float_2_relaxed.example.cpp index 2a4630af9..922201e44 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean_float_2_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean_float_2_relaxed.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_float_2_relaxed +namespace generated_tests::mean_float_2_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({10.5f, 12.5f, 14.5f}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_float_2_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_float_2_relaxed + +namespace generated_tests::mean_float_2_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({10.5f, 12.5f, 14.5f}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_float_2_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_float_2_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/mean_quant8_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_quant8_1.example.cpp index 887472831..5760bdbd7 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean_quant8_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean_quant8_1.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_quant8_1 +namespace generated_tests::mean_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({12, 13}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_quant8_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_quant8_1 + +namespace generated_tests::mean_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({12, 13}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_quant8_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_quant8_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/mean_quant8_2.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_quant8_2.example.cpp index 29ddcabcd..0f24e6f40 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean_quant8_2.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean_quant8_2.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_quant8_2 +namespace generated_tests::mean_quant8_2 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({10, 12, 14}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_quant8_2_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_quant8_2 + +namespace generated_tests::mean_quant8_2 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({10, 12, 14}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 5 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_quant8_2_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_quant8_2 + diff --git a/nn/runtime/test/generated/spec_V1_1/mean_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/mean_relaxed.example.cpp index 74e274307..526e271cd 100644 --- a/nn/runtime/test/generated/spec_V1_1/mean_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/mean_relaxed.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_relaxed +namespace generated_tests::mean_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}), + .dimensions = {1, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_relaxed + +namespace generated_tests::mean_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.5f, 3.5f}), + .dimensions = {1, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/pad.example.cpp b/nn/runtime/test/generated/spec_V1_1/pad.example.cpp index 729d75481..701601569 100644 --- a/nn/runtime/test/generated/spec_V1_1/pad.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/pad.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad +namespace generated_tests::pad { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 1, 1, 1, 1, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 0.0f, 0.0f, 3.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 4, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad + +namespace generated_tests::pad { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 1, 1, 1, 1, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 0.0f, 0.0f, 3.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 4, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad + diff --git a/nn/runtime/test/generated/spec_V1_1/pad_float_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/pad_float_1.example.cpp index a1784146b..e0c9018e8 100644 --- a/nn/runtime/test/generated/spec_V1_1/pad_float_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/pad_float_1.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad_float_1 +namespace generated_tests::pad_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 4.0f, 5.0f, 6.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_float_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_float_1 + +namespace generated_tests::pad_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 4.0f, 5.0f, 6.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_float_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_float_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/pad_float_1_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/pad_float_1_relaxed.example.cpp index 28e214d1b..3aedb0dbb 100644 --- a/nn/runtime/test/generated/spec_V1_1/pad_float_1_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/pad_float_1_relaxed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad_float_1_relaxed +namespace generated_tests::pad_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 4.0f, 5.0f, 6.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_float_1_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_float_1_relaxed + +namespace generated_tests::pad_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 4.0f, 5.0f, 6.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_float_1_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_float_1_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/pad_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/pad_relaxed.example.cpp index 55eda8ab3..761c3bed8 100644 --- a/nn/runtime/test/generated/spec_V1_1/pad_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/pad_relaxed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad_relaxed +namespace generated_tests::pad_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 1, 1, 1, 1, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 0.0f, 0.0f, 3.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 4, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_relaxed + +namespace generated_tests::pad_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 1, 1, 1, 1, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 0.0f, 0.0f, 3.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 4, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/reshape_b138150365.example.cpp b/nn/runtime/test/generated/spec_V1_1/reshape_b138150365.example.cpp index 3ee3111ba..385772f28 100644 --- a/nn/runtime/test/generated/spec_V1_1/reshape_b138150365.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/reshape_b138150365.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::reshape_b138150365 +namespace generated_tests::reshape_b138150365 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}), + .dimensions = {1, 1, 1, 1001}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1001}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}), + .dimensions = {1, 1001}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("reshape_b138150365_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::reshape_b138150365 + +namespace generated_tests::reshape_b138150365 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 1, 1, 1001}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1001}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}), + .dimensions = {1, 1001}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}), + .dimensions = {1, 1, 1, 1001}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("reshape_b138150365_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_b138150365 + diff --git a/nn/runtime/test/generated/spec_V1_1/reshape_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/reshape_relaxed.example.cpp index 408f88067..7f67ff8ce 100644 --- a/nn/runtime/test/generated/spec_V1_1/reshape_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/reshape_relaxed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::reshape_relaxed +namespace generated_tests::reshape_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("reshape_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::reshape_relaxed + +namespace generated_tests::reshape_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("reshape_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/reshape_weights_as_inputs_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/reshape_weights_as_inputs_relaxed.example.cpp index 051f50704..d83899f5b 100644 --- a/nn/runtime/test/generated/spec_V1_1/reshape_weights_as_inputs_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/reshape_weights_as_inputs_relaxed.example.cpp @@ -4,3 +4,151 @@ #include "TestHarness.h" using namespace test_helper; +namespace generated_tests::reshape_weights_as_inputs_relaxed { + +const TestModel& get_test_model() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model = TestModelManager::get().add("reshape_weights_as_inputs_relaxed", get_test_model()); + +} // namespace generated_tests::reshape_weights_as_inputs_relaxed + +namespace generated_tests::reshape_weights_as_inputs_relaxed { + +const TestModel& get_test_model_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add("reshape_weights_as_inputs_relaxed_all_inputs_as_internal", get_test_model_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_weights_as_inputs_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/squeeze.example.cpp b/nn/runtime/test/generated/spec_V1_1/squeeze.example.cpp index 6dd385bcd..b5533c57d 100644 --- a/nn/runtime/test/generated/spec_V1_1/squeeze.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/squeeze.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::squeeze +namespace generated_tests::squeeze { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("squeeze_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::squeeze + +namespace generated_tests::squeeze { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("squeeze_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::squeeze + diff --git a/nn/runtime/test/generated/spec_V1_1/squeeze_float_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/squeeze_float_1.example.cpp index 761faae57..14795c1ed 100644 --- a/nn/runtime/test/generated/spec_V1_1/squeeze_float_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/squeeze_float_1.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::squeeze_float_1 +namespace generated_tests::squeeze_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("squeeze_float_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::squeeze_float_1 + +namespace generated_tests::squeeze_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("squeeze_float_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::squeeze_float_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/squeeze_float_1_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/squeeze_float_1_relaxed.example.cpp index 77f28e494..746cd54e9 100644 --- a/nn/runtime/test/generated/spec_V1_1/squeeze_float_1_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/squeeze_float_1_relaxed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::squeeze_float_1_relaxed +namespace generated_tests::squeeze_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("squeeze_float_1_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::squeeze_float_1_relaxed + +namespace generated_tests::squeeze_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("squeeze_float_1_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::squeeze_float_1_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/squeeze_quant8_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/squeeze_quant8_1.example.cpp index 20c560cce..ec3349b56 100644 --- a/nn/runtime/test/generated/spec_V1_1/squeeze_quant8_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/squeeze_quant8_1.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::squeeze_quant8_1 +namespace generated_tests::squeeze_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("squeeze_quant8_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::squeeze_quant8_1 + +namespace generated_tests::squeeze_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("squeeze_quant8_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::squeeze_quant8_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/squeeze_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/squeeze_relaxed.example.cpp index 37f3afb5a..17946102b 100644 --- a/nn/runtime/test/generated/spec_V1_1/squeeze_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/squeeze_relaxed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::squeeze_relaxed +namespace generated_tests::squeeze_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("squeeze_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::squeeze_relaxed + +namespace generated_tests::squeeze_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("squeeze_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::squeeze_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice.example.cpp index 96b14ba55..6359a739a 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice +namespace generated_tests::strided_slice { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice + +namespace generated_tests::strided_slice { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1.example.cpp index 837bc1c4c..c3e65dc27 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_1 +namespace generated_tests::strided_slice_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_1 + +namespace generated_tests::strided_slice_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10.example.cpp index 861391bd9..a2ef66300 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_10 +namespace generated_tests::strided_slice_float_10 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({4.0f, 5.0f, 6.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_10_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_10 + +namespace generated_tests::strided_slice_float_10 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({4.0f, 5.0f, 6.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_10_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_10 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10_relaxed.example.cpp index 1bb85ee48..e9c220f8b 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_10_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_10_relaxed +namespace generated_tests::strided_slice_float_10_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({4.0f, 5.0f, 6.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_10_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_10_relaxed + +namespace generated_tests::strided_slice_float_10_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({4.0f, 5.0f, 6.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_10_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_10_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11.example.cpp index 9f30f0daf..12feb17c8 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_11 +namespace generated_tests::strided_slice_float_11 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_11_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_11 + +namespace generated_tests::strided_slice_float_11 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_11_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_11 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11_relaxed.example.cpp index 992a265bd..6bc4c9a0f 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_11_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_11_relaxed +namespace generated_tests::strided_slice_float_11_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_11_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_11_relaxed + +namespace generated_tests::strided_slice_float_11_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_11_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_11_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1_relaxed.example.cpp index 0e7fcdc73..75ca08dfd 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_1_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_1_relaxed +namespace generated_tests::strided_slice_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_1_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_1_relaxed + +namespace generated_tests::strided_slice_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_1_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_1_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2.example.cpp index e0cbf8130..09886978a 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_2 +namespace generated_tests::strided_slice_float_2 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_2_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_2 + +namespace generated_tests::strided_slice_float_2 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_2_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_2 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2_relaxed.example.cpp index 875df61a3..e8b622ec7 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_2_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_2_relaxed +namespace generated_tests::strided_slice_float_2_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_2_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_2_relaxed + +namespace generated_tests::strided_slice_float_2_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_2_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_2_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3.example.cpp index c791053ef..556bea1a3 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_3 +namespace generated_tests::strided_slice_float_3 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_3_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_3 + +namespace generated_tests::strided_slice_float_3 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_3_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_3 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3_relaxed.example.cpp index 29a5c4406..6922abc45 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_3_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_3_relaxed +namespace generated_tests::strided_slice_float_3_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_3_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_3_relaxed + +namespace generated_tests::strided_slice_float_3_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_3_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_3_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4.example.cpp index 137a2d7b7..1c9266e15 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_4 +namespace generated_tests::strided_slice_float_4 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_4_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_4 + +namespace generated_tests::strided_slice_float_4 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_4_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_4 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4_relaxed.example.cpp index 6bf97f4c3..881176fe9 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_4_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_4_relaxed +namespace generated_tests::strided_slice_float_4_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_4_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_4_relaxed + +namespace generated_tests::strided_slice_float_4_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_4_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_4_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5.example.cpp index 90a2dc5d0..a579226b5 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_5 +namespace generated_tests::strided_slice_float_5 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_5_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_5 + +namespace generated_tests::strided_slice_float_5 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_5_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_5 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5_relaxed.example.cpp index fbbb81fd9..49d4bdd01 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_5_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_5_relaxed +namespace generated_tests::strided_slice_float_5_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_5_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_5_relaxed + +namespace generated_tests::strided_slice_float_5_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_5_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_5_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6.example.cpp index 7e5086c07..67528dd54 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_6 +namespace generated_tests::strided_slice_float_6 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f, 4.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_6_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_6 + +namespace generated_tests::strided_slice_float_6 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f, 4.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_6_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_6 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6_relaxed.example.cpp index b63879281..5155a1ab9 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_6_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_6_relaxed +namespace generated_tests::strided_slice_float_6_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f, 4.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_6_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_6_relaxed + +namespace generated_tests::strided_slice_float_6_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({2.0f, 3.0f, 4.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_6_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_6_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7.example.cpp index 394965a06..8b2ac494e 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_7 +namespace generated_tests::strided_slice_float_7 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({3.0f, 2.0f, 1.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_7_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_7 + +namespace generated_tests::strided_slice_float_7 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({3.0f, 2.0f, 1.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_7_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_7 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7_relaxed.example.cpp index f733ee54d..39ba45870 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_7_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_7_relaxed +namespace generated_tests::strided_slice_float_7_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({3.0f, 2.0f, 1.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_7_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_7_relaxed + +namespace generated_tests::strided_slice_float_7_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({3.0f, 2.0f, 1.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_7_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_7_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8.example.cpp index ddbac2e9c..f8d280d7d 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_8 +namespace generated_tests::strided_slice_float_8 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({6.0f, 5.0f, 4.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_8_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_8 + +namespace generated_tests::strided_slice_float_8 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({6.0f, 5.0f, 4.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_8_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_8 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8_relaxed.example.cpp index 2bb360112..88544138e 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_8_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_8_relaxed +namespace generated_tests::strided_slice_float_8_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({6.0f, 5.0f, 4.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_8_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_8_relaxed + +namespace generated_tests::strided_slice_float_8_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({6.0f, 5.0f, 4.0f}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_8_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_8_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9.example.cpp index 078eb842c..eca07da6c 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_9 +namespace generated_tests::strided_slice_float_9 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 4.0f, 5.0f}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_9_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_9 + +namespace generated_tests::strided_slice_float_9 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 4.0f, 5.0f}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_9_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_9 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9_relaxed.example.cpp index cdd0987c7..68450a4d4 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_float_9_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float_9_relaxed +namespace generated_tests::strided_slice_float_9_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 4.0f, 5.0f}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float_9_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float_9_relaxed + +namespace generated_tests::strided_slice_float_9_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 4.0f, 5.0f}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float_9_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float_9_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_10.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_10.example.cpp index bf315f55e..aa7efd27a 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_10.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_10.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_qaunt8_10 +namespace generated_tests::strided_slice_qaunt8_10 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({4, 5, 6}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_qaunt8_10_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_qaunt8_10 + +namespace generated_tests::strided_slice_qaunt8_10 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({4, 5, 6}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_qaunt8_10_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_qaunt8_10 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_11.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_11.example.cpp index e8998ec55..1271b4b63 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_11.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_qaunt8_11.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_qaunt8_11 +namespace generated_tests::strided_slice_qaunt8_11 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_qaunt8_11_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_qaunt8_11 + +namespace generated_tests::strided_slice_qaunt8_11 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_qaunt8_11_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_qaunt8_11 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_1.example.cpp index 332184107..232d400e0 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_1.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_1 +namespace generated_tests::strided_slice_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_1 + +namespace generated_tests::strided_slice_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_2.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_2.example.cpp index 780b93b9c..c7b82608a 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_2.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_2.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_2 +namespace generated_tests::strided_slice_quant8_2 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_2_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_2 + +namespace generated_tests::strided_slice_quant8_2 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_2_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_2 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_3.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_3.example.cpp index 7323aa3bf..2281d02d0 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_3.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_3.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_3 +namespace generated_tests::strided_slice_quant8_3 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_3_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_3 + +namespace generated_tests::strided_slice_quant8_3 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_3_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_3 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_4.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_4.example.cpp index 714f3b857..cfb69d8f8 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_4.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_4.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_4 +namespace generated_tests::strided_slice_quant8_4 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_4_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_4 + +namespace generated_tests::strided_slice_quant8_4 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_4_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_4 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_5.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_5.example.cpp index 860b08ca1..802e27d96 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_5.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_5.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_5 +namespace generated_tests::strided_slice_quant8_5 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_5_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_5 + +namespace generated_tests::strided_slice_quant8_5 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_5_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_5 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_6.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_6.example.cpp index 926cbb098..b39b4a88c 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_6.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_6.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_6 +namespace generated_tests::strided_slice_quant8_6 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2, 3, 4}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_6_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_6 + +namespace generated_tests::strided_slice_quant8_6 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({2, 3, 4}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_6_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_6 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_7.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_7.example.cpp index 4bfe511c4..539c81a91 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_7.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_7.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_7 +namespace generated_tests::strided_slice_quant8_7 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({3, 2, 1}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_7_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_7 + +namespace generated_tests::strided_slice_quant8_7 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({3, 2, 1}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_7_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_7 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_8.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_8.example.cpp index 8179e5efa..7749d5219 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_8.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_8.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_8 +namespace generated_tests::strided_slice_quant8_8 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({6, 5, 4}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_8_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_8 + +namespace generated_tests::strided_slice_quant8_8 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({6, 5, 4}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_8_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_8 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_9.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_9.example.cpp index df8ff7b66..3fe4fe229 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_9.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_quant8_9.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_quant8_9 +namespace generated_tests::strided_slice_quant8_9 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 4, 5}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_9_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_9 + +namespace generated_tests::strided_slice_quant8_9 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 4, 5}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_9_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_9 + diff --git a/nn/runtime/test/generated/spec_V1_1/strided_slice_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/strided_slice_relaxed.example.cpp index 17d0639e5..f9a9c0990 100644 --- a/nn/runtime/test/generated/spec_V1_1/strided_slice_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/strided_slice_relaxed.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_relaxed +namespace generated_tests::strided_slice_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_relaxed + +namespace generated_tests::strided_slice_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/transpose.example.cpp b/nn/runtime/test/generated/spec_V1_1/transpose.example.cpp index a9ea96732..c398eff1b 100644 --- a/nn/runtime/test/generated/spec_V1_1/transpose.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/transpose.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::transpose +namespace generated_tests::transpose { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f, 2.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("transpose_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::transpose + +namespace generated_tests::transpose { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f, 2.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("transpose_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::transpose + diff --git a/nn/runtime/test/generated/spec_V1_1/transpose_float_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/transpose_float_1.example.cpp index 3fcf7fee2..e7bfe8945 100644 --- a/nn/runtime/test/generated/spec_V1_1/transpose_float_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/transpose_float_1.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::transpose_float_1 +namespace generated_tests::transpose_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("transpose_float_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::transpose_float_1 + +namespace generated_tests::transpose_float_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("transpose_float_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::transpose_float_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/transpose_float_1_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/transpose_float_1_relaxed.example.cpp index 4413318b7..1da44d1cb 100644 --- a/nn/runtime/test/generated/spec_V1_1/transpose_float_1_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/transpose_float_1_relaxed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::transpose_float_1_relaxed +namespace generated_tests::transpose_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("transpose_float_1_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::transpose_float_1_relaxed + +namespace generated_tests::transpose_float_1_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 100.0f, 101.0f, 102.0f, 103.0f, 104.0f, 105.0f, 106.0f, 107.0f, 108.0f, 109.0f, 110.0f, 111.0f, 112.0f, 113.0f, 114.0f, 115.0f, 116.0f, 117.0f, 118.0f, 119.0f}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("transpose_float_1_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::transpose_float_1_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_1/transpose_quant8_1.example.cpp b/nn/runtime/test/generated/spec_V1_1/transpose_quant8_1.example.cpp index a7e75459e..5819c6517 100644 --- a/nn/runtime/test/generated/spec_V1_1/transpose_quant8_1.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/transpose_quant8_1.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::transpose_quant8_1 +namespace generated_tests::transpose_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({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, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 1, 2, 3, 4, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 60, 61, 62, 63, 64, 80, 81, 82, 83, 84, 100, 101, 102, 103, 104, 5, 6, 7, 8, 9, 25, 26, 27, 28, 29, 45, 46, 47, 48, 49, 65, 66, 67, 68, 69, 85, 86, 87, 88, 89, 105, 106, 107, 108, 109, 10, 11, 12, 13, 14, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 70, 71, 72, 73, 74, 90, 91, 92, 93, 94, 110, 111, 112, 113, 114, 15, 16, 17, 18, 19, 35, 36, 37, 38, 39, 55, 56, 57, 58, 59, 75, 76, 77, 78, 79, 95, 96, 97, 98, 99, 115, 116, 117, 118, 119}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("transpose_quant8_1_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::transpose_quant8_1 + +namespace generated_tests::transpose_quant8_1 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 1, 2, 3, 4, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 60, 61, 62, 63, 64, 80, 81, 82, 83, 84, 100, 101, 102, 103, 104, 5, 6, 7, 8, 9, 25, 26, 27, 28, 29, 45, 46, 47, 48, 49, 65, 66, 67, 68, 69, 85, 86, 87, 88, 89, 105, 106, 107, 108, 109, 10, 11, 12, 13, 14, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 70, 71, 72, 73, 74, 90, 91, 92, 93, 94, 110, 111, 112, 113, 114, 15, 16, 17, 18, 19, 35, 36, 37, 38, 39, 55, 56, 57, 58, 59, 75, 76, 77, 78, 79, 95, 96, 97, 98, 99, 115, 116, 117, 118, 119}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({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, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("transpose_quant8_1_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::transpose_quant8_1 + diff --git a/nn/runtime/test/generated/spec_V1_1/transpose_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/transpose_relaxed.example.cpp index bf7c853f1..c8c8376c1 100644 --- a/nn/runtime/test/generated/spec_V1_1/transpose_relaxed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_1/transpose_relaxed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::transpose_relaxed +namespace generated_tests::transpose_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f, 2.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("transpose_relaxed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::transpose_relaxed + +namespace generated_tests::transpose_relaxed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 3.0f, 2.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("transpose_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::transpose_relaxed + diff --git a/nn/runtime/test/generated/spec_V1_2/mean_float16.example.cpp b/nn/runtime/test/generated/spec_V1_2/mean_float16.example.cpp index 2720d0190..be935ea0a 100644 --- a/nn/runtime/test/generated/spec_V1_2/mean_float16.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/mean_float16.example.cpp @@ -172,3 +172,171 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::mean_float16 +namespace generated_tests::mean_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.5f, 3.5f}), + .dimensions = {1, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_float16_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_float16 + +namespace generated_tests::mean_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.5f, 3.5f}), + .dimensions = {1, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // dummy1 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_float16 + diff --git a/nn/runtime/test/generated/spec_V1_2/pad_all_dims.example.cpp b/nn/runtime/test/generated/spec_V1_2/pad_all_dims.example.cpp index d5f3f5541..5ac39daaf 100644 --- a/nn/runtime/test/generated/spec_V1_2/pad_all_dims.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/pad_all_dims.example.cpp @@ -154,6 +154,154 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::pad_all_dims { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,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.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_all_dims_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_all_dims + +namespace generated_tests::pad_all_dims { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.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, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_all_dims_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_all_dims + +namespace generated_tests::pad_all_dims { + const TestModel& get_test_model_float16() { static TestModel model = { .expectFailure = false, @@ -258,7 +406,7 @@ const TestModel& get_test_model_float16_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 - }, { // dummy1 + }, { // dummy2 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, @@ -268,7 +416,7 @@ const TestModel& get_test_model_float16_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 - }, { // param1 + }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -302,6 +450,154 @@ const auto dummy_test_model_float16_all_inputs_as_internal = TestModelManager::g namespace generated_tests::pad_all_dims { +const TestModel& get_test_model_float16_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberO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.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_float16_all_tensors_as_inputs = TestModelManager::get().add("pad_all_dims_float16_all_tensors_as_inputs", get_test_model_float16_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_all_dims + +namespace generated_tests::pad_all_dims { + +const TestModel& get_test_model_float16_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f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+ .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 = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // dummy3 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_float16_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_all_dims_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_float16_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_all_dims + +namespace generated_tests::pad_all_dims { + const TestModel& get_test_model_relaxed() { static TestModel model = { .expectFailure = false, @@ -406,7 +702,7 @@ const TestModel& get_test_model_relaxed_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 - }, { // dummy2 + }, { // dummy4 .channelQuant = {}, .data = TestBuffer::createFromVector<float>({0.0f}), .dimensions = {1}, @@ -416,7 +712,7 @@ const TestModel& get_test_model_relaxed_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT32, .zeroPoint = 0 - }, { // param2 + }, { // param4 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -450,6 +746,154 @@ const auto dummy_test_model_relaxed_all_inputs_as_internal = TestModelManager::g namespace generated_tests::pad_all_dims { +const TestModel& get_test_model_relaxed_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0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 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_relaxed_all_tensors_as_inputs = TestModelManager::get().add("pad_all_dims_relaxed_all_tensors_as_inputs", get_test_model_relaxed_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_all_dims + +namespace generated_tests::pad_all_dims { + +const TestModel& get_test_model_relaxed_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = true, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0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f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::UNKNOWN, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_relaxed_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_all_dims_relaxed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_relaxed_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_all_dims + +namespace generated_tests::pad_all_dims { + const TestModel& get_test_model_quant8() { static TestModel model = { .expectFailure = false, @@ -554,7 +998,7 @@ const TestModel& get_test_model_quant8_all_inputs_as_internal() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 0 - }, { // dummy3 + }, { // dummy6 .channelQuant = {}, .data = TestBuffer::createFromVector<uint8_t>({0}), .dimensions = {1}, @@ -564,7 +1008,7 @@ const TestModel& get_test_model_quant8_all_inputs_as_internal() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM, .zeroPoint = 0 - }, { // param3 + }, { // param6 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -596,3 +1040,151 @@ const auto dummy_test_model_quant8_all_inputs_as_internal = TestModelManager::ge } // namespace generated_tests::pad_all_dims +namespace generated_tests::pad_all_dims { + +const TestModel& get_test_model_quant8_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 1, 1, 2, 2, 3}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({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, 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, 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, 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, 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nored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_quant8_all_tensors_as_inputs = TestModelManager::get().add("pad_all_dims_quant8_all_tensors_as_inputs", get_test_model_quant8_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_all_dims + +namespace generated_tests::pad_all_dims { + +const TestModel& get_test_model_quant8_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({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, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 1, 1, 2, 2, 3}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_quant8_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_all_dims_quant8_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_quant8_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_all_dims + diff --git a/nn/runtime/test/generated/spec_V1_2/pad_float16.example.cpp b/nn/runtime/test/generated/spec_V1_2/pad_float16.example.cpp index 7a00bc6ab..591b38962 100644 --- a/nn/runtime/test/generated/spec_V1_2/pad_float16.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/pad_float16.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad_float16 +namespace generated_tests::pad_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 1, 1, 1, 1, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 0.0f, 0.0f, 3.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 4, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_float16_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_float16 + +namespace generated_tests::pad_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 1, 1, 1, 1, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 0.0f, 0.0f, 3.0f, 4.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}), + .dimensions = {1, 4, 4, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // dummy1 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_float16 + diff --git a/nn/runtime/test/generated/spec_V1_2/pad_low_rank.example.cpp b/nn/runtime/test/generated/spec_V1_2/pad_low_rank.example.cpp index a5808317f..f690ca37f 100644 --- a/nn/runtime/test/generated/spec_V1_2/pad_low_rank.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/pad_low_rank.example.cpp @@ -154,6 +154,154 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::pad_low_rank { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 3.0f, 0.0f}), + .dimensions = {7}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_low_rank_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_low_rank + +namespace generated_tests::pad_low_rank { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 3.0f, 0.0f}), + .dimensions = {7}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_low_rank_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_low_rank + +namespace generated_tests::pad_low_rank { + const TestModel& get_test_model_float16() { static TestModel model = { .expectFailure = false, @@ -258,7 +406,7 @@ const TestModel& get_test_model_float16_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 - }, { // dummy1 + }, { // dummy2 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, @@ -268,7 +416,7 @@ const TestModel& get_test_model_float16_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 - }, { // param1 + }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -300,3 +448,151 @@ const auto dummy_test_model_float16_all_inputs_as_internal = TestModelManager::g } // namespace generated_tests::pad_low_rank +namespace generated_tests::pad_low_rank { + +const TestModel& get_test_model_float16_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 3.0f, 0.0f}), + .dimensions = {7}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_float16_all_tensors_as_inputs = TestModelManager::get().add("pad_low_rank_float16_all_tensors_as_inputs", get_test_model_float16_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_low_rank + +namespace generated_tests::pad_low_rank { + +const TestModel& get_test_model_float16_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({0.0f, 0.0f, 0.0f, 1.0f, 2.0f, 3.0f, 0.0f}), + .dimensions = {7}, + .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}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // dummy3 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_float16_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_low_rank_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_float16_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_low_rank + diff --git a/nn/runtime/test/generated/spec_V1_2/pad_low_rank_quant8.example.cpp b/nn/runtime/test/generated/spec_V1_2/pad_low_rank_quant8.example.cpp index 5f08eb48a..f0fa558a0 100644 --- a/nn/runtime/test/generated/spec_V1_2/pad_low_rank_quant8.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/pad_low_rank_quant8.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad_low_rank_quant8 +namespace generated_tests::pad_low_rank_quant8 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 0, 0, 1, 2, 3, 0}), + .dimensions = {7}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_low_rank_quant8_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_low_rank_quant8 + +namespace generated_tests::pad_low_rank_quant8 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 0, 0, 1, 2, 3, 0}), + .dimensions = {7}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_low_rank_quant8_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_low_rank_quant8 + diff --git a/nn/runtime/test/generated/spec_V1_2/pad_quant8.example.cpp b/nn/runtime/test/generated/spec_V1_2/pad_quant8.example.cpp index 9a472dcbf..0d97ce097 100644 --- a/nn/runtime/test/generated/spec_V1_2/pad_quant8.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/pad_quant8.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad_quant8 +namespace generated_tests::pad_quant8 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 1, 2, 3, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_quant8_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_quant8 + +namespace generated_tests::pad_quant8 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0, 1, 2, 3, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({0}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_1, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_quant8_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_quant8 + diff --git a/nn/runtime/test/generated/spec_V1_2/pad_quant8_nonzero.example.cpp b/nn/runtime/test/generated/spec_V1_2/pad_quant8_nonzero.example.cpp index 2755a3fdd..6515217b5 100644 --- a/nn/runtime/test/generated/spec_V1_2/pad_quant8_nonzero.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/pad_quant8_nonzero.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::pad_quant8_nonzero +namespace generated_tests::pad_quant8_nonzero { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 9 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({9, 1, 2, 3, 9, 9, 9, 9, 4, 5, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 9 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_quant8_nonzero_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_quant8_nonzero + +namespace generated_tests::pad_quant8_nonzero { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 9 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({9, 1, 2, 3, 9, 9, 9, 9, 4, 5, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 9 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({1, 2, 3, 4, 5, 6}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 9 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<uint8_t>({9}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM, + .zeroPoint = 9 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_quant8_nonzero_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_quant8_nonzero + diff --git a/nn/runtime/test/generated/spec_V1_2/reshape_float16.example.cpp b/nn/runtime/test/generated/spec_V1_2/reshape_float16.example.cpp index e310ce189..557bb8aa7 100644 --- a/nn/runtime/test/generated/spec_V1_2/reshape_float16.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/reshape_float16.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::reshape_float16 +namespace generated_tests::reshape_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("reshape_float16_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::reshape_float16 + +namespace generated_tests::reshape_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // dummy1 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("reshape_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_float16 + diff --git a/nn/runtime/test/generated/spec_V1_2/squeeze_float16.example.cpp b/nn/runtime/test/generated/spec_V1_2/squeeze_float16.example.cpp index 00d4ab88f..bb458b291 100644 --- a/nn/runtime/test/generated/spec_V1_2/squeeze_float16.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/squeeze_float16.example.cpp @@ -154,6 +154,154 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::squeeze_float16 { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("squeeze_float16_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::squeeze_float16 + +namespace generated_tests::squeeze_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.4f, 2.3f, 3.2f, 4.1f, 5.4f, 6.3f, 7.2f, 8.1f}), + .dimensions = {4, 1, 1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // dummy1 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("squeeze_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::squeeze_float16 + +namespace generated_tests::squeeze_float16 { + const TestModel& get_test_model_omitted() { static TestModel model = { .expectFailure = false, @@ -258,7 +406,7 @@ const TestModel& get_test_model_omitted_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 - }, { // dummy1 + }, { // dummy2 .channelQuant = {}, .data = TestBuffer::createFromVector<_Float16>({0.0f}), .dimensions = {1}, @@ -268,7 +416,7 @@ const TestModel& get_test_model_omitted_all_inputs_as_internal() { .scale = 0.0f, .type = TestOperandType::TENSOR_FLOAT16, .zeroPoint = 0 - }, { // param1 + }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, diff --git a/nn/runtime/test/generated/spec_V1_2/strided_slice_float16.example.cpp b/nn/runtime/test/generated/spec_V1_2/strided_slice_float16.example.cpp index 52b1b116d..8c39eba7a 100644 --- a/nn/runtime/test/generated/spec_V1_2/strided_slice_float16.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/strided_slice_float16.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_float16 +namespace generated_tests::strided_slice_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 3.0f}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_float16_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_float16 + +namespace generated_tests::strided_slice_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 3.0f}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // input_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 + }, { // dummy1 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_float16 + diff --git a/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid.example.cpp b/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid.example.cpp new file mode 100644 index 000000000..4b7449429 --- /dev/null +++ b/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid.example.cpp @@ -0,0 +1,502 @@ +// Generated from strided_slice_invalid.mod.py +// DO NOT EDIT +// clang-format off +#include "TestHarness.h" +using namespace test_helper; + +namespace generated_tests::strided_slice_invalid { + +const TestModel& get_test_model_output_dims() { + static TestModel model = { + .expectFailure = true, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { // output_dims + .inputIndexes = {0}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // param + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_output_dims = TestModelManager::get().add("strided_slice_invalid_output_dims", get_test_model_output_dims()); + +} // namespace generated_tests::strided_slice_invalid + +namespace generated_tests::strided_slice_invalid { + +const TestModel& get_test_model_output_dims_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = true, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { // output_dims + .inputIndexes = {8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_output_dims_all_inputs_as_internal = TestModelManager::get().add("strided_slice_invalid_output_dims_all_inputs_as_internal", get_test_model_output_dims_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_invalid + +namespace generated_tests::strided_slice_invalid { + +const TestModel& get_test_model_neg_stride() { + static TestModel model = { + .expectFailure = true, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { // neg_stride + .inputIndexes = {0}, + .operands = {{ // input1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // param6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param11 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({4.0f, 5.0f, 6.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_neg_stride = TestModelManager::get().add("strided_slice_invalid_neg_stride", get_test_model_neg_stride()); + +} // namespace generated_tests::strided_slice_invalid + +namespace generated_tests::strided_slice_invalid { + +const TestModel& get_test_model_neg_stride_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = true, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { // neg_stride + .inputIndexes = {8}, + .operands = {{ // input1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // param9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // param11 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({4.0f, 5.0f, 6.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param13 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_neg_stride_all_inputs_as_internal = TestModelManager::get().add("strided_slice_invalid_neg_stride_all_inputs_as_internal", get_test_model_neg_stride_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_invalid + diff --git a/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp b/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp index dadaef3ee..f164c190a 100644 --- a/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/strided_slice_invalid_output_dims.example.cpp @@ -252,3 +252,251 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::strided_slice_invalid_output_dims +namespace generated_tests::strided_slice_invalid_output_dims { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = true, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_invalid_output_dims_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_invalid_output_dims + +namespace generated_tests::strided_slice_invalid_output_dims { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = true, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({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 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<float>({0.0f}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT32, + .zeroPoint = 0 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_invalid_output_dims_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_invalid_output_dims + diff --git a/nn/runtime/test/generated/spec_V1_2/transpose_float16.example.cpp b/nn/runtime/test/generated/spec_V1_2/transpose_float16.example.cpp index 5d1423fa4..73ba86250 100644 --- a/nn/runtime/test/generated/spec_V1_2/transpose_float16.example.cpp +++ b/nn/runtime/test/generated/spec_V1_2/transpose_float16.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::transpose_float16 +namespace generated_tests::transpose_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 3.0f, 2.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("transpose_float16_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::transpose_float16 + +namespace generated_tests::transpose_float16 { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 3.0f, 2.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f}), + .dimensions = {1, 2, 2, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_FLOAT16, + .zeroPoint = 0 + }, { // dummy1 + .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<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_2, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("transpose_float16_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::transpose_float16 + diff --git a/nn/runtime/test/generated/spec_V1_3/if_no_value.example.cpp b/nn/runtime/test/generated/spec_V1_3/if_no_value.example.cpp index 89eaed88d..aace2a9fe 100644 --- a/nn/runtime/test/generated/spec_V1_3/if_no_value.example.cpp +++ b/nn/runtime/test/generated/spec_V1_3/if_no_value.example.cpp @@ -191,191 +191,6 @@ const auto dummy_test_model = TestModelManager::get().add("if_no_value", get_tes namespace generated_tests::if_no_value { -const TestModel& get_test_model_all_tensors_as_inputs() { - static TestModel model = { - .expectFailure = true, - .expectedMultinomialDistributionTolerance = 0, - .isRelaxed = false, - .main = { - .inputIndexes = {0, 3, 4}, - .operands = {{ // cond - .channelQuant = {}, - .data = TestBuffer::createFromVector<bool8>({}), - .dimensions = {1}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_BOOL8, - .zeroPoint = 0 - }, { // param2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // param3 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({1}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // x - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // y - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({8.0f, 7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f, -1.0f, -2.0f, -3.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // z - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({8.0f, 7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f, -1.0f, -2.0f, -3.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2, 3, 4}, - .outputs = {5}, - .type = TestOperationType::IF - }}, - .outputIndexes = {5} - }, - .minSupportedVersion = TestHalVersion::V1_3, - .referenced = {{ // param - .inputIndexes = {0, 1}, - .operands = {{ // x1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // y1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // param - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::ADD - }}, - .outputIndexes = {3} - }, { // param - .inputIndexes = {0, 1}, - .operands = {{ // x2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // y2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // param1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::SUB - }}, - .outputIndexes = {3} - }} - }; - return model; -} - -const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("if_no_value_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); - -} // namespace generated_tests::if_no_value - -namespace generated_tests::if_no_value { - const TestModel& get_test_model_relaxed() { static TestModel model = { .expectFailure = true, @@ -561,191 +376,6 @@ const auto dummy_test_model_relaxed = TestModelManager::get().add("if_no_value_r namespace generated_tests::if_no_value { -const TestModel& get_test_model_relaxed_all_tensors_as_inputs() { - static TestModel model = { - .expectFailure = true, - .expectedMultinomialDistributionTolerance = 0, - .isRelaxed = true, - .main = { - .inputIndexes = {0, 3, 4}, - .operands = {{ // cond - .channelQuant = {}, - .data = TestBuffer::createFromVector<bool8>({}), - .dimensions = {1}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_BOOL8, - .zeroPoint = 0 - }, { // param2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // param3 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({1}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // x - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // y - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({8.0f, 7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f, -1.0f, -2.0f, -3.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // z - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({8.0f, 7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f, -1.0f, -2.0f, -3.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2, 3, 4}, - .outputs = {5}, - .type = TestOperationType::IF - }}, - .outputIndexes = {5} - }, - .minSupportedVersion = TestHalVersion::UNKNOWN, - .referenced = {{ // param - .inputIndexes = {0, 1}, - .operands = {{ // x1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // y1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // param - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::ADD - }}, - .outputIndexes = {3} - }, { // param - .inputIndexes = {0, 1}, - .operands = {{ // x2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // y2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }, { // param1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<float>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::SUB - }}, - .outputIndexes = {3} - }} - }; - return model; -} - -const auto dummy_test_model_relaxed_all_tensors_as_inputs = TestModelManager::get().add("if_no_value_relaxed_all_tensors_as_inputs", get_test_model_relaxed_all_tensors_as_inputs()); - -} // namespace generated_tests::if_no_value - -namespace generated_tests::if_no_value { - const TestModel& get_test_model_float16() { static TestModel model = { .expectFailure = true, @@ -931,191 +561,6 @@ const auto dummy_test_model_float16 = TestModelManager::get().add("if_no_value_f namespace generated_tests::if_no_value { -const TestModel& get_test_model_float16_all_tensors_as_inputs() { - static TestModel model = { - .expectFailure = true, - .expectedMultinomialDistributionTolerance = 0, - .isRelaxed = false, - .main = { - .inputIndexes = {0, 3, 4}, - .operands = {{ // cond - .channelQuant = {}, - .data = TestBuffer::createFromVector<bool8>({}), - .dimensions = {1}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_BOOL8, - .zeroPoint = 0 - }, { // param2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // param3 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({1}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // x - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }, { // y - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({8.0f, 7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f, -1.0f, -2.0f, -3.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }, { // z - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({8.0f, 7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f, -1.0f, -2.0f, -3.0f}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2, 3, 4}, - .outputs = {5}, - .type = TestOperationType::IF - }}, - .outputIndexes = {5} - }, - .minSupportedVersion = TestHalVersion::V1_3, - .referenced = {{ // param - .inputIndexes = {0, 1}, - .operands = {{ // x1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }, { // y1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }, { // param - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::ADD - }}, - .outputIndexes = {3} - }, { // param - .inputIndexes = {0, 1}, - .operands = {{ // x2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }, { // y2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }, { // param1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<_Float16>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_FLOAT16, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::SUB - }}, - .outputIndexes = {3} - }} - }; - return model; -} - -const auto dummy_test_model_float16_all_tensors_as_inputs = TestModelManager::get().add("if_no_value_float16_all_tensors_as_inputs", get_test_model_float16_all_tensors_as_inputs()); - -} // namespace generated_tests::if_no_value - -namespace generated_tests::if_no_value { - const TestModel& get_test_model_int32() { static TestModel model = { .expectFailure = true, @@ -1301,191 +746,6 @@ const auto dummy_test_model_int32 = TestModelManager::get().add("if_no_value_int namespace generated_tests::if_no_value { -const TestModel& get_test_model_int32_all_tensors_as_inputs() { - static TestModel model = { - .expectFailure = true, - .expectedMultinomialDistributionTolerance = 0, - .isRelaxed = false, - .main = { - .inputIndexes = {0, 3, 4}, - .operands = {{ // cond - .channelQuant = {}, - .data = TestBuffer::createFromVector<bool8>({}), - .dimensions = {1}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_BOOL8, - .zeroPoint = 0 - }, { // param2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // param3 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({1}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // x - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }, { // y - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }, { // z - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2, 3, 4}, - .outputs = {5}, - .type = TestOperationType::IF - }}, - .outputIndexes = {5} - }, - .minSupportedVersion = TestHalVersion::V1_3, - .referenced = {{ // param - .inputIndexes = {0, 1}, - .operands = {{ // x1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }, { // y1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }, { // param - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::ADD - }}, - .outputIndexes = {3} - }, { // param - .inputIndexes = {0, 1}, - .operands = {{ // x2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }, { // y2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }, { // param1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 0.0f, - .type = TestOperandType::TENSOR_INT32, - .zeroPoint = 0 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::SUB - }}, - .outputIndexes = {3} - }} - }; - return model; -} - -const auto dummy_test_model_int32_all_tensors_as_inputs = TestModelManager::get().add("if_no_value_int32_all_tensors_as_inputs", get_test_model_int32_all_tensors_as_inputs()); - -} // namespace generated_tests::if_no_value - -namespace generated_tests::if_no_value { - const TestModel& get_test_model_quant8() { static TestModel model = { .expectFailure = true, @@ -1671,191 +931,6 @@ const auto dummy_test_model_quant8 = TestModelManager::get().add("if_no_value_qu namespace generated_tests::if_no_value { -const TestModel& get_test_model_quant8_all_tensors_as_inputs() { - static TestModel model = { - .expectFailure = true, - .expectedMultinomialDistributionTolerance = 0, - .isRelaxed = false, - .main = { - .inputIndexes = {0, 3, 4}, - .operands = {{ // cond - .channelQuant = {}, - .data = TestBuffer::createFromVector<bool8>({}), - .dimensions = {1}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_BOOL8, - .zeroPoint = 0 - }, { // param2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // param3 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({1}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // x - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }, { // y - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }, { // z - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }}, - .operations = {{ - .inputs = {0, 1, 2, 3, 4}, - .outputs = {5}, - .type = TestOperationType::IF - }}, - .outputIndexes = {5} - }, - .minSupportedVersion = TestHalVersion::V1_3, - .referenced = {{ // param - .inputIndexes = {0, 1}, - .operands = {{ // x1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }, { // y1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }, { // param - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::ADD - }}, - .outputIndexes = {3} - }, { // param - .inputIndexes = {0, 1}, - .operands = {{ // x2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }, { // y2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }, { // param1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM, - .zeroPoint = 100 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::SUB - }}, - .outputIndexes = {3} - }} - }; - return model; -} - -const auto dummy_test_model_quant8_all_tensors_as_inputs = TestModelManager::get().add("if_no_value_quant8_all_tensors_as_inputs", get_test_model_quant8_all_tensors_as_inputs()); - -} // namespace generated_tests::if_no_value - -namespace generated_tests::if_no_value { - const TestModel& get_test_model_quant8_signed() { static TestModel model = { .expectFailure = true, @@ -2039,188 +1114,3 @@ const auto dummy_test_model_quant8_signed = TestModelManager::get().add("if_no_v } // namespace generated_tests::if_no_value -namespace generated_tests::if_no_value { - -const TestModel& get_test_model_quant8_signed_all_tensors_as_inputs() { - static TestModel model = { - .expectFailure = true, - .expectedMultinomialDistributionTolerance = 0, - .isRelaxed = false, - .main = { - .inputIndexes = {0, 3, 4}, - .operands = {{ // cond - .channelQuant = {}, - .data = TestBuffer::createFromVector<bool8>({}), - .dimensions = {1}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::TENSOR_BOOL8, - .zeroPoint = 0 - }, { // param2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // param3 - .channelQuant = {}, - .data = TestBuffer::createFromVector<uint32_t>({1}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::SUBGRAPH, - .zeroPoint = 0 - }, { // x - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }, { // y - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }, { // z - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }}, - .operations = {{ - .inputs = {0, 1, 2, 3, 4}, - .outputs = {5}, - .type = TestOperationType::IF - }}, - .outputIndexes = {5} - }, - .minSupportedVersion = TestHalVersion::V1_3, - .referenced = {{ // param - .inputIndexes = {0, 1}, - .operands = {{ // x1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }, { // y1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }, { // param - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::ADD - }}, - .outputIndexes = {3} - }, { // param - .inputIndexes = {0, 1}, - .operands = {{ // x2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }, { // y2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, - .numberOfConsumers = 1, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }, { // param1 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int32_t>({0}), - .dimensions = {}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::CONSTANT_COPY, - .numberOfConsumers = 1, - .scale = 0.0f, - .type = TestOperandType::INT32, - .zeroPoint = 0 - }, { // z2 - .channelQuant = {}, - .data = TestBuffer::createFromVector<int8_t>({}), - .dimensions = {3, 4}, - .isIgnored = false, - .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, - .numberOfConsumers = 0, - .scale = 1.0f, - .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, - .zeroPoint = 100 - }}, - .operations = {{ - .inputs = {0, 1, 2}, - .outputs = {3}, - .type = TestOperationType::SUB - }}, - .outputIndexes = {3} - }} - }; - return model; -} - -const auto dummy_test_model_quant8_signed_all_tensors_as_inputs = TestModelManager::get().add("if_no_value_quant8_signed_all_tensors_as_inputs", get_test_model_quant8_signed_all_tensors_as_inputs()); - -} // namespace generated_tests::if_no_value - diff --git a/nn/runtime/test/generated/spec_V1_3/mean_quant8_signed.example.cpp b/nn/runtime/test/generated/spec_V1_3/mean_quant8_signed.example.cpp index a83ba4998..af3c7d28f 100644 --- a/nn/runtime/test/generated/spec_V1_3/mean_quant8_signed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_3/mean_quant8_signed.example.cpp @@ -174,6 +174,174 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::mean_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-116, -115}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("mean_quant8_signed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::mean_quant8_signed + +namespace generated_tests::mean_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // axis + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0, -3, -3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-116, -115}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-123}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("mean_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::mean_quant8_signed + +namespace generated_tests::mean_quant8_signed { + const TestModel& get_test_model_2() { static TestModel model = { .expectFailure = false, @@ -298,7 +466,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() { .scale = 0.8f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -123 - }, { // dummy1 + }, { // dummy2 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-123}), .dimensions = {1}, @@ -308,7 +476,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() { .scale = 0.8f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -123 - }, { // param1 + }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -340,3 +508,171 @@ const auto dummy_test_model_all_inputs_as_internal_2 = TestModelManager::get().a } // namespace generated_tests::mean_quant8_signed +namespace generated_tests::mean_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_2() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // axis1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-118, -116, -114}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }}, + .operations = {{ + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_2 = TestModelManager::get().add("mean_quant8_signed_all_tensors_as_inputs_2", get_test_model_all_tensors_as_inputs_2()); + +} // namespace generated_tests::mean_quant8_signed + +namespace generated_tests::mean_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 4}, + .operands = {{ // input1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // axis1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // keepDims1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-118, -116, -114}), + .dimensions = {1, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // input1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {4, 3, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // dummy3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-123}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.8f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -123 + }, { // param3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {4, 5, 6}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2}, + .outputs = {3}, + .type = TestOperationType::MEAN + }}, + .outputIndexes = {3} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_2 = TestModelManager::get().add("mean_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_2", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2()); + +} // namespace generated_tests::mean_quant8_signed + diff --git a/nn/runtime/test/generated/spec_V1_3/pad_quant8_signed.example.cpp b/nn/runtime/test/generated/spec_V1_3/pad_quant8_signed.example.cpp index ea6ce262c..2eb1f626a 100644 --- a/nn/runtime/test/generated/spec_V1_3/pad_quant8_signed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_3/pad_quant8_signed.example.cpp @@ -154,6 +154,154 @@ const auto dummy_test_model_quant8_signed_all_inputs_as_internal = TestModelMana namespace generated_tests::pad_quant8_signed { +const TestModel& get_test_model_quant8_signed_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -127, -127, -126, -126, -125}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -127, -127, -128, -128, -128, -126, -126, -125, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_quant8_signed_all_tensors_as_inputs = TestModelManager::get().add("pad_quant8_signed_quant8_signed_all_tensors_as_inputs", get_test_model_quant8_signed_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + +const TestModel& get_test_model_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // paddings + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 2, 3, 4, 3, 3, 2, 1}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output0 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -127, -127, -128, -128, -128, -126, -126, -125, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}), + .dimensions = {4, 8, 8, 6}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input0_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -127, -127, -126, -126, -125}), + .dimensions = {1, 1, 2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_quant8_signed_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + const TestModel& get_test_model() { static TestModel model = { .expectFailure = false, @@ -258,7 +406,7 @@ const TestModel& get_test_model_all_inputs_as_internal() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy1 + }, { // dummy2 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -268,7 +416,7 @@ const TestModel& get_test_model_all_inputs_as_internal() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param1 + }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -302,6 +450,154 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::pad_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input01 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // paddings1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output01 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -128, -128, -127, -126, -125, -128}), + .dimensions = {7}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input01 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // paddings1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3, 1}), + .dimensions = {1, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output01 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -128, -128, -127, -126, -125, -128}), + .dimensions = {7}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input01_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + const TestModel& get_test_model_2() { static TestModel model = { .expectFailure = false, @@ -406,7 +702,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy2 + }, { // dummy4 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -416,7 +712,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param2 + }, { // param4 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -450,6 +746,154 @@ const auto dummy_test_model_all_inputs_as_internal_2 = TestModelManager::get().a namespace generated_tests::pad_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_2() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input02 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // paddings2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output02 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -127, -126, -125, -128, -128, -128, -128, -124, -123, -122, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_2 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_2", get_test_model_all_tensors_as_inputs_2()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input02 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // paddings2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output02 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128, -127, -126, -125, -128, -128, -128, -128, -124, -123, -122, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input02_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_2 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_2", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + const TestModel& get_test_model_3() { static TestModel model = { .expectFailure = false, @@ -554,7 +998,7 @@ const TestModel& get_test_model_all_inputs_as_internal_3() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -119 - }, { // dummy3 + }, { // dummy6 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-119}), .dimensions = {1}, @@ -564,7 +1008,7 @@ const TestModel& get_test_model_all_inputs_as_internal_3() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -119 - }, { // param3 + }, { // param6 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -598,6 +1042,154 @@ const auto dummy_test_model_all_inputs_as_internal_3 = TestModelManager::get().a namespace generated_tests::pad_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_3() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input03 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -119 + }, { // paddings3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output03 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-119, -127, -126, -125, -119, -119, -119, -119, -124, -123, -122, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -119 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_3 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_3", get_test_model_all_tensors_as_inputs_3()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input03 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -119 + }, { // paddings3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0, 0, 2, 1, 3, 0, 0}), + .dimensions = {4, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output03 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-119, -127, -126, -125, -119, -119, -119, -119, -124, -123, -122, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119}), + .dimensions = {1, 4, 7, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -119 + }, { // input03_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {1, 2, 3, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -119 + }, { // dummy7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-119}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 2.3f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -119 + }, { // param7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::PAD + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_3 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_3", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3()); + +} // namespace generated_tests::pad_quant8_signed + +namespace generated_tests::pad_quant8_signed { + const TestModel& get_test_model_4() { static TestModel model = { .expectFailure = false, @@ -722,7 +1314,7 @@ const TestModel& get_test_model_all_inputs_as_internal_4() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // dummy4 + }, { // dummy8 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-124}), .dimensions = {1}, @@ -732,7 +1324,7 @@ const TestModel& get_test_model_all_inputs_as_internal_4() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // param4 + }, { // param8 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -766,7 +1358,7 @@ const auto dummy_test_model_all_inputs_as_internal_4 = TestModelManager::get().a namespace generated_tests::pad_quant8_signed { -const TestModel& get_test_model_all_tensors_as_inputs() { +const TestModel& get_test_model_all_tensors_as_inputs_4() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, @@ -827,13 +1419,13 @@ const TestModel& get_test_model_all_tensors_as_inputs() { return model; } -const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); +const auto dummy_test_model_all_tensors_as_inputs_4 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_4", get_test_model_all_tensors_as_inputs_4()); } // namespace generated_tests::pad_quant8_signed namespace generated_tests::pad_quant8_signed { -const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_4() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, @@ -890,7 +1482,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // dummy5 + }, { // dummy9 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-124}), .dimensions = {1}, @@ -900,7 +1492,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // param5 + }, { // param9 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -928,7 +1520,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { return model; } -const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_4 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_4", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_4()); } // namespace generated_tests::pad_quant8_signed @@ -1058,7 +1650,7 @@ const TestModel& get_test_model_all_inputs_as_internal_5() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // dummy6 + }, { // dummy10 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-124}), .dimensions = {1}, @@ -1068,7 +1660,7 @@ const TestModel& get_test_model_all_inputs_as_internal_5() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // param6 + }, { // param10 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1102,7 +1694,7 @@ const auto dummy_test_model_all_inputs_as_internal_5 = TestModelManager::get().a namespace generated_tests::pad_quant8_signed { -const TestModel& get_test_model_all_tensors_as_inputs_2() { +const TestModel& get_test_model_all_tensors_as_inputs_5() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, @@ -1163,13 +1755,13 @@ const TestModel& get_test_model_all_tensors_as_inputs_2() { return model; } -const auto dummy_test_model_all_tensors_as_inputs_2 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_2", get_test_model_all_tensors_as_inputs_2()); +const auto dummy_test_model_all_tensors_as_inputs_5 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_5", get_test_model_all_tensors_as_inputs_5()); } // namespace generated_tests::pad_quant8_signed namespace generated_tests::pad_quant8_signed { -const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2() { +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_5() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, @@ -1226,7 +1818,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2() .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // dummy7 + }, { // dummy11 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-124}), .dimensions = {1}, @@ -1236,7 +1828,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2() .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // param7 + }, { // param11 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1264,7 +1856,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2() return model; } -const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_2 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_2", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2()); +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_5 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_5", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_5()); } // namespace generated_tests::pad_quant8_signed @@ -1394,7 +1986,7 @@ const TestModel& get_test_model_all_inputs_as_internal_6() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // dummy8 + }, { // dummy12 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-124}), .dimensions = {1}, @@ -1404,7 +1996,7 @@ const TestModel& get_test_model_all_inputs_as_internal_6() { .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // param8 + }, { // param12 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1438,7 +2030,7 @@ const auto dummy_test_model_all_inputs_as_internal_6 = TestModelManager::get().a namespace generated_tests::pad_quant8_signed { -const TestModel& get_test_model_all_tensors_as_inputs_3() { +const TestModel& get_test_model_all_tensors_as_inputs_6() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, @@ -1499,13 +2091,13 @@ const TestModel& get_test_model_all_tensors_as_inputs_3() { return model; } -const auto dummy_test_model_all_tensors_as_inputs_3 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_3", get_test_model_all_tensors_as_inputs_3()); +const auto dummy_test_model_all_tensors_as_inputs_6 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_6", get_test_model_all_tensors_as_inputs_6()); } // namespace generated_tests::pad_quant8_signed namespace generated_tests::pad_quant8_signed { -const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3() { +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_6() { static TestModel model = { .expectFailure = false, .expectedMultinomialDistributionTolerance = 0, @@ -1562,7 +2154,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3() .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // dummy9 + }, { // dummy13 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-124}), .dimensions = {1}, @@ -1572,7 +2164,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3() .scale = 2.3f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -124 - }, { // param9 + }, { // param13 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1600,7 +2192,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3() return model; } -const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_3 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_3", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3()); +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_6 = TestModelManager::get().add("pad_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_6", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_6()); } // namespace generated_tests::pad_quant8_signed diff --git a/nn/runtime/test/generated/spec_V1_3/reshape_quant8_signed.example.cpp b/nn/runtime/test/generated/spec_V1_3/reshape_quant8_signed.example.cpp index 96b816f16..57f19e173 100644 --- a/nn/runtime/test/generated/spec_V1_3/reshape_quant8_signed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_3/reshape_quant8_signed.example.cpp @@ -152,3 +152,151 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add } // namespace generated_tests::reshape_quant8_signed +namespace generated_tests::reshape_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("reshape_quant8_signed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::reshape_quant8_signed + +namespace generated_tests::reshape_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // op1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // op2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // op3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119}), + .dimensions = {9}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // op1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119}), + .dimensions = {1, 1, 3, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::RESHAPE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("reshape_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::reshape_quant8_signed + diff --git a/nn/runtime/test/generated/spec_V1_3/squeeze_quant8_signed.example.cpp b/nn/runtime/test/generated/spec_V1_3/squeeze_quant8_signed.example.cpp index babb68ab3..95e1fb3c9 100644 --- a/nn/runtime/test/generated/spec_V1_3/squeeze_quant8_signed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_3/squeeze_quant8_signed.example.cpp @@ -154,6 +154,154 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::squeeze_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("squeeze_quant8_signed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::squeeze_quant8_signed + +namespace generated_tests::squeeze_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // squeezeDims + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {1, 24}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106, -105, -104}), + .dimensions = {1, 24, 1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::SQUEEZE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("squeeze_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::squeeze_quant8_signed + +namespace generated_tests::squeeze_quant8_signed { + const TestModel& get_test_model_omitted() { static TestModel model = { .expectFailure = false, @@ -258,7 +406,7 @@ const TestModel& get_test_model_omitted_all_inputs_as_internal() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy1 + }, { // dummy2 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -268,7 +416,7 @@ const TestModel& get_test_model_omitted_all_inputs_as_internal() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param1 + }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, diff --git a/nn/runtime/test/generated/spec_V1_3/strided_slice_quant8_signed.example.cpp b/nn/runtime/test/generated/spec_V1_3/strided_slice_quant8_signed.example.cpp index f24ea0824..b0b152b40 100644 --- a/nn/runtime/test/generated/spec_V1_3/strided_slice_quant8_signed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_3/strided_slice_quant8_signed.example.cpp @@ -254,6 +254,254 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-124, -123, -122}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-124, -123, -122}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_2() { static TestModel model = { .expectFailure = false, @@ -458,7 +706,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy1 + }, { // dummy2 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -468,7 +716,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param1 + }, { // param2 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -502,6 +750,254 @@ const auto dummy_test_model_all_inputs_as_internal_2 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_2() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_2 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_2", get_test_model_all_tensors_as_inputs_2()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 3}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output1 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input1_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_2 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_2", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_2()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_3() { static TestModel model = { .expectFailure = false, @@ -706,7 +1202,7 @@ const TestModel& get_test_model_all_inputs_as_internal_3() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy2 + }, { // dummy4 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -716,7 +1212,7 @@ const TestModel& get_test_model_all_inputs_as_internal_3() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param2 + }, { // param4 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -750,6 +1246,254 @@ const auto dummy_test_model_all_inputs_as_internal_3 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_3() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126, -125}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_3 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_3", get_test_model_all_tensors_as_inputs_3()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output2 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126, -125}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input2_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_3 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_3", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_3()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_4() { static TestModel model = { .expectFailure = false, @@ -954,7 +1698,7 @@ const TestModel& get_test_model_all_inputs_as_internal_4() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy3 + }, { // dummy6 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -964,7 +1708,7 @@ const TestModel& get_test_model_all_inputs_as_internal_4() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param3 + }, { // param6 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -998,6 +1742,254 @@ const auto dummy_test_model_all_inputs_as_internal_4 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_4() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126, -125}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_4 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_4", get_test_model_all_tensors_as_inputs_4()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_4() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output3 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126, -125}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input3_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_4 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_4", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_4()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_5() { static TestModel model = { .expectFailure = false, @@ -1202,7 +2194,7 @@ const TestModel& get_test_model_all_inputs_as_internal_5() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy4 + }, { // dummy8 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -1212,7 +2204,7 @@ const TestModel& get_test_model_all_inputs_as_internal_5() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param4 + }, { // param8 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1246,6 +2238,254 @@ const auto dummy_test_model_all_inputs_as_internal_5 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_5() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_5 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_5", get_test_model_all_tensors_as_inputs_5()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_5() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-5}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output4 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input4_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_5 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_5", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_5()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_6() { static TestModel model = { .expectFailure = false, @@ -1450,7 +2690,7 @@ const TestModel& get_test_model_all_inputs_as_internal_6() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy5 + }, { // dummy10 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -1460,7 +2700,7 @@ const TestModel& get_test_model_all_inputs_as_internal_6() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param5 + }, { // param10 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1494,6 +2734,254 @@ const auto dummy_test_model_all_inputs_as_internal_6 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_6() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_6 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_6", get_test_model_all_tensors_as_inputs_6()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_6() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-2}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output5 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input5_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy11 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param11 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_6 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_6", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_6()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_7() { static TestModel model = { .expectFailure = false, @@ -1698,7 +3186,7 @@ const TestModel& get_test_model_all_inputs_as_internal_7() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy6 + }, { // dummy12 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -1708,7 +3196,7 @@ const TestModel& get_test_model_all_inputs_as_internal_7() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param6 + }, { // param12 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1742,6 +3230,254 @@ const auto dummy_test_model_all_inputs_as_internal_7 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_7() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_7 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_7", get_test_model_all_tensors_as_inputs_7()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_7() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output6 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input6_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy13 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param13 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_7 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_7", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_7()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_8() { static TestModel model = { .expectFailure = false, @@ -1946,7 +3682,7 @@ const TestModel& get_test_model_all_inputs_as_internal_8() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy7 + }, { // dummy14 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -1956,7 +3692,7 @@ const TestModel& get_test_model_all_inputs_as_internal_8() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param7 + }, { // param14 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -1990,6 +3726,254 @@ const auto dummy_test_model_all_inputs_as_internal_8 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_8() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126, -125, -124}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_8 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_8", get_test_model_all_tensors_as_inputs_8()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_8() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({3}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output7 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-126, -125, -124}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input7_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy15 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param15 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_8 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_8", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_8()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_9() { static TestModel model = { .expectFailure = false, @@ -2194,7 +4178,7 @@ const TestModel& get_test_model_all_inputs_as_internal_9() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy8 + }, { // dummy16 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -2204,7 +4188,7 @@ const TestModel& get_test_model_all_inputs_as_internal_9() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param8 + }, { // param16 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -2238,6 +4222,254 @@ const auto dummy_test_model_all_inputs_as_internal_9 = TestModelManager::get().a namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_9() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-125, -126, -127}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_9 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_9", get_test_model_all_tensors_as_inputs_9()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_9() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-4}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({-1}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output8 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-125, -126, -127}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input8_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125}), + .dimensions = {3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy17 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param17 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_9 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_9", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_9()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_10() { static TestModel model = { .expectFailure = false, @@ -2442,7 +4674,7 @@ const TestModel& get_test_model_all_inputs_as_internal_10() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy9 + }, { // dummy18 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -2452,7 +4684,7 @@ const TestModel& get_test_model_all_inputs_as_internal_10() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param9 + }, { // param18 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -2486,6 +4718,254 @@ const auto dummy_test_model_all_inputs_as_internal_10 = TestModelManager::get(). namespace generated_tests::strided_slice_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs_10() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-122, -123, -124}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_10 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_10", get_test_model_all_tensors_as_inputs_10()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_10() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -4}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, -1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output9 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-122, -123, -124}), + .dimensions = {1, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input9_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy19 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param19 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_10 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_10", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_10()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + const TestModel& get_test_model_11() { static TestModel model = { .expectFailure = false, @@ -2690,7 +5170,7 @@ const TestModel& get_test_model_all_inputs_as_internal_11() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy10 + }, { // dummy20 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -2700,7 +5180,7 @@ const TestModel& get_test_model_all_inputs_as_internal_11() { .scale = 1.0f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param10 + }, { // param20 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, @@ -2732,3 +5212,251 @@ const auto dummy_test_model_all_inputs_as_internal_11 = TestModelManager::get(). } // namespace generated_tests::strided_slice_quant8_signed +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_11() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1, 2, 3}, + .operands = {{ // input10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -124, -123}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_11 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_11", get_test_model_all_tensors_as_inputs_11()); + +} // namespace generated_tests::strided_slice_quant8_signed + +namespace generated_tests::strided_slice_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal_11() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 2, 3, 8}, + .operands = {{ // input10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // begins10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 0}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // ends10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 2}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // strides10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1, 1}), + .dimensions = {2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // beginMask10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({1}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // endMask10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // shrinkAxisMask10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }, { // output10 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -124, -123}), + .dimensions = {2, 2}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input10_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-127, -126, -125, -124, -123, -122}), + .dimensions = {2, 3}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy21 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param21 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {8, 9, 10}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1, 2, 3, 4, 5, 6}, + .outputs = {7}, + .type = TestOperationType::STRIDED_SLICE + }}, + .outputIndexes = {7} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal_11 = TestModelManager::get().add("strided_slice_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal_11", get_test_model_all_tensors_as_inputs_all_inputs_as_internal_11()); + +} // namespace generated_tests::strided_slice_quant8_signed + diff --git a/nn/runtime/test/generated/spec_V1_3/transpose_quant8_signed.example.cpp b/nn/runtime/test/generated/spec_V1_3/transpose_quant8_signed.example.cpp index 3c96df06f..c3bd71a6b 100644 --- a/nn/runtime/test/generated/spec_V1_3/transpose_quant8_signed.example.cpp +++ b/nn/runtime/test/generated/spec_V1_3/transpose_quant8_signed.example.cpp @@ -29336,6 +29336,154 @@ const auto dummy_test_model_all_inputs_as_internal = TestModelManager::get().add namespace generated_tests::transpose_quant8_signed { +const TestModel& get_test_model_all_tensors_as_inputs() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {0, 1}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({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, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({0, 1, 2, 3, 4, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 60, 61, 62, 63, 64, 80, 81, 82, 83, 84, 100, 101, 102, 103, 104, 5, 6, 7, 8, 9, 25, 26, 27, 28, 29, 45, 46, 47, 48, 49, 65, 66, 67, 68, 69, 85, 86, 87, 88, 89, 105, 106, 107, 108, 109, 10, 11, 12, 13, 14, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 70, 71, 72, 73, 74, 90, 91, 92, 93, 94, 110, 111, 112, 113, 114, 15, 16, 17, 18, 19, 35, 36, 37, 38, 39, 55, 56, 57, 58, 59, 75, 76, 77, 78, 79, 95, 96, 97, 98, 99, 115, 116, 117, 118, 119}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }}, + .operations = {{ + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs = TestModelManager::get().add("transpose_quant8_signed_all_tensors_as_inputs", get_test_model_all_tensors_as_inputs()); + +} // namespace generated_tests::transpose_quant8_signed + +namespace generated_tests::transpose_quant8_signed { + +const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() { + static TestModel model = { + .expectFailure = false, + .expectedMultinomialDistributionTolerance = 0, + .isRelaxed = false, + .main = { + .inputIndexes = {1, 3}, + .operands = {{ // input + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // perms + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({2, 0, 1, 3}), + .dimensions = {4}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::TENSOR_INT32, + .zeroPoint = 0 + }, { // output + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({0, 1, 2, 3, 4, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 60, 61, 62, 63, 64, 80, 81, 82, 83, 84, 100, 101, 102, 103, 104, 5, 6, 7, 8, 9, 25, 26, 27, 28, 29, 45, 46, 47, 48, 49, 65, 66, 67, 68, 69, 85, 86, 87, 88, 89, 105, 106, 107, 108, 109, 10, 11, 12, 13, 14, 30, 31, 32, 33, 34, 50, 51, 52, 53, 54, 70, 71, 72, 73, 74, 90, 91, 92, 93, 94, 110, 111, 112, 113, 114, 15, 16, 17, 18, 19, 35, 36, 37, 38, 39, 55, 56, 57, 58, 59, 75, 76, 77, 78, 79, 95, 96, 97, 98, 99, 115, 116, 117, 118, 119}), + .dimensions = {4, 2, 3, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_OUTPUT, + .numberOfConsumers = 0, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // input_new + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({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, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119}), + .dimensions = {2, 3, 4, 5}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // dummy120 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int8_t>({-128}), + .dimensions = {1}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 1.0f, + .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, + .zeroPoint = -128 + }, { // param200 + .channelQuant = {}, + .data = TestBuffer::createFromVector<int32_t>({0}), + .dimensions = {}, + .isIgnored = false, + .lifetime = TestOperandLifeTime::CONSTANT_COPY, + .numberOfConsumers = 1, + .scale = 0.0f, + .type = TestOperandType::INT32, + .zeroPoint = 0 + }}, + .operations = {{ + .inputs = {3, 4, 5}, + .outputs = {0}, + .type = TestOperationType::ADD + }, { + .inputs = {0, 1}, + .outputs = {2}, + .type = TestOperationType::TRANSPOSE + }}, + .outputIndexes = {2} + }, + .minSupportedVersion = TestHalVersion::V1_3, + .referenced = {} + }; + return model; +} + +const auto dummy_test_model_all_tensors_as_inputs_all_inputs_as_internal = TestModelManager::get().add("transpose_quant8_signed_all_tensors_as_inputs_all_inputs_as_internal", get_test_model_all_tensors_as_inputs_all_inputs_as_internal()); + +} // namespace generated_tests::transpose_quant8_signed + +namespace generated_tests::transpose_quant8_signed { + const TestModel& get_test_model_quant8_signed_2() { static TestModel model = { .expectFailure = false, @@ -29440,7 +29588,7 @@ const TestModel& get_test_model_quant8_signed_all_inputs_as_internal_2() { .scale = 0.5f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // dummy120 + }, { // dummy121 .channelQuant = {}, .data = TestBuffer::createFromVector<int8_t>({-128}), .dimensions = {1}, @@ -29450,7 +29598,7 @@ const TestModel& get_test_model_quant8_signed_all_inputs_as_internal_2() { .scale = 0.5f, .type = TestOperandType::TENSOR_QUANT8_ASYMM_SIGNED, .zeroPoint = -128 - }, { // param200 + }, { // param201 .channelQuant = {}, .data = TestBuffer::createFromVector<int32_t>({0}), .dimensions = {}, diff --git a/nn/runtime/test/specs/V1_0/reshape_quant8_weights_as_inputs.mod.py b/nn/runtime/test/specs/V1_0/reshape_quant8_weights_as_inputs.mod.py index d1edd5685..1561fea1d 100644 --- a/nn/runtime/test/specs/V1_0/reshape_quant8_weights_as_inputs.mod.py +++ b/nn/runtime/test/specs/V1_0/reshape_quant8_weights_as_inputs.mod.py @@ -1,5 +1,19 @@ -# TODO: Re-enable after b/140641425 is addressed. -""" +# +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + # model model = Model() # a line of 3 pixels, 3 components/pixel @@ -21,4 +35,3 @@ output0 = {i3: # output 0 # Instantiate an example Example((input0, output0)) -""" diff --git a/nn/runtime/test/specs/V1_0/reshape_weights_as_inputs.mod.py b/nn/runtime/test/specs/V1_0/reshape_weights_as_inputs.mod.py index 00b2c569d..6a31968f6 100644 --- a/nn/runtime/test/specs/V1_0/reshape_weights_as_inputs.mod.py +++ b/nn/runtime/test/specs/V1_0/reshape_weights_as_inputs.mod.py @@ -1,5 +1,19 @@ -# TODO: Re-enable after b/140641425 is addressed. -""" +# +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + # model model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{1, 1, 3, 3}") # a line of 3 pixels, 3 components/pixel @@ -20,4 +34,3 @@ output0 = {i3: # output 0 # Instantiate an example Example((input0, output0)) -""" diff --git a/nn/runtime/test/specs/V1_1/reshape_weights_as_inputs_relaxed.mod.py b/nn/runtime/test/specs/V1_1/reshape_weights_as_inputs_relaxed.mod.py index 8564034b7..c265b4c4a 100644 --- a/nn/runtime/test/specs/V1_1/reshape_weights_as_inputs_relaxed.mod.py +++ b/nn/runtime/test/specs/V1_1/reshape_weights_as_inputs_relaxed.mod.py @@ -14,8 +14,6 @@ # limitations under the License. # -# TODO: Re-enable after b/140641425 is addressed. -""" # model model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{1, 1, 3, 3}") # a line of 3 pixels, 3 components/pixel @@ -37,4 +35,3 @@ output0 = {i3: # output 0 # Instantiate an example Example((input0, output0)) -""" diff --git a/nn/runtime/test/specs/V1_2/strided_slice_invalid_output_dims.mod.py b/nn/runtime/test/specs/V1_2/strided_slice_invalid.mod.py index 76d2179d7..17a828f92 100644 --- a/nn/runtime/test/specs/V1_2/strided_slice_invalid_output_dims.mod.py +++ b/nn/runtime/test/specs/V1_2/strided_slice_invalid.mod.py @@ -14,28 +14,27 @@ # limitations under the License. # -# TODO: Move this spec to V1_3 directory? -# -# This test makes sure that executing STRIDED_SLICE results in a failure when -# the output dimensions do not match shrinkAxisMask. -# # Based on strided_slice_float_11.mod.py. -model = Model() +# This test makes sure that executing STRIDED_SLICE results in a failure when +# the deduced output dimension is not one and shrinkAxisMask is set. +# See http://b/79856511#comment2. i1 = Input("input", "TENSOR_FLOAT32", "{2, 3}") -begins = Parameter("begins", "TENSOR_INT32", "{2}", [0, 0]) -# The value "2" below makes the test invalid. See http://b/79856511#comment2. -ends = Parameter("ends", "TENSOR_INT32", "{2}", [2, 3]) -strides = Parameter("strides", "TENSOR_INT32", "{2}", [1, 1]) -beginMask = Int32Scalar("beginMask", 0) -endMask = Int32Scalar("endMask", 0) -shrinkAxisMask = Int32Scalar("shrinkAxisMask", 1) - output = Output("output", "TENSOR_FLOAT32", "{3}") +Model("output_dims").Operation("STRIDED_SLICE", i1, [0, 0], [2, 3], [1, 1], 0, 0, 1).To(output) +Example({ + i1: [1, 2, 3, 4, 5, 6], + output: [1, 2, 3], +}).ExpectFailure() -model = model.Operation("STRIDED_SLICE", i1, begins, ends, strides, beginMask, endMask, shrinkAxisMask).To(output) +# This test makes sure that executing STRIDED_SLICE results in a failure when +# the stride is negative and shrinkAxisMask is set. +# See http://b/154639297#comment11. +i1 = Input("input", "TENSOR_FLOAT32", "{2, 3}") +output = Output("output", "TENSOR_FLOAT32", "{3}") +Model("neg_stride").Operation("STRIDED_SLICE", i1, [1, 0], [0, 3], [-1, 1], 0, 0, 1).To(output) Example({ i1: [1, 2, 3, 4, 5, 6], - output: [1, 2, 3], + output: [4, 5, 6], }).ExpectFailure() |