diff options
author | Jim Flynn <jim.flynn@arm.com> | 2020-03-19 17:03:14 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-03-19 17:03:14 +0000 |
commit | 0e2bab81442ee6cc2b94e4f7881ed0c5c6af65e7 (patch) | |
tree | b0af08b5a0b74149fca422151127ac6310385399 /src/armnn/layers/ConstantLayer.cpp | |
parent | 8c3259fa007d43fcc5ea56fe6928526dbe79f3c0 (diff) | |
download | armnn-0e2bab81442ee6cc2b94e4f7881ed0c5c6af65e7.tar.gz |
Creating gh-pages documentation for ArmNN
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/armnn/layers/ConstantLayer.cpp')
-rw-r--r-- | src/armnn/layers/ConstantLayer.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/armnn/layers/ConstantLayer.cpp b/src/armnn/layers/ConstantLayer.cpp deleted file mode 100644 index 136616c204..0000000000 --- a/src/armnn/layers/ConstantLayer.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// -#include "ConstantLayer.hpp" -#include "LayerCloneBase.hpp" - -#include <armnn/TypesUtils.hpp> -#include <backendsCommon/CpuTensorHandle.hpp> -#include <backendsCommon/WorkloadData.hpp> -#include <backendsCommon/WorkloadFactory.hpp> - -namespace armnn -{ - -ConstantLayer::ConstantLayer(const char* name) - : Layer(0, 1, LayerType::Constant, name) -{ -} - -std::unique_ptr<IWorkload> ConstantLayer::CreateWorkload(const IWorkloadFactory& factory) const -{ - ConstantQueueDescriptor descriptor; - descriptor.m_LayerOutput = m_LayerOutput.get(); - return factory.CreateConstant(descriptor, PrepInfoAndDesc(descriptor)); -} - -ConstantLayer* ConstantLayer::Clone(Graph& graph) const -{ - // Cloned layers share the same layer output object. - auto layer = CloneBase<ConstantLayer>(graph, GetName()); - - layer->m_LayerOutput = m_LayerOutput ? std::make_unique<ScopedCpuTensorHandle>(*m_LayerOutput) : nullptr; - - return std::move(layer); -} - -std::vector<TensorShape> ConstantLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const -{ - return std::vector<TensorShape>({ inputShapes[0] }); -} - -void ConstantLayer::ValidateTensorShapesFromInputs() -{ - // Get the output shape from the value of the constant layer. - TensorShape const& outShape = m_LayerOutput->GetTensorInfo().GetShape(); - ConditionalThrowIfNotEqual<LayerValidationException>( - "ConstantLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", - GetOutputSlot(0).GetTensorInfo().GetShape(), - outShape); -} - -void ConstantLayer::Accept(ILayerVisitor& visitor) const -{ - ConstTensor layerOutputTensor(m_LayerOutput->GetTensorInfo(), m_LayerOutput->Map(true)) ; - visitor.VisitConstantLayer(this, layerOutputTensor, GetName()); -} - -} // namespace armnn |