12 class ScopedTensorHandle;
37 std::vector<TensorShape>
InferOutputShapes(
const std::vector<TensorShape>& inputShapes)
const override;
A layer that the constant data can be bound to.
ConstantLayer(const char *name)
Constructor to create a ConstantLayer.
~ConstantLayer()=default
Default destructor.
void SerializeLayerParameters(ParameterStringifyFunction &fn) const override
Helper to serialize the layer parameters to string.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
void ReleaseConstantData() override
Free up the constant source data stored by the layer.
ConstantLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs,...
ImmutableConstantTensors GetConstantTensorsByRef() const override
Retrieve the handles to the constant values stored by the layer.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ConstantLayer.
std::shared_ptr< ConstTensorHandle > m_LayerOutput
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Constant type.
std::vector< std::reference_wrapper< const std::shared_ptr< ConstTensorHandle > >> ImmutableConstantTensors
Copyright (c) 2021 ARM Limited and Contributors.
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction