44 BOOST_ASSERT(inputShapes.size() == 1);
61 outputShape[heightIndex] =
63 outputShape[widthIndex] =
66 return std::vector<TensorShape>({ outputShape });
76 BOOST_ASSERT(inferredShapes.size() == 1);
78 ConditionalThrowIfNotEqual<LayerValidationException>(
79 "SpaceToBatchNdLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.",
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, otherwise infers the output shapes from given input shapes and layer properties.
SpaceToBatchNdDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
const SpaceToBatchNdDescriptor & GetParameters() const
unsigned int GetWidthIndex() const
const TensorShape & GetShape() const
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of SpaceToBatchNdLayer.
Copyright (c) 2020 ARM Limited.
void IgnoreUnused(Ts &&...)
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding values for the input dimension: heightPad{top, bottom} widthPad{left, right}.
This layer represents a SpaceToBatchNd operation.
LayerDescriptor m_Parameters
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the SpaceToBatchNd type.
unsigned int GetHeightIndex() const
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
virtual std::unique_ptr< IWorkload > CreateSpaceToBatchNd(const SpaceToBatchNdQueueDescriptor &descriptor, const WorkloadInfo &info) const
Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout...
std::vector< unsigned int > m_BlockShape
Block shape value.
void SpaceToBatchNd(const TensorInfo &inputInfo, const TensorInfo &outputInfo, const SpaceToBatchNdDescriptor ¶ms, Decoder< float > &inputData, Encoder< float > &outputData)
SpaceToBatchNdLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
SpaceToBatchNdLayer(const SpaceToBatchNdDescriptor param, const char *name)
Constructor to create a SpaceToBatchNdLayer.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
virtual const TensorInfo & GetTensorInfo() const =0
const char * GetName() const override
Returns the name of the layer.
virtual void VisitSpaceToBatchNdLayer(const IConnectableLayer *layer, const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr)=0
Function a space to batch layer should call back to when its Accept(ILayerVisitor&) function is invok...
void Accept(ILayerVisitor &visitor) const override
Apply a visitor to this layer.
const TensorInfo & GetTensorInfo() const override