Public Member Functions | Static Public Member Functions | Friends
ngraph::element::Type Class Reference

Public Member Functions

 Type (const Type &)=default
 
constexpr Type (const Type_t t)
 
 Type (size_t bitwidth, bool is_real, bool is_signed, bool is_quantized, const std::string &cname)
 
Typeoperator= (const Type &)=default
 
const std::string & c_type_string () const
 
size_t size () const
 
size_t hash () const
 
bool is_static () const
 
bool is_dynamic () const
 
bool is_real () const
 
bool is_integral () const
 
bool is_integral_number () const
 
bool is_signed () const
 
bool is_quantized () const
 
size_t bitwidth () const
 
const std::string & get_type_name () const
 
bool compatible (const element::Type &t) const
 Checks whether this element type is merge-compatible with t. More...
 
constexpr operator Type_t () const
 

Static Public Member Functions

static std::vector< const Type * > get_known_types ()
 
static bool merge (element::Type &dst, const element::Type &t1, const element::Type &t2)
 Merges two element types t1 and t2, writing the result into dst and returning true if successful, else returning false. More...
 

Friends

NGRAPH_API std::ostream & operator<< (std::ostream &, const Type &)
 

Member Function Documentation

◆ compatible()

bool ngraph::element::Type::compatible ( const element::Type t) const

Checks whether this element type is merge-compatible with t.

Parameters
tThe element type to compare this element type to.
Returns
true if this element type is compatible with t, else false.

◆ merge()

static bool ngraph::element::Type::merge ( element::Type dst,
const element::Type t1,
const element::Type t2 
)
static

Merges two element types t1 and t2, writing the result into dst and returning true if successful, else returning false.

To "merge" two element types t1 and t2 is to find the least restrictive element type t that is no more restrictive than t1 and t2, if t exists. More simply:

merge(dst,element::Type::dynamic,t) writes t to dst and returns true

merge(dst,t,element::Type::dynamic) writes t to dst and returns true

merge(dst,t1,t2) where t1, t2 both static and equal writes t1 to dst and returns true

merge(dst,t1,t2) where t1, t2 both static and unequal does nothing to dst, and returns false


The documentation for this class was generated from the following file: