namespace ngraph::runtime::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::ProposalAttrs& 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::ProposalAttrs& attrs
    );

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

template <typename T>
void kahan_summation(
    const T& elem,
    T& compensation,
    T& sum
    );

} // namespace details

Detailed Documentation

Global Functions

template <typename T>
void kahan_summation(
    const T& elem,
    T& compensation,
    T& sum
    )

Performs one element summation based on Kahan algorithm to significantly reduce the numerical error.

Parameters:

elem

Element to add into the accumulator.

compensation

Variable that accumulates the error.

sum

Result of compensated summation.