Compute Library
 21.08
TFPreproccessor Class Reference

TF preproccessor. More...

#include <GraphUtils.h>

Collaboration diagram for TFPreproccessor:
[legend]

Public Member Functions

 TFPreproccessor (float min_range=-1.f, float max_range=1.f)
 Constructor. More...
 
void preprocess (ITensor &tensor) override
 Preprocess the given tensor. More...
 
- Public Member Functions inherited from IPreprocessor
virtual ~IPreprocessor ()=default
 Default destructor. More...
 

Detailed Description

TF preproccessor.

Definition at line 82 of file GraphUtils.h.

Constructor & Destructor Documentation

◆ TFPreproccessor()

TFPreproccessor ( float  min_range = -1.f,
float  max_range = 1.f 
)

Constructor.

Parameters
[in]min_rangeMin normalization range. (Defaults to -1.f)
[in]max_rangeMax normalization range. (Defaults to 1.f)

Definition at line 65 of file GraphUtils.cpp.

66  : _min_range(min_range), _max_range(max_range)
67 {
68 }

Member Function Documentation

◆ preprocess()

void preprocess ( ITensor tensor)
overridevirtual

Preprocess the given tensor.

Parameters
[in]tensorTensor to preprocess.

Implements IPreprocessor.

Definition at line 69 of file GraphUtils.cpp.

References ARM_COMPUTE_ERROR, ITensorInfo::data_type(), arm_compute::execute_window_loop(), arm_compute::F16, arm_compute::F32, ITensor::info(), ITensor::ptr_to_element(), arm_compute::test::validation::reference::range(), ITensorInfo::tensor_shape(), and Window::use_tensor_dimensions().

70 {
71  if(tensor.info()->data_type() == DataType::F32)
72  {
73  preprocess_typed<float>(tensor);
74  }
75  else if(tensor.info()->data_type() == DataType::F16)
76  {
77  preprocess_typed<half>(tensor);
78  }
79  else
80  {
81  ARM_COMPUTE_ERROR("NOT SUPPORTED!");
82  }
83 }
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
1 channel, 1 F32 per channel
1 channel, 1 F16 per channel

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