biasTensorInfo = armnn::TensorInfo(armnn::TensorShape({1}), GetDataType(tfLiteInputTensor));
}
+ std::vector<uint8_t> swizzledData(filterTensorInfo.GetNumBytes());
+ auto filter =
+ CreateConstTensor(&tfLiteFilterTensor,
+ filterTensorInfo,
+ armnn::Optional<armnn::PermutationVector&>(permutationVector),
+ swizzledData.data());
+
if (!delegateData.m_Network)
{
bool isSupported = false;
inputTensorInfo,
outputTensorInfo,
descriptor,
- filterTensorInfo,
+ filter.GetInfo(),
armnn::Optional<armnn::TensorInfo>(biasTensorInfo));
return isSupported ? kTfLiteOk : kTfLiteError;
}
armnn::IConnectableLayer* layer = nullptr;
- std::vector<uint8_t> swizzledData(filterTensorInfo.GetNumBytes());
- auto filter =
- CreateConstTensor(&tfLiteFilterTensor,
- filterTensorInfo,
- armnn::Optional<armnn::PermutationVector&>(permutationVector),
- swizzledData.data());
+
if(biasEnabled)
{
auto biases =
for (int i=0; i < reshapeOptions->num_dimensions; ++i)
{
targetShape.push_back(reshapeOptions->shape[i]);
- elementCounter = elementCounter * reshapeOptions->shape[i];
+ if (reshapeOptions->shape[i] > 0)
+ {
+ elementCounter = elementCounter * reshapeOptions->shape[i];
+ }
}
// Check the number of elements match, otherwise fall back to using the second input tensor.
- if (elementCounter == inputTensorInfo0.GetNumElements())
+ if (elementCounter <= inputTensorInfo0.GetNumElements())
{
targetShapeFound = true;
}
DivBroadcastTest(backends);
}
-TEST_CASE ("DIV_UINT8_GpuAcc_Test")
-{
- std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc };
- DivUint8Test(backends);
-}
-
TEST_CASE ("MAX_FP32_GpuAcc_Test")
{
std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc };
DivBroadcastTest(backends);
}
-TEST_CASE ("DIV_UINT8_CpuAcc_Test")
-{
- std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc };
- DivUint8Test(backends);
-}
-
TEST_CASE ("MAX_FP32_CpuAcc_Test")
{
std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc };
ElementwiseUnaryFP32Test(tflite::BuiltinOperator_RSQRT, backends, inputValues, expectedOutputValues);
}
-TEST_CASE ("Sqrt_Float32_GpuAcc_Test")
-{
- // Create the ArmNN Delegate
- std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc };
- // Set input data
- std::vector<float> inputValues
- {
- 9.0f, 4.25f, 81.9f,
- 0.1f, 0.9f, 169.0f
- };
- // Calculate output data
- std::vector<float> expectedOutputValues(inputValues.size());
- for (unsigned int i = 0; i < inputValues.size(); ++i)
- {
- expectedOutputValues[i] = std::sqrt(inputValues[i]);
- }
-
- ElementwiseUnaryFP32Test(tflite::BuiltinOperator_SQRT, backends, inputValues, expectedOutputValues);
-}
-
} // TEST_SUITE("ElementwiseUnary_GpuAccTests")
ElementwiseUnaryFP32Test(tflite::BuiltinOperator_RSQRT, backends, inputValues, expectedOutputValues);
}
-TEST_CASE ("Sqrt_Float32_CpuAcc_Test")
-{
- std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc };
- // Set input data
- std::vector<float> inputValues
- {
- 9.0f, 4.25f, 81.9f,
- 0.1f, 0.9f, 169.0f
- };
- // Calculate output data
- std::vector<float> expectedOutputValues(inputValues.size());
- for (unsigned int i = 0; i < inputValues.size(); ++i)
- {
- expectedOutputValues[i] = std::sqrt(inputValues[i]);
- }
-
- ElementwiseUnaryFP32Test(tflite::BuiltinOperator_SQRT, backends, inputValues, expectedOutputValues);
-}
-
} // TEST_SUITE("ElementwiseUnary_CpuAccTests")
-
TEST_SUITE("ElementwiseUnary_CpuRefTests")
{