Compute Library
 23.08
PadStrideInfo Class Reference

#include <CoreTypes.h>

Public Member Functions

 PadStrideInfo (unsigned int stride_x=1, unsigned int stride_y=1, unsigned int pad_x=0, unsigned int pad_y=0, DimensionRoundingType round=DimensionRoundingType::FLOOR)
 Constructor. More...
 
 PadStrideInfo (unsigned int stride_x, unsigned int stride_y, unsigned int pad_left, unsigned int pad_right, unsigned int pad_top, unsigned int pad_bottom, DimensionRoundingType round)
 Constructor. More...
 
std::pair< unsigned int, unsigned int > stride () const
 Get the stride. More...
 
bool padding_is_symmetric () const
 Check whether the padding is symmetric. More...
 
std::pair< unsigned int, unsigned int > pad () const
 Get the padding. More...
 
unsigned int pad_left () const
 Get the left padding. More...
 
unsigned int pad_right () const
 Get the right padding. More...
 
unsigned int pad_top () const
 Get the top padding. More...
 
unsigned int pad_bottom () const
 Get the bottom padding. More...
 
DimensionRoundingType round () const
 Get the rounding type. More...
 
bool has_padding () const
 Check whether this has any padding. More...
 

Detailed Description

Definition at line 138 of file CoreTypes.h.

Constructor & Destructor Documentation

◆ PadStrideInfo() [1/2]

PadStrideInfo ( unsigned int  stride_x = 1,
unsigned int  stride_y = 1,
unsigned int  pad_x = 0,
unsigned int  pad_y = 0,
DimensionRoundingType  round = DimensionRoundingType::FLOOR 
)
inline

Constructor.

Parameters
[in]stride_x(Optional) Stride, in elements, across x. Defaults to 1.
[in]stride_y(Optional) Stride, in elements, across y. Defaults to 1.
[in]pad_x(Optional) Padding, in elements, across x. Defaults to 0.
[in]pad_y(Optional) Padding, in elements, across y. Defaults to 0.
[in]round(Optional) Dimensions rounding. Defaults to DimensionRoundingType::FLOOR.

Definition at line 149 of file CoreTypes.h.

152  : _stride(std::make_pair(stride_x, stride_y)),
153  _pad_left(pad_x),
154  _pad_top(pad_y),
155  _pad_right(pad_x),
156  _pad_bottom(pad_y),
157  _round_type(round)
158  {
159  }

◆ PadStrideInfo() [2/2]

PadStrideInfo ( unsigned int  stride_x,
unsigned int  stride_y,
unsigned int  pad_left,
unsigned int  pad_right,
unsigned int  pad_top,
unsigned int  pad_bottom,
DimensionRoundingType  round 
)
inline

Constructor.

Parameters
[in]stride_xStride, in elements, across x.
[in]stride_yStride, in elements, across y.
[in]pad_leftPadding across x on the left, in elements.
[in]pad_rightPadding across x on the right, in elements.
[in]pad_topPadding across y on the top, in elements.
[in]pad_bottomPadding across y on the bottom, in elements.
[in]roundDimensions rounding.

Definition at line 170 of file CoreTypes.h.

174  : _stride(std::make_pair(stride_x, stride_y)),
175  _pad_left(pad_left),
176  _pad_top(pad_top),
177  _pad_right(pad_right),
178  _pad_bottom(pad_bottom),
179  _round_type(round)
180  {
181  }

Member Function Documentation

◆ has_padding()

bool has_padding ( ) const
inline

Check whether this has any padding.

Definition at line 239 of file CoreTypes.h.

240  {
241  return (_pad_left != 0 || _pad_top != 0 || _pad_right != 0 || _pad_bottom != 0);
242  }

Referenced by arm_compute::cpu::poolingMxN_fp32_neon_nhwc().

◆ pad()

std::pair<unsigned int, unsigned int> pad ( ) const
inline

Get the padding.

Note
This should only be used when the padding is symmetric.
Returns
a pair: padding left/right, padding top/bottom

Definition at line 204 of file CoreTypes.h.

205  {
206  //this accessor should be used only when padding is symmetric
208  return std::make_pair(_pad_left, _pad_top);
209  }

References ARM_COMPUTE_ERROR_ON, and PadStrideInfo::padding_is_symmetric().

◆ pad_bottom()

◆ pad_left()

◆ pad_right()

◆ pad_top()

◆ padding_is_symmetric()

bool padding_is_symmetric ( ) const
inline

Check whether the padding is symmetric.

Returns
True if the padding is symmetric.

Definition at line 194 of file CoreTypes.h.

195  {
196  return (_pad_left == _pad_right) && (_pad_top == _pad_bottom);
197  }

Referenced by PadStrideInfo::pad().

◆ round()

DimensionRoundingType round ( ) const
inline

Get the rounding type.

Definition at line 233 of file CoreTypes.h.

234  {
235  return _round_type;
236  }

Referenced by arm_compute::scaled_dimensions(), and arm_compute::scaled_dimensions_signed().

◆ stride()


The documentation for this class was generated from the following file:
arm_compute::PadStrideInfo::pad_right
unsigned int pad_right() const
Get the right padding.
Definition: CoreTypes.h:217
arm_compute::PadStrideInfo::round
DimensionRoundingType round() const
Get the rounding type.
Definition: CoreTypes.h:233
arm_compute::PadStrideInfo::padding_is_symmetric
bool padding_is_symmetric() const
Check whether the padding is symmetric.
Definition: CoreTypes.h:194
ARM_COMPUTE_ERROR_ON
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:467
arm_compute::PadStrideInfo::pad_left
unsigned int pad_left() const
Get the left padding.
Definition: CoreTypes.h:212
arm_compute::PadStrideInfo::pad_bottom
unsigned int pad_bottom() const
Get the bottom padding.
Definition: CoreTypes.h:227
arm_compute::PadStrideInfo::pad_top
unsigned int pad_top() const
Get the top padding.
Definition: CoreTypes.h:222