Compute Library
ITensorPack Class Reference

Tensor packing service. More...

#include <ITensorPack.h>

Public Member Functions

 ITensorPack ()=default
 Default Constructor. More...
void add_tensor (int id, ITensor *tensor)
 Add tensor to the pack. More...
void add_tensor (int id, const ITensor *tensor)
 Add const tensor to the pack. More...
ITensorget_tensor (int id)
 Get tensor of a given id from the pac. More...
const ITensorget_const_tensor (int id) const
 Get constant tensor of a given id. More...
size_t size () const
 Pack size accessor. More...
bool empty () const
 Checks if pack is empty. More...

Detailed Description

Tensor packing service.

Definition at line 36 of file ITensorPack.h.

Constructor & Destructor Documentation

◆ ITensorPack()

ITensorPack ( )

Default Constructor.

Member Function Documentation

◆ add_tensor() [1/2]

◆ add_tensor() [2/2]

void add_tensor ( int  id,
const ITensor tensor 

Add const tensor to the pack.

[in]idID/type of the tensor to add
[in]tensorTensor to add

Definition at line 35 of file ITensorPack.cpp.

36 {
37  _pack[id] = PackElement(tensor);
38 }

◆ empty()

bool empty ( ) const

Checks if pack is empty.

True if empty else false

Definition at line 61 of file ITensorPack.cpp.

62 {
63  return _pack.empty();
64 }

Referenced by ICLOperator::run(), INEOperator::run(), NEConcatenation::run(), CLConcatenation::run(), and NEActivationLayerKernel::run_op().

◆ get_const_tensor()

const ITensor * get_const_tensor ( int  id) const

◆ get_tensor()

◆ size()

size_t size ( ) const

Pack size accessor.

Number of tensors registered to the pack

Definition at line 56 of file ITensorPack.cpp.

57 {
58  return _pack.size();
59 }

Referenced by NEConcatenation::run(), and CLConcatenation::run().

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