#include <NEQuantizationSymmetricKernel.h>
|
static Status | validate (const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *scale_factor) |
|
Interface for the dequantization layer kernel.
Definition at line 51 of file NEQuantizationSymmetricKernel.h.
◆ NEQuantizationSymmetricKernel() [1/3]
NEQuantizationSymmetricKernel::NEQuantizationSymmetricKernel |
( |
| ) |
|
◆ NEQuantizationSymmetricKernel() [2/3]
Prevent instances of this class from being copied (As this class contains pointers)
◆ NEQuantizationSymmetricKernel() [3/3]
Default Move Constructor.
◆ ~NEQuantizationSymmetricKernel()
arm_compute::NEQuantizationSymmetricKernel::~NEQuantizationSymmetricKernel |
( |
| ) |
|
|
default |
◆ configure()
void NEQuantizationSymmetricKernel::configure |
( |
const ITensor * |
input, |
|
|
ITensor * |
output, |
|
|
ITensor * |
scale_factor |
|
) |
| |
Set input, output tensors.
- Parameters
-
[in] | input | Source tensor. Data type supported: F16/F32. |
[out] | output | Destination tensor with the same dimensions of input. Data type supported: S8. |
[out] | scale_factor | Scale tensor of output . Data type supported: Same as input . |
Definition at line 135 of file NEQuantizationSymmetricKernel.cpp.
137{
138 ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
139 ARM_COMPUTE_ERROR_THROW_ON(
140 validate_arguments(
input->info(),
output->info(), scale_factor->info()));
141
144 _scale_factor = scale_factor;
145
146
147 Window win_config = calculate_max_window(*
input->info(), Steps());
148
149 Coordinates coord;
150 coord.set_num_dimensions(
output->info()->num_dimensions());
151 output->info()->set_valid_region(ValidRegion(coord,
output->info()->tensor_shape()));
152
153 INEKernel::configure(win_config);
154}
Referenced by arm_compute::NEFullyConnectedHybridLayer::configure().
◆ name()
const char * arm_compute::NEQuantizationSymmetricKernel::name |
( |
| ) |
const |
|
inlineoverride |
◆ operator=() [1/2]
Prevent instances of this class from being copied (As this class contains pointers)
◆ operator=() [2/2]
Default move assignment operator
◆ run()
void NEQuantizationSymmetricKernel::run |
( |
const Window & |
window, |
|
|
const ThreadInfo & |
info |
|
) |
| |
|
override |
Definition at line 220 of file NEQuantizationSymmetricKernel.cpp.
221{
222 ARM_COMPUTE_UNUSED(
info);
223 ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
224 ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INEKernel::window(), window);
225
226 switch (_input->info()->data_type())
227 {
228 case DataType::F32:
229 NEQuantizationSymmetricKernel::quantize<float>(window);
230 break;
231#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
232 case DataType::F16:
233 NEQuantizationSymmetricKernel::quantize<float16_t>(window);
234 break;
235#endif
236 default:
237 ARM_COMPUTE_ERROR("Unsupported data type.");
238 }
239}
volatile const char info[]
References info.
Referenced by package.infer.session::inference().
◆ validate()
Status NEQuantizationSymmetricKernel::validate |
( |
const ITensorInfo * |
input, |
|
|
const ITensorInfo * |
output, |
|
|
const ITensorInfo * |
scale_factor |
|
) |
| |
|
static |
The documentation for this class was generated from the following files: