Compute Library
PPMWriter Class Reference

PPM writer class. More...

#include <GraphUtils.h>

Collaboration diagram for PPMWriter:

Public Member Functions

 PPMWriter (std::string name, unsigned int maximum=1)
 Constructor. More...
 PPMWriter (PPMWriter &&)=default
 Allows instances to move constructed. 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

PPM writer class.

Definition at line 104 of file GraphUtils.h.

Constructor & Destructor Documentation

◆ PPMWriter() [1/2]

PPMWriter ( std::string  name,
unsigned int  maximum = 1 


[in]namePPM file name
[in]maximumMaximum elements to access

Definition at line 140 of file GraphUtils.cpp.

141  : _name(std::move(name)), _iterator(0), _maximum(maximum)
142 {
143 }
const char * name

◆ PPMWriter() [2/2]

PPMWriter ( PPMWriter &&  )

Allows instances to move constructed.

Member Function Documentation

◆ access_tensor()

bool access_tensor ( ITensor tensor)

Interface to be implemented to access a given tensor.

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

Implements ITensorAccessor.

Definition at line 145 of file GraphUtils.cpp.

References arm_compute::utils::save_to_ppm(), and arm_compute::test::validation::ss().

146 {
147  std::stringstream ss;
148  ss << _name << _iterator << ".ppm";
150  arm_compute::utils::save_to_ppm(tensor, ss.str());
152  _iterator++;
153  if(_maximum == 0)
154  {
155  return true;
156  }
157  return _iterator < _maximum;
158 }
void save_to_ppm(T &tensor, const std::string &ppm_filename)
Template helper function to save a tensor image to a PPM file.
Definition: Utils.h:503
std::stringstream ss(mlgo_str)

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