struct ov::util::InTypeRange

Overview

Check if input data is in [T::min(), T::max()] and then cast it to T. More…

#include <shape_infer_type_utils.hpp>

template <class T>
struct InTypeRange
{
    // fields

    const T m_min {std::numeric_limits<T>::lowest()};
    const T m_max {std::numeric_limits<T>::max()};

    // construction

    InTypeRange();
    InTypeRange(const T& min, const T& max);

    // methods

    template <class U>
    T operator () (const U u) const;
};

Detailed Documentation

Check if input data is in [T::min(), T::max()] and then cast it to T.

Parameters:

T

Type of returned value and used to specified min, max of valid value range.

ov::AssertFailure

if input value not in type range.