Compute Library
 21.08
SaveNumPyAccessor Class Referencefinal

SaveNumPy accessor class. More...

#include <GraphUtils.h>

Collaboration diagram for SaveNumPyAccessor:
[legend]

Public Member Functions

 SaveNumPyAccessor (const std::string npy_name, const bool is_fortran=false)
 Constructor. More...
 
 SaveNumPyAccessor (SaveNumPyAccessor &&)=default
 Allow instances of this class to be move constructed. More...
 
 SaveNumPyAccessor (const SaveNumPyAccessor &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
SaveNumPyAccessoroperator= (const SaveNumPyAccessor &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
bool access_tensor (ITensor &tensor) override
 Interface to be implemented to access a given tensor. More...
 
- Public Member Functions inherited from ITensorAccessor
virtual ~ITensorAccessor ()=default
 Default virtual destructor. More...
 

Detailed Description

SaveNumPy accessor class.

Definition at line 178 of file GraphUtils.h.

Constructor & Destructor Documentation

◆ SaveNumPyAccessor() [1/3]

SaveNumPyAccessor ( const std::string  npy_name,
const bool  is_fortran = false 
)

Constructor.

Parameters
[in]npy_nameNpy file name.
[in]is_fortran(Optional) If true, save tensor in fortran order.

Definition at line 239 of file GraphUtils.cpp.

240  : _npy_name(std::move(npy_name)), _is_fortran(is_fortran)
241 {
242 }

◆ SaveNumPyAccessor() [2/3]

Allow instances of this class to be move constructed.

◆ SaveNumPyAccessor() [3/3]

SaveNumPyAccessor ( const SaveNumPyAccessor )
delete

Prevent instances of this class from being copied (As this class contains pointers)

Member Function Documentation

◆ access_tensor()

bool access_tensor ( ITensor tensor)
overridevirtual

Interface to be implemented to access a given tensor.

Parameters
[in]tensorTensor to be accessed
Returns
True if access is successful else false

Implements ITensorAccessor.

Definition at line 244 of file GraphUtils.cpp.

References ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, arm_compute::F32, and arm_compute::utils::save_to_npy().

245 {
247 
248  utils::save_to_npy(tensor, _npy_name, _is_fortran);
249 
250  return false;
251 }
1 channel, 1 F32 per channel
void save_to_npy(T &tensor, const std::string &npy_filename, bool fortran_order)
Template helper function to save a tensor image to a NPY file.
Definition: Utils.h:583
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:786

◆ operator=()

SaveNumPyAccessor& operator= ( const SaveNumPyAccessor )
delete

Prevent instances of this class from being copied (As this class contains pointers)


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