// // Copyright © 2017 Arm Ltd. All rights reserved. // See LICENSE file in the project root for full license information. // #include "MemCopyLayer.hpp" #include "LayerCloneBase.hpp" #include #include #include namespace armnn { MemCopyLayer::MemCopyLayer(const char* name) : Layer(1, 1, LayerType::MemCopy, name) { } MemCopyLayer* MemCopyLayer::Clone(Graph& graph) const { return CloneBase(graph, GetName()); } std::unique_ptr MemCopyLayer::CreateWorkload(const Graph& graph, const IWorkloadFactory& factory) const { MemCopyQueueDescriptor descriptor; return factory.CreateMemCopy(descriptor, PrepInfoAndDesc(descriptor, graph)); } void MemCopyLayer::ValidateTensorShapesFromInputs() { ConditionalThrow(GetInputSlot(0).GetConnection() != nullptr, "MemCopyLayer: InputSlot must be connected to an OutputSlot"); ConditionalThrow(GetInputSlot(0).GetConnection()->IsTensorInfoSet(), "MemCopyLayer: TensorInfo must be set on connected OutputSlot."); IOutputSlot* input = GetInputSlot(0).GetConnection(); ConditionalThrowIfNotEqual( "MemCopyLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", GetOutputSlot(0).GetTensorInfo().GetShape(), input->GetTensorInfo().GetShape()); } } // namespace armnn