34 Iterator all_anchors_it(all_anchors, window);
35 Iterator anchors_it(all_anchors, window);
39 const size_t feat_width = anchors_info.
feat_width();
43 const size_t anchor_offset =
id.
y() % num_anchors;
45 const auto out_anchor_ptr =
reinterpret_cast<T *
>(all_anchors_it.
ptr());
48 const size_t shift_idy =
id.y() / num_anchors;
49 const T shiftx = (shift_idy % feat_width) * stride;
50 const T shifty = (shift_idy / feat_width) * stride;
52 *out_anchor_ptr = *anchor_ptr + shiftx;
53 *(out_anchor_ptr + 1) = *(1 + anchor_ptr) + shifty;
54 *(out_anchor_ptr + 2) = *(2 + anchor_ptr) + shiftx;
55 *(out_anchor_ptr + 3) = *(3 + anchor_ptr) + shifty;
61 #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) 63 #endif //defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) 67 Iterator all_anchors_it(all_anchors, window);
68 Iterator anchors_it(all_anchors, window);
72 const size_t feat_width = anchors_info.
feat_width();
78 const size_t anchor_offset =
id.
y() % num_anchors;
80 const auto out_anchor_ptr =
reinterpret_cast<int16_t *
>(all_anchors_it.
ptr());
83 const size_t shift_idy =
id.y() / num_anchors;
84 const float shiftx = (shift_idy % feat_width) * stride;
85 const float shifty = (shift_idy / feat_width) * stride;
uint8_t * ptr_to_element(const Coordinates &id) const
Return a pointer to the element at the passed coordinates.
int16_t quantize_qsymm16(float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a 16-bit symmetric quantization scheme.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
Interface for CPU tensor.
float spatial_scale() const
Copyright (c) 2017-2022 Arm Limited.
float dequantize_qsymm16(int16_t value, const UniformQuantizationInfo &qinfo)
Dequantize a value given a 16-bit symmetric quantization scheme.
UniformQuantizationInfo uniform() const
Return per layer quantization info.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
void compute_all_anchors(const ITensor *anchors, ITensor *all_anchors, ComputeAnchorsInfo anchors_info, const Window &window)
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
const QuantizationInfo qinfo
ComputeAnchors information class.
constexpr const Dimension & y() const
Alias to access the second dimension of the window.
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&... iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
template void compute_all_anchors< float >(const ITensor *anchors, ITensor *all_anchors, ComputeAnchorsInfo anchors_info, const Window &window)
void compute_all_anchors_qasymm16(const ITensor *anchors, ITensor *all_anchors, ComputeAnchorsInfo anchors_info, const Window &window)
Iterator updated by execute_window_loop for each window element.
Describe a multidimensional execution window.