Compute Library
 19.08
ValidRegion Struct Reference

Container for valid region of a window. More...

#include <Types.h>

Collaboration diagram for ValidRegion:
[legend]

Public Member Functions

 ValidRegion ()
 Default constructor. More...
 
 ValidRegion (const ValidRegion &)=default
 Allow instances of this class to be copy constructed. More...
 
 ValidRegion (ValidRegion &&)=default
 Allow instances of this class to be move constructed. More...
 
ValidRegionoperator= (const ValidRegion &)=default
 Allow instances of this class to be copied. More...
 
ValidRegionoperator= (ValidRegion &&)=default
 Allow instances of this class to be moved. More...
 
 ~ValidRegion ()=default
 Default destructor. More...
 
 ValidRegion (const Coordinates &an_anchor, const TensorShape &a_shape)
 Constructor for a valid region with default number of dimensions. More...
 
 ValidRegion (const Coordinates &an_anchor, const TensorShape &a_shape, size_t num_dimensions)
 Constructor for a valid region with specified number of dimensions. More...
 
int start (unsigned int d) const
 Return the start of the valid region for the given dimension d. More...
 
int end (unsigned int d) const
 Return the end of the valid region for the given dimension d. More...
 
ValidRegionset (size_t dimension, int start, size_t size)
 Accessor to set the value of anchor and shape for one of the dimensions. More...
 

Data Fields

Coordinates anchor
 Anchor for the start of the valid region. More...
 
TensorShape shape
 Shape of the valid region. More...
 

Detailed Description

Container for valid region of a window.

Definition at line 174 of file Types.h.

Constructor & Destructor Documentation

◆ ValidRegion() [1/5]

ValidRegion ( )
inline

Default constructor.

Definition at line 177 of file Types.h.

178  : anchor{}, shape{}
179  {
180  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:247
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:246

◆ ValidRegion() [2/5]

ValidRegion ( const ValidRegion )
default

Allow instances of this class to be copy constructed.

◆ ValidRegion() [3/5]

ValidRegion ( ValidRegion &&  )
default

Allow instances of this class to be move constructed.

◆ ~ValidRegion()

~ValidRegion ( )
default

Default destructor.

◆ ValidRegion() [4/5]

ValidRegion ( const Coordinates an_anchor,
const TensorShape a_shape 
)
inline

Constructor for a valid region with default number of dimensions.

Parameters
[in]an_anchorAnchor for the start of the valid region.
[in]a_shapeShape of the valid region.

Definition at line 199 of file Types.h.

200  : anchor{ an_anchor }, shape{ a_shape }
201  {
203  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:247
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Definition: Dimensions.h:122
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
Definition: Dimensions.h:128
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:246

◆ ValidRegion() [5/5]

ValidRegion ( const Coordinates an_anchor,
const TensorShape a_shape,
size_t  num_dimensions 
)
inline

Constructor for a valid region with specified number of dimensions.

Parameters
[in]an_anchorAnchor for the start of the valid region.
[in]a_shapeShape of the valid region.
[in]num_dimensionsNumber of dimensions (must be >= number of dimensions of anchor and shape).

Definition at line 212 of file Types.h.

213  : anchor{ an_anchor }, shape{ a_shape }
214  {
215  ARM_COMPUTE_ERROR_ON(num_dimensions < std::max(anchor.num_dimensions(), shape.num_dimensions()));
216  anchor.set_num_dimensions(num_dimensions);
217  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:247
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:337
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Definition: Dimensions.h:122
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
Definition: Dimensions.h:128
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:246

Member Function Documentation

◆ end()

int end ( unsigned int  d) const
inline

Return the end of the valid region for the given dimension d.

Definition at line 226 of file Types.h.

227  {
228  return anchor[d] + shape[d];
229  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:247
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:246

References ValidRegion::anchor, and ValidRegion::shape.

Referenced by NEROIPoolingLayerKernel::configure(), CLLKTrackerStage0Kernel::configure(), CLLKTrackerStage1Kernel::configure(), and arm_compute::test::is_in_valid_region().

◆ operator=() [1/2]

ValidRegion& operator= ( const ValidRegion )
default

Allow instances of this class to be copied.

◆ operator=() [2/2]

ValidRegion& operator= ( ValidRegion &&  )
default

Allow instances of this class to be moved.

◆ set()

ValidRegion& set ( size_t  dimension,
int  start,
size_t  size 
)
inline

Accessor to set the value of anchor and shape for one of the dimensions.

Parameters
[in]dimensionDimension for which the value is set.
[in]startValue to be set in anchor for the dimension.
[in]sizeValue to be set in shape for the dimension.
Returns
*this.

Definition at line 239 of file Types.h.

240  {
241  anchor.set(dimension, start);
242  shape.set(dimension, size);
243  return *this;
244  }
TensorShape shape
Shape of the valid region.
Definition: Types.h:247
void set(size_t dimension, T value)
Accessor to set the value of one of the dimensions.
Definition: Dimensions.h:74
int start(unsigned int d) const
Return the start of the valid region for the given dimension d.
Definition: Types.h:220
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true)
Accessor to set the value of one of the dimensions.
Definition: TensorShape.h:78
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:246

References ValidRegion::anchor, Dimensions< T >::set(), TensorShape::set(), ValidRegion::shape, and ValidRegion::start().

◆ start()

int start ( unsigned int  d) const
inline

Return the start of the valid region for the given dimension d.

Definition at line 220 of file Types.h.

221  {
222  return anchor[d];
223  }
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:246

References ValidRegion::anchor.

Referenced by NEROIPoolingLayerKernel::configure(), CLLKTrackerStage0Kernel::configure(), CLLKTrackerStage1Kernel::configure(), arm_compute::test::is_in_valid_region(), and ValidRegion::set().

Field Documentation

◆ anchor

◆ shape


The documentation for this struct was generated from the following file: