2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
12 class ScopedCpuTensorHandle;
14 class ConstantLayer : public Layer
17 virtual std::unique_ptr<IWorkload> CreateWorkload(const Graph& graph,
18 const IWorkloadFactory& factory) const override;
20 ConstantLayer* Clone(Graph& graph) const override;
22 void ValidateTensorShapesFromInputs() override;
24 std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
26 // Free up the constant source data
27 void ReleaseConstantData() override {};
29 std::unique_ptr<ScopedCpuTensorHandle> m_LayerOutput;
31 ConstantLayer(const char* name);
32 ~ConstantLayer() = default;
34 ConstantTensors GetConstantTensorsByRef() override { return {m_LayerOutput}; }