openvino.runtime.Type#

class openvino.runtime.Type#

Bases: pybind11_object

openvino.runtime.Type wraps ov::element::Type

__init__(self: openvino._pyopenvino.Type, dtype: object) None#

Convert numpy dtype into OpenVINO type

Parameters:

dtype (numpy.dtype) – numpy dtype

Returns:

OpenVINO type object

Return type:

ov.Type

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(self, arg0)

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__hash__(self)

__init__(self, dtype)

Convert numpy dtype into OpenVINO type

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__(self)

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

compatible(self, other)

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

get_bitwidth(self)

get_size(self)

get_type_name(self)

is_dynamic(self)

is_integral(self)

is_integral_number(self)

is_quantized(self)

is_real(self)

is_signed(self)

is_static(self)

merge(self, other)

Merge two element types and return result if successful, otherwise return None.

to_dtype(self)

Convert Type to numpy dtype.

to_string(self)

Attributes

bf16

bitwidth

boolean

dynamic

f16

f32

f64

f8e4m3

f8e5m2

i16

i32

i4

i64

i8

integral

integral_number

nf4

quantized

real

signed

size

string

type_name

u1

u16

u32

u4

u64

u8

undefined

__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(self: openvino._pyopenvino.Type, arg0: openvino._pyopenvino.Type) bool#
__format__(format_spec, /)#

Default object formatter.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__gt__(value, /)#

Return self>value.

__hash__(self: openvino._pyopenvino.Type) int#
__init__(self: openvino._pyopenvino.Type, dtype: object) None#

Convert numpy dtype into OpenVINO type

Parameters:

dtype (numpy.dtype) – numpy dtype

Returns:

OpenVINO type object

Return type:

ov.Type

__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

__new__(**kwargs)#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__(self: openvino._pyopenvino.Type) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

bf16 = <Type: 'bfloat16'>#
property bitwidth#
boolean = <Type: 'char'>#
compatible(self: openvino._pyopenvino.Type, other: openvino._pyopenvino.Type) bool#

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

Parameters:

other (openvino.runtime.Type) – The element type to compare this element type to.

Returns:

True if element types are compatible, otherwise False.

Return type:

bool

dynamic = <Type: 'dynamic'>#
f16 = <Type: 'float16'>#
f32 = <Type: 'float32'>#
f64 = <Type: 'double64'>#
f8e4m3 = <Type: 'f8e4m3'>#
f8e5m2 = <Type: 'f8e5m2'>#
get_bitwidth(self: openvino._pyopenvino.Type) int#
get_size(self: openvino._pyopenvino.Type) int#
get_type_name(self: openvino._pyopenvino.Type) str#
i16 = <Type: 'int16_t'>#
i32 = <Type: 'int32_t'>#
i4 = <Type: 'int4_t'>#
i64 = <Type: 'int64_t'>#
i8 = <Type: 'int8_t'>#
property integral#
property integral_number#
is_dynamic(self: openvino._pyopenvino.Type) bool#
is_integral(self: openvino._pyopenvino.Type) bool#
is_integral_number(self: openvino._pyopenvino.Type) bool#
is_quantized(self: openvino._pyopenvino.Type) bool#
is_real(self: openvino._pyopenvino.Type) bool#
is_signed(self: openvino._pyopenvino.Type) bool#
is_static(self: openvino._pyopenvino.Type) bool#
merge(self: openvino._pyopenvino.Type, other: openvino._pyopenvino.Type) object#

Merge two element types and return result if successful, otherwise return None.

Parameters:

other (openvino.runtime.Type) – The element type to merge with this element type.

Returns:

If element types are compatible return the least restrictive Type, otherwise None.

Return type:

Union[openvino.runtime.Type|None]

nf4 = <Type: 'nfloat4'>#
property quantized#
property real#
property signed#
property size#
string = <Type: 'string'>#
to_dtype(self: openvino._pyopenvino.Type) numpy.dtype#

Convert Type to numpy dtype.

Returns:

dtype object

Return type:

numpy.dtype

to_string(self: openvino._pyopenvino.Type) str#
property type_name#
u1 = <Type: 'uint1_t'>#
u16 = <Type: 'uint16_t'>#
u32 = <Type: 'uint32_t'>#
u4 = <Type: 'uint4_t'>#
u64 = <Type: 'uint64_t'>#
u8 = <Type: 'uint8_t'>#
undefined = <Type: 'undefined'>#