#include <NEMuliplyScaleFactorKernel.h>
|
static Status | validate (const ITensorInfo *input, const ITensorInfo *scale_factor, const ITensorInfo *output, float multiplier=1.f) |
|
Interface to multiply scale factor kernel.
Definition at line 51 of file NEMuliplyScaleFactorKernel.h.
◆ NEMultiplyScaleFactorKernel() [1/3]
NEMultiplyScaleFactorKernel::NEMultiplyScaleFactorKernel |
( |
| ) |
|
Default constructor
Definition at line 137 of file NEMultiplyScaleFactorKernel.cpp.
138 : _input(nullptr), _scale_factor(nullptr), _output(nullptr), _multiplier(1.f)
139{
140}
◆ NEMultiplyScaleFactorKernel() [2/3]
Prevent instances of this class from being copied (As this class contains pointers)
◆ NEMultiplyScaleFactorKernel() [3/3]
Default Move Constructor.
◆ ~NEMultiplyScaleFactorKernel()
arm_compute::NEMultiplyScaleFactorKernel::~NEMultiplyScaleFactorKernel |
( |
| ) |
|
|
default |
◆ configure()
void NEMultiplyScaleFactorKernel::configure |
( |
const ITensor * |
input, |
|
|
const ITensor * |
scale_factor, |
|
|
ITensor * |
output, |
|
|
float |
multiplier = 1.f |
|
) |
| |
Set input, output tensors.
- Parameters
-
| [in/out] | input Source tensor. Data type supported: S32. |
[in] | scale_factor | Scale tensor. Data type supported: F16/F32. |
[out] | output | Destination tensor. Data type supported: Same as scale_factor . |
Definition at line 142 of file NEMultiplyScaleFactorKernel.cpp.
144{
145 ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
146 ARM_COMPUTE_ERROR_THROW_ON(
147 validate_arguments(
input->info(), scale_factor->info(),
output->info()));
148
150 _scale_factor = scale_factor;
152 _multiplier = multiplier;
153
154
155 Window win_config = calculate_max_window(*
input->info(), Steps());
156
157 Coordinates coord;
158 coord.set_num_dimensions(
output->info()->num_dimensions());
159 output->info()->set_valid_region(ValidRegion(coord,
output->info()->tensor_shape()));
160
161 INEKernel::configure(win_config);
162}
Referenced by arm_compute::NEFullyConnectedHybridLayer::configure().
◆ name()
const char * arm_compute::NEMultiplyScaleFactorKernel::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 NEMultiplyScaleFactorKernel::run |
( |
const Window & |
window, |
|
|
const ThreadInfo & |
info |
|
) |
| |
|
override |
Definition at line 208 of file NEMultiplyScaleFactorKernel.cpp.
209{
210 ARM_COMPUTE_UNUSED(
info);
211 ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
212 ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INEKernel::window(), window);
213
214 switch (_output->info()->data_type())
215 {
216 case DataType::F32:
217 NEMultiplyScaleFactorKernel::multiply<float>(window);
218 break;
219#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
220 case DataType::F16:
221 NEMultiplyScaleFactorKernel::multiply<float16_t>(window);
222 break;
223#endif
224 default:
225 ARM_COMPUTE_ERROR("Unsupported data type.");
226 }
227}
volatile const char info[]
References info.
Referenced by package.infer.session::inference().
◆ validate()
Status NEMultiplyScaleFactorKernel::validate |
( |
const ITensorInfo * |
input, |
|
|
const ITensorInfo * |
scale_factor, |
|
|
const ITensorInfo * |
output, |
|
|
float |
multiplier = 1.f |
|
) |
| |
|
static |
The documentation for this class was generated from the following files: