diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2018-12-13 12:48:25 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2018-12-14 11:34:52 +0000 |
commit | 59a950cefe927d002aa00d7c3af54f4389e00162 (patch) | |
tree | e5152463ef83a1ef42a6f44f17bc9c40b8eacde7 /src/armnn/layers/ArithmeticBaseLayer.cpp | |
parent | 20e984f442483493ece882c3040785368eb31c96 (diff) | |
download | armnn-59a950cefe927d002aa00d7c3af54f4389e00162.tar.gz |
IVGCVSW-2377 Add no-op factory implementations for all backends for the
Greater operation
* Added QueueDescriptor in WorkloadData.hpp
* Added CreateGreater function in WorkloadFactory.hpp
* Added stub implementation of the CreateGreater function in RefWorkloadFactory,
NeonWorkloadFactory and ClWorkloadFactory
* Added GreaterLayer stub implementation
* Renamed ArithmeticBaseLayer to ElementwiseBaseLayer
Change-Id: I7e38c2936de905da921a92ba3f918478169ec7f5
Diffstat (limited to 'src/armnn/layers/ArithmeticBaseLayer.cpp')
-rw-r--r-- | src/armnn/layers/ArithmeticBaseLayer.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/armnn/layers/ArithmeticBaseLayer.cpp b/src/armnn/layers/ArithmeticBaseLayer.cpp deleted file mode 100644 index 3b89c229c3..0000000000 --- a/src/armnn/layers/ArithmeticBaseLayer.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// -#include "ArithmeticBaseLayer.hpp" - -#include "InternalTypes.hpp" -#include "armnn/Exceptions.hpp" -#include <armnn/TypesUtils.hpp> - -#include <boost/assert.hpp> - -namespace armnn -{ - -ArithmeticBaseLayer::ArithmeticBaseLayer(unsigned int numInputSlots, unsigned int numOutputSlots, - LayerType type, const char* name) - : Layer(numInputSlots, numOutputSlots, type, name) -{ -} - -std::vector<TensorShape> ArithmeticBaseLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const -{ - BOOST_ASSERT(inputShapes.size() == 2); - auto& input0 = inputShapes[0]; - auto& input1 = inputShapes[1]; - - // Get the max of the inputs. - BOOST_ASSERT(input0.GetNumDimensions() == input1.GetNumDimensions()); - unsigned int numDims = input0.GetNumDimensions(); - std::vector<unsigned int> dims(numDims); - - for (unsigned int i = 0; i < numDims; i++) - { - unsigned int dim0 = input0[i]; - unsigned int dim1 = input1[i]; - -#if !NDEBUG - // Validate inputs are broadcast compatible. - BOOST_ASSERT_MSG(dim0 == dim1 || dim0 == 1 || dim1 == 1, - "Dimensions should either match or one should be of size 1."); -#endif - - dims[i] = std::max(dim0, dim1); - } - - return std::vector<TensorShape>({ TensorShape(numDims, dims.data()) }); -} - -void ArithmeticBaseLayer::ValidateTensorShapesFromInputs() -{ - VerifyLayerConnections(2, CHECK_LOCATION()); - - auto inferredShapes = InferOutputShapes({ - GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape(), - GetInputSlot(1).GetConnection()->GetTensorInfo().GetShape() - }); - - BOOST_ASSERT(inferredShapes.size() == 1); - - std::string msg = GetLayerTypeAsCString(GetType()); - msg += "Layer: TensorShape set on OutputSlot[0] does not match the inferred shape."; - ConditionalThrowIfNotEqual<LayerValidationException>(msg, - GetOutputSlot(0).GetTensorInfo().GetShape(), - inferredShapes[0]); -} - -} // namespace armnn |