31 auto layer = CloneBase<ConstantLayer>(graph,
GetName());
35 return std::move(layer);
40 return std::vector<TensorShape>({ inputShapes[0] });
47 ConditionalThrowIfNotEqual<LayerValidationException>(
48 "ConstantLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.",
const char * GetName() const override
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
virtual std::unique_ptr< IWorkload > CreateConstant(const ConstantQueueDescriptor &descriptor, const WorkloadInfo &info) const
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
const ConstCpuTensorHandle * m_LayerOutput
virtual void VisitConstantLayer(const IConnectableLayer *layer, const ConstTensor &input, const char *name=nullptr)=0
void Accept(ILayerVisitor &visitor) const override
ConstantLayer * Clone(Graph &graph) const override
std::unique_ptr< ScopedCpuTensorHandle > m_LayerOutput
A layer that the constant data can be bound to.
void ValidateTensorShapesFromInputs() override
ConstantLayer(const char *name)
const TensorShape & GetShape() const
const TensorInfo & GetTensorInfo() const override
const OutputSlot & GetOutputSlot(unsigned int index=0) const override