42 const int num_anchors = anchors.
shape()[1];
48 const T *anchors_ptr = anchors.
data();
49 T *all_anchors_ptr = all_anchors.data();
53 #pragma omp parallel for schedule(dynamic, 1) collapse(3) 55 for(
int y = 0; y < height; y++)
57 for(
int x = 0; x < width; x++)
59 for(
int a = 0; a < num_anchors; a++)
61 const T shift_x = T(x) * T(stride);
62 const T shift_y = T(y) * T(stride);
63 const size_t anchor_id = a + x * num_anchors + y * width * num_anchors;
65 all_anchors_ptr[anchor_id * 4] = anchors_ptr[4 * a] + shift_x;
67 all_anchors_ptr[anchor_id * 4 + 1] = anchors_ptr[4 * a + 1] + shift_y;
69 all_anchors_ptr[anchor_id * 4 + 2] = anchors_ptr[4 * a + 2] + shift_x;
71 all_anchors_ptr[anchor_id * 4 + 3] = anchors_ptr[4 * a + 3] + shift_y;
DataType data_type() const override
Data type of the tensor.
TensorShape shape() const override
Shape of the tensor.
float spatial_scale() const
float feat_height() const
Copyright (c) 2017-2021 Arm Limited.
Simple tensor object that stores elements in a consecutive chunk of memory.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
ComputeAnchors information class.
SimpleTensor< T > compute_all_anchors(const SimpleTensor< T > &anchors, const ComputeAnchorsInfo &info)
QuantizationInfo quantization_info() const override
Quantization info in case of asymmetric quantized type.
SimpleTensor< float > convert_from_symmetric(const SimpleTensor< int16_t > &src)
const T * data() const
Constant pointer to the underlying buffer.