namespace ov::reference::details

Overview

namespace details {

// typedefs

typedef typename std::enable_if<check, bool>::type Required;
typedef void void_t;

// structs

template <typename It>
struct IsRandomAccessIt;
template <typename T>
struct ProposalBox;
template <typename It>
struct from_iterator;
template <typename, typename = size_t>
struct is_complete;
template <typename T>
struct is_complete<T, decltype(sizeof(T))>;

// global functions

uint8_t extract_bit(uint8_t val, uint8_t bit);

template <typename T>
bool xnor(T a, T b);

template <typename T_IN, typename T_F>
void binary_convolve_3D_channels(
    const ConvolutionParams& p,
    const T_IN \* batch,
    const Shape& batch_shape,
    const T_F \* filter,
    const Shape& filter_shape,
    T_IN \*& out,
    const float pad_value
    );

template <typename Iterator>
std::vector<size_t> get_indices_offsets(
    const Iterator beg,
    const Iterator end,
    size_t last_slice_size
    );

template <typename T>
void dot(
    const T \* arg0,
    const T \* arg1,
    T \* out,
    const Shape& arg0_shape,
    const Shape& arg1_shape,
    const Shape& out_shape
    );

std::vector<size_t> get_transpose_order(const Shape& input_shape);

std::vector<float> generate_anchors(
    const op::v0::Proposal::Attributes& attrs,
    const unsigned int anchor_count
    );

template <typename T>
static void enumerate_proposals(
    const T \* bottom4d,
    const T \* d_anchor4d,
    const float \* anchors,
    std::vector<ProposalBox<T>>& proposals,
    const unsigned int num_anchors,
    const unsigned int bottom_H,
    const unsigned int bottom_W,
    const float img_H,
    const float img_W,
    const float min_box_H,
    const float min_box_W,
    const int feat_stride,
    const float box_coordinate_scale,
    const float box_size_scale,
    float coordinates_offset,
    bool initial_clip,
    bool swap_xy,
    bool clip_before_nms
    );

template <typename T>
static void nms(
    const int num_boxes,
    const std::vector<ProposalBox<T>>& proposals,
    std::vector<unsigned int>& index_out,
    int& num_out,
    const int base_index,
    const float nms_thresh,
    const int max_num_out,
    T coordinates_offset
    );

template <typename T>
static void retrieve_rois(
    const int num_rois,
    const int item_index,
    const int num_proposals,
    const std::vector<ProposalBox<T>>& proposals,
    const std::vector<unsigned int>& roi_indices,
    T \* rois,
    int post_nms_topn_,
    bool normalize,
    float img_h,
    float img_w,
    bool clip_after_nms,
    T \* probs = nullptr
    );

template <typename T>
static void proposal_exec(
    const T \* class_probs,
    const T \* bbox_deltas,
    const T \* image_shape,
    T \* output,
    T \* out_probs,
    const Shape& class_probs_shape,
    const Shape& bbox_deltas_shape,
    const Shape& image_shape_shape,
    const Shape& output_shape,
    const Shape& out_probs_shape,
    const op::v0::Proposal::Attributes& attrs
    );

template <
    typename T,
    typename std::enable_if<std::is_floating_point<T>::value, bool>::type = true
    >
bool isfinite(T x);

template <
    class T,
    typename std::enable_if<std::is_integral<T>::value>::type \* = nullptr
    >
constexpr T kahan_summation(
    const T in,
    const T prev_sum,
    T&
    );

template <
    class T,
    typename std::enable_if<ov::is_floating_point<T>()>::type \* = nullptr
    >
T kahan_summation(
    const T in,
    const T prev_sum,
    T& compensation
    );

} // namespace details

Detailed Documentation

Global Functions

template <
    class T,
    typename std::enable_if<std::is_integral<T>::value>::type \* = nullptr
    >
constexpr T kahan_summation(
    const T in,
    const T prev_sum,
    T&
    )

Performs one element summation based on Kahan algorithm to significantly reduce (integral types).

Parameters:

in

Value to add with previous value of summation.

prev_sum

Previous value of summation (accumulator).

Returns:

Compensate sum.

template <
    class T,
    typename std::enable_if<ov::is_floating_point<T>()>::type \* = nullptr
    >
T kahan_summation(
    const T in,
    const T prev_sum,
    T& compensation
    )

Performs one element summation based on Kahan algorithm to significantly reduce (floating point types).

Parameters:

in

Value to add with previous value of summation.

prev_sum

Previous value of summation (accumulator).

compensation

Accumulates the summation error.

Returns:

Compensate sum.