Compute Library
 21.11
PostOpList< TensorRelatedT > Class Template Reference

A sequence of PostOps that can be appended to the end of other operators. More...

#include <IPostOp.h>

Public Member Functions

 PostOpList ()=default
 Constructor. More...
 
 ~PostOpList ()=default
 Destructor. More...
 
 PostOpList (const PostOpList &other)
 
PostOpListoperator= (const PostOpList &other)
 
 PostOpList (PostOpList &&other)=default
 
PostOpListoperator= (PostOpList &&other)=default
 
template<typename OpT , typename... Args>
void push_back_op (Args &&... args)
 Add a new post op at the end of the list. More...
 
size_t size () const
 Number of post ops. More...
 
size_t total_num_arguments () const
 Total number of post ops. More...
 
std::vector< std::unique_ptr< IPostOp< TensorRelatedT > > > & get_list ()
 Get the underlying post op list. More...
 
const std::vector< std::unique_ptr< IPostOp< TensorRelatedT > > > & get_list () const
 

Detailed Description

template<typename TensorRelatedT>
class arm_compute::experimental::PostOpList< TensorRelatedT >

A sequence of PostOps that can be appended to the end of other operators.

Definition at line 119 of file IPostOp.h.

Constructor & Destructor Documentation

◆ PostOpList() [1/3]

PostOpList ( )
default

Constructor.

◆ ~PostOpList()

~PostOpList ( )
default

Destructor.

◆ PostOpList() [2/3]

PostOpList ( const PostOpList< TensorRelatedT > &  other)
inline

Definition at line 126 of file IPostOp.h.

127  {
128  for(const auto &op : other._post_ops)
129  {
130  this->_post_ops.push_back(op->clone());
131  }
132  }

◆ PostOpList() [3/3]

PostOpList ( PostOpList< TensorRelatedT > &&  other)
default

Member Function Documentation

◆ get_list() [1/2]

std::vector<std::unique_ptr<IPostOp<TensorRelatedT> > >& get_list ( )
inline

◆ get_list() [2/2]

const std::vector<std::unique_ptr<IPostOp<TensorRelatedT> > >& get_list ( ) const
inline

Definition at line 169 of file IPostOp.h.

170  {
171  return _post_ops;
172  }

◆ operator=() [1/2]

PostOpList& operator= ( const PostOpList< TensorRelatedT > &  other)
inline

Definition at line 133 of file IPostOp.h.

134  {
135  PostOpList tmp{ other };
136  std::swap(tmp, *this);
137  return *this;
138  }
PostOpList()=default
Constructor.
void swap(Window &lhs, Window &rhs)
Definition: Window.inl:304

◆ operator=() [2/2]

PostOpList& operator= ( PostOpList< TensorRelatedT > &&  other)
default

◆ push_back_op()

void push_back_op ( Args &&...  args)
inline

Add a new post op at the end of the list.

Definition at line 144 of file IPostOp.h.

Referenced by arm_compute::test::validation::DATA_TEST_CASE(), and arm_compute::test::validation::TEST_CASE().

145  {
146  _post_ops.push_back(std::make_unique<OpT>(std::forward<Args>(args)...));
147  }

◆ size()

size_t size ( ) const
inline

Number of post ops.

Definition at line 150 of file IPostOp.h.

Referenced by PostOpCLKernelUtils::is_post_op_sequence_supported(), PostOpCLKernelUtils::set_post_ops_cl_build_options(), and CLConvolutionLayer::validate().

151  {
152  return _post_ops.size();
153  }

◆ total_num_arguments()

size_t total_num_arguments ( ) const
inline

Total number of post ops.

Definition at line 156 of file IPostOp.h.

157  {
158  return std::accumulate(_post_ops.begin(), _post_ops.end(), 0, [](size_t op1_arity, const auto & op2)
159  {
160  return op1_arity + op2->arity();
161  });
162  }
SimpleTensor< T2 > accumulate(const SimpleTensor< T1 > &src, DataType output_data_type)
Definition: Accumulate.cpp:38

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