openvino.runtime.Model#
- class openvino.runtime.Model(*args: Any, **kwargs: Any)#
Bases:
Model
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: openvino._pyopenvino.Model, other: openvino._pyopenvino.Model) -> None
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model.
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model.
- param results:
List of Nodes to be used as results.
- type results:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, result: openvino._pyopenvino.Node, parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model.
- param result:
Node to be used as result.
- type result:
openvino.runtime.Node
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
Methods
__copy__
(self)__deepcopy__
(memo)Returns a deepcopy of Model.
__delattr__
(name, /)Implement delattr(self, name).
__dir__
()Default dir() implementation.
__eq__
(value, /)Return self==value.
__format__
(format_spec, /)Default object formatter.
__ge__
(value, /)Return self>=value.
__getattribute__
(name, /)Return getattr(self, name).
__gt__
(value, /)Return self>value.
__hash__
()Return hash(self).
__init__
(*args, **kwargs)Overloaded function.
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)Helper for pickle.
__reduce_ex__
(protocol, /)Helper for pickle.
__repr__
(self)__setattr__
(name, value, /)Implement setattr(self, name, value).
Size of object in memory, in bytes.
__str__
()Return str(self).
Abstract classes can override this to customize issubclass().
_get_raw_address
(self)Returns a raw address of the Model object from C++.
add_outputs
(self, outputs)add_parameters
(self, parameters)Add new Parameter nodes to the list.
add_results
(self, results)Add new Result nodes to the list.
add_sinks
(self, sinks)Add new sink nodes to the list.
add_variables
(self, variables)Add new variables to the list.
clone
(self)Return a copy of self.
evaluate
(self, output_tensors, ...)Evaluate the model on inputs, putting results in outputs
get_friendly_name
(self)Gets the friendly name for a model.
get_name
(self)Get the unique name of the model.
get_ops
(self)Return ops used in the model.
get_ordered_ops
(self)Return ops used in the model in topological order.
get_output_element_type
(self, index)Return the element type of output i
get_output_op
(self, index)Return the op that generates output i
get_output_partial_shape
(self, index)Return the partial shape of element i
get_output_shape
(self, index)Return the shape of element i
get_output_size
(self)Return the number of outputs for the model.
get_parameter_index
(self, parameter)Return the index position of parameter
get_parameters
(self)Return the model parameters.
get_result
(self)Return single result.
get_result_index
(*args, **kwargs)Overloaded function.
get_results
(self)Return a list of model outputs.
get_rt_info
(*args, **kwargs)Overloaded function.
get_sink_index
(*args, **kwargs)Overloaded function.
get_sinks
(self)Return a list of model's sinks.
get_variable_by_id
(self, arg0)Return a variable by specified variable_id.
get_variables
(self)Return a list of model's variables.
has_rt_info
(*args, **kwargs)Overloaded function.
input
(*args, **kwargs)Overloaded function.
is_dynamic
(self)Returns true if any of the op's defined in the model contains partial shape.
output
(*args, **kwargs)Overloaded function.
remove_parameter
(self, parameter)Delete Parameter node from the list of parameters.
remove_result
(self, result)Delete Result node from the list of results.
remove_sink
(self, sink)Delete sink node from the list of sinks.
remove_variable
(self, variable)Delete variable from the list of variables.
replace_parameter
(self, parameter_index, ...)Replace the parameter_index parameter of the model with parameter
reshape
(*args, **kwargs)Overloaded function.
set_friendly_name
(self, name)Sets a friendly name for a model.
set_rt_info
(*args, **kwargs)Overloaded function.
Attributes
Returns true if any of the op's defined in the model contains partial shape.
Return the model parameters.
Return single result.
Return a list of model outputs.
Return a list of model's sinks.
Return a list of model's variables.
- __class__#
alias of
pybind11_type
- __copy__(self: openvino._pyopenvino.Model) None #
- __deepcopy__(memo: Dict) Model #
Returns a deepcopy of Model.
- Returns:
A copy of Model.
- Return type:
- __delattr__(name, /)#
Implement delattr(self, name).
- __dir__()#
Default dir() implementation.
- __eq__(value, /)#
Return self==value.
- __format__(format_spec, /)#
Default object formatter.
- __ge__(value, /)#
Return self>=value.
- __getattribute__(name, /)#
Return getattr(self, name).
- __gt__(value, /)#
Return self>value.
- __hash__()#
Return hash(self).
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: openvino._pyopenvino.Model, other: openvino._pyopenvino.Model) -> None
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model.
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model.
- param results:
List of Nodes to be used as results.
- type results:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, result: openvino._pyopenvino.Node, parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model.
- param result:
Node to be used as result.
- type result:
openvino.runtime.Node
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of outputs.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Output sink node handles.
- type sinks:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], sinks: list[openvino._pyopenvino.Node], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[openvino.runtime.Output]
- param sinks:
List of Nodes to be used as Sinks (e.g. Assign ops).
- type sinks:
List[openvino.runtime.Node]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[op.Result]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param variables:
List of variables.
- type variables:
List[op.util.Variable]
- param name:
String to set as model’s friendly name.
- type name:
str
__init__(self: openvino._pyopenvino.Model, results: list[ov::Output<ov::Node>], parameters: list[openvino._pyopenvino.op.Parameter], variables: list[openvino._pyopenvino.op.util.Variable], name: str = ‘’) -> None
Create user-defined Model which is a representation of a model
- param results:
List of results.
- type results:
List[openvino.runtime.Output]
- param parameters:
List of parameters.
- type parameters:
List[op.Parameter]
- param name:
String to set as model’s friendly name.
- type name:
str
- __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)#
- __pybind11_module_local_v4_gcc_libstdcpp_cxxabi1014__ = <capsule object NULL>#
- __reduce__()#
Helper for pickle.
- __reduce_ex__(protocol, /)#
Helper for pickle.
- __repr__(self: openvino._pyopenvino.Model) 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).
- _get_raw_address(self: openvino._pyopenvino.Model) int #
Returns a raw address of the Model object from C++.
Use this function in order to compare underlying C++ addresses instead of using __eq__ in Python.
- Returns:
a raw address of the Model object.
- Return type:
int
- add_outputs(self: openvino._pyopenvino.Model, outputs: object) list[ov::Output<ov::Node>] #
- add_parameters(self: openvino._pyopenvino.Model, parameters: list[openvino._pyopenvino.op.Parameter]) None #
Add new Parameter nodes to the list.
Method doesn’t change or validate graph, it should be done manually. For example, if you want to replace ReadValue node by Parameter, you should do the following steps: * replace node ReadValue by Parameter in graph * call add_parameter() to add new input to the list * call graph validation to check correctness of changes
- Parameters:
parameter (List[op.Parameter]) – new Parameter nodes.
- add_results(self: openvino._pyopenvino.Model, results: list[openvino._pyopenvino.op.Result]) None #
Add new Result nodes to the list.
Method doesn’t validate graph, it should be done manually after all changes.
- Parameters:
results (List[op.Result]) – new Result nodes.
- add_sinks(self: openvino._pyopenvino.Model, sinks: list) None #
Add new sink nodes to the list.
Method doesn’t validate graph, it should be done manually after all changes.
- Parameters:
sinks (List[openvino.runtime.Node]) – new sink nodes.
- add_variables(self: openvino._pyopenvino.Model, variables: list[openvino._pyopenvino.op.util.Variable]) None #
Add new variables to the list.
Method doesn’t validate graph, it should be done manually after all changes.
- Parameters:
variables (List[op.util.Variable]) – new variables to add.
- clone(self: openvino._pyopenvino.Model) openvino._pyopenvino.Model #
Return a copy of self. :return: A copy of self. :rtype: openvino.runtime.Model
- property dynamic#
Returns true if any of the op’s defined in the model contains partial shape.
- Return type:
bool
- evaluate(self: openvino._pyopenvino.Model, output_tensors: list[ov::Tensor], input_tensors: list[ov::Tensor], evaluation_context: openvino._pyopenvino.RTMap = <RTMap>) bool #
Evaluate the model on inputs, putting results in outputs
- Parameters:
output_tensors (List[openvino.runtime.Tensor]) – Tensors for the outputs to compute. One for each result
input_tensors (List[openvino.runtime.Tensor]) – Tensors for the inputs. One for each inputs.
evaluation_context (openvino.runtime.RTMap) – Storage of additional settings and attributes that can be used when evaluating the model. This additional information can be shared across nodes.
- Return type:
bool
- property friendly_name#
- get_friendly_name(self: openvino._pyopenvino.Model) str #
Gets the friendly name for a model. If no friendly name has been set via set_friendly_name then the model’s unique name is returned.
- Returns:
String with a friendly name of the model.
- Return type:
str
- get_name(self: openvino._pyopenvino.Model) str #
Get the unique name of the model.
- Returns:
String with a name of the model.
- Return type:
str
- get_ops(self: openvino._pyopenvino.Model) list[openvino._pyopenvino.Node] #
Return ops used in the model.
- Returns:
List of Nodes representing ops used in model.
- Return type:
List[openvino.runtime.Node]
- get_ordered_ops(self: openvino._pyopenvino.Model) list[openvino._pyopenvino.Node] #
Return ops used in the model in topological order.
- Returns:
List of sorted Nodes representing ops used in model.
- Return type:
List[openvino.runtime.Node]
- get_output_element_type(self: openvino._pyopenvino.Model, index: int) openvino._pyopenvino.Type #
Return the element type of output i
- Parameters:
index (int) – output index
- Returns:
Type object of output i
- Return type:
- get_output_op(self: openvino._pyopenvino.Model, index: int) openvino._pyopenvino.Node #
Return the op that generates output i
- Parameters:
index (output index) – output index
- Returns:
Node object that generates output i
- Return type:
- get_output_partial_shape(self: openvino._pyopenvino.Model, index: int) openvino._pyopenvino.PartialShape #
Return the partial shape of element i
- Parameters:
index (int) – element index
- Returns:
PartialShape object of element i
- Return type:
- get_output_shape(self: openvino._pyopenvino.Model, index: int) openvino._pyopenvino.Shape #
Return the shape of element i
- Parameters:
index (int) – element index
- Returns:
Shape object of element i
- Return type:
- get_output_size(self: openvino._pyopenvino.Model) int #
Return the number of outputs for the model.
- Returns:
Number of outputs.
- Return type:
int
- get_parameter_index(self: openvino._pyopenvino.Model, parameter: openvino._pyopenvino.op.Parameter) int #
Return the index position of parameter
Return -1 if parameter not matched.
- Parameters:
parameter (op.Parameter) – Parameter, which index is to be found.
- Returns:
Index for parameter
- Return type:
int
- get_parameters(self: openvino._pyopenvino.Model) list[openvino._pyopenvino.op.Parameter] #
Return the model parameters.
- Returns:
a list of model’s parameters.
- Return type:
List[op.Parameter]
- get_result(self: openvino._pyopenvino.Model) openvino._pyopenvino.Node #
Return single result.
- Returns:
Node object representing result.
- Return type:
- get_result_index(*args, **kwargs)#
Overloaded function.
get_result_index(self: openvino._pyopenvino.Model, value: ov::Output<ov::Node>) -> int
Return index of result.
Return -1 if value not matched.
- param value:
Output containing Node
- type value:
openvino.runtime.Output
- return:
Index for value referencing it.
- rtype:
int
get_result_index(self: openvino._pyopenvino.Model, value: ov::Output<ov::Node const>) -> int
Return index of result.
Return -1 if value not matched.
- param value:
Output containing Node
- type value:
openvino.runtime.Output
- return:
Index for value referencing it.
- rtype:
int
get_result_index(self: openvino._pyopenvino.Model, result: openvino._pyopenvino.op.Result) -> int
Return index of result.
Return -1 if result not matched.
- param result:
Result operation
- type result:
op.Result
- return:
Index for result referencing it.
- rtype:
int
- get_results(self: openvino._pyopenvino.Model) list[openvino._pyopenvino.op.Result] #
Return a list of model outputs.
- Returns:
a list of model’s result nodes.
- Return type:
List[op.Result]
- get_rt_info(*args, **kwargs)#
Overloaded function.
get_rt_info(self: openvino._pyopenvino.Model) -> openvino._pyopenvino.RTMap
Returns PyRTMap which is a dictionary of user defined runtime info.
- return:
A dictionary of user defined data.
- rtype:
openvino.runtime.RTMap
get_rt_info(self: openvino._pyopenvino.Model, path: list) -> object
Returns runtime attribute as a OVAny object.
- param path:
List of strings which defines a path to runtime info.
- type path:
List[str]
- return:
A runtime attribute.
- rtype:
openvino.runtime.OVAny
get_rt_info(self: openvino._pyopenvino.Model, path: str) -> object
Returns runtime attribute as a OVAny object.
- param path:
List of strings which defines a path to runtime info.
- type path:
str
- return:
A runtime attribute.
- rtype:
openvino.runtime.OVAny
- get_sink_index(*args, **kwargs)#
Overloaded function.
get_sink_index(self: openvino._pyopenvino.Model, value: ov::Output<ov::Node>) -> int
Return index of sink.
Return -1 if value not matched.
- param value:
Output sink node handle
- type value:
openvino.runtime.Output
- return:
Index of sink node referenced by output handle.
- rtype:
int
get_sink_index(self: openvino._pyopenvino.Model, value: ov::Output<ov::Node const>) -> int
Return index of sink.
Return -1 if value not matched.
- param value:
Output sink node handle
- type value:
openvino.runtime.Output
- return:
Index of sink node referenced by output handle.
- rtype:
int
get_sink_index(self: openvino._pyopenvino.Model, sink: object) -> int
Return index of sink node.
Return -1 if sink not matched.
- param sink:
Sink node.
- type sink:
openvino.runtime.Node
- return:
Index of sink node.
- rtype:
int
- get_sinks(self: openvino._pyopenvino.Model) list[openvino._pyopenvino.Node] #
Return a list of model’s sinks.
- Returns:
a list of model’s sinks.
- Return type:
List[openvino.runtime.Node]
- get_variable_by_id(self: openvino._pyopenvino.Model, arg0: str) openvino._pyopenvino.op.util.Variable #
Return a variable by specified variable_id.
- Parameters:
variable_id (str) – a variable id to get variable node.
- Returns:
a variable node.
- Return type:
- get_variables(self: openvino._pyopenvino.Model) list[openvino._pyopenvino.op.util.Variable] #
Return a list of model’s variables.
- Returns:
a list of model’s variables.
- Return type:
List[op.util.Variable]
- has_rt_info(*args, **kwargs)#
Overloaded function.
has_rt_info(self: openvino._pyopenvino.Model, path: list) -> bool
Checks if given path exists in runtime info of the model.
- param path:
List of strings which defines a path to runtime info.
- type path:
List[str]
- return:
True if path exists, otherwise False.
- rtype:
bool
has_rt_info(self: openvino._pyopenvino.Model, path: str) -> bool
Checks if given path exists in runtime info of the model.
- param path:
List of strings which defines a path to runtime info.
- type path:
str
- return:
True if path exists, otherwise False.
- rtype:
bool
- input(*args, **kwargs)#
Overloaded function.
input(self: openvino._pyopenvino.Model) -> ov::Output<ov::Node>
input(self: openvino._pyopenvino.Model, index: int) -> ov::Output<ov::Node>
input(self: openvino._pyopenvino.Model, tensor_name: str) -> ov::Output<ov::Node>
input(self: openvino._pyopenvino.Model) -> ov::Output<ov::Node const>
input(self: openvino._pyopenvino.Model, index: int) -> ov::Output<ov::Node const>
input(self: openvino._pyopenvino.Model, tensor_name: str) -> ov::Output<ov::Node const>
- property inputs#
- is_dynamic(self: openvino._pyopenvino.Model) bool #
Returns true if any of the op’s defined in the model contains partial shape.
- Return type:
bool
- property name#
- output(*args, **kwargs)#
Overloaded function.
output(self: openvino._pyopenvino.Model) -> ov::Output<ov::Node>
output(self: openvino._pyopenvino.Model, index: int) -> ov::Output<ov::Node>
output(self: openvino._pyopenvino.Model, tensor_name: str) -> ov::Output<ov::Node>
output(self: openvino._pyopenvino.Model) -> ov::Output<ov::Node const>
output(self: openvino._pyopenvino.Model, index: int) -> ov::Output<ov::Node const>
output(self: openvino._pyopenvino.Model, tensor_name: str) -> ov::Output<ov::Node const>
- property outputs#
- property parameters#
Return the model parameters.
- Returns:
a list of model’s parameters.
- Return type:
List[op.Parameter]
- remove_parameter(self: openvino._pyopenvino.Model, parameter: openvino._pyopenvino.op.Parameter) None #
Delete Parameter node from the list of parameters. Method will not delete node from graph. You need to replace Parameter with other operation manually.
Attention: Indexing of parameters can be changed.
Possible use of method is to replace input by variable. For it the following steps should be done: * Parameter node should be replaced by ReadValue * call remove_parameter(param) to remove input from the list * check if any parameter indexes are saved/used somewhere, update it for all inputs because indexes can be changed * call graph validation to check all changes
- Parameters:
parameter (op.Parameter) – Parameter node to delete.
- remove_result(self: openvino._pyopenvino.Model, result: openvino._pyopenvino.op.Result) None #
Delete Result node from the list of results. Method will not delete node from graph.
- Parameters:
result (op.Result) – Result node to delete.
- remove_sink(self: openvino._pyopenvino.Model, sink: object) None #
Delete sink node from the list of sinks. Method doesn’t delete node from graph.
- Parameters:
sink (openvino.runtime.Node) – Sink to delete.
- remove_variable(self: openvino._pyopenvino.Model, variable: openvino._pyopenvino.op.util.Variable) None #
Delete variable from the list of variables. Method doesn’t delete nodes that used this variable from the graph.
- Parameters:
variable (op.util.Variable) – Variable to delete.
- replace_parameter(self: openvino._pyopenvino.Model, parameter_index: int, parameter: openvino._pyopenvino.op.Parameter) None #
Replace the parameter_index parameter of the model with parameter
All users of the parameter_index parameter are redirected to parameter , and the parameter_index entry in the model parameter list is replaced with parameter
- Parameters:
parameter_index (int) – The index of the parameter to replace.
parameter (op.Parameter) – The parameter to substitute for the parameter_index parameter.
- reshape(*args, **kwargs)#
Overloaded function.
reshape(self: openvino._pyopenvino.Model, partial_shape: openvino._pyopenvino.PartialShape, variables_shapes: dict = {}) -> None
Reshape model input.
The allowed types of keys in the variables_shapes dictionary is str. The allowed types of values in the variables_shapes are:
openvino.runtime.PartialShape
list consisting of dimensions
tuple consisting of dimensions
str, string representation of openvino.runtime.PartialShape
When list or tuple are used to describe dimensions, each dimension can be written in form:
non-negative int which means static value for the dimension
(2) [min, max], dynamic dimension where min specifies lower bound and max specifies upper bound; the range includes both min and max; using -1 for min or max means no known bound (3) (min, max), the same as above (4) -1 is a dynamic dimension without known bounds (4) openvino.runtime.Dimension (5) str using next syntax:
‘?’ - to define fully dynamic dimension ‘1’ - to define dimension which length is 1 ‘1..10’ - to define bounded dimension ‘..10’ or ‘1..’ to define dimension with only lower or only upper limit
GIL is released while running this function.
- param partial_shape:
New shape.
- type partial_shape:
openvino.runtime.PartialShape
- param variables_shapes:
New shapes for variables
- type variables_shapes:
Dict[keys, values]
:return : void
reshape(self: openvino._pyopenvino.Model, partial_shape: list, variables_shapes: dict = {}) -> None
Reshape model input.
The allowed types of keys in the variables_shapes dictionary is str. The allowed types of values in the variables_shapes are:
openvino.runtime.PartialShape
list consisting of dimensions
tuple consisting of dimensions
str, string representation of openvino.runtime.PartialShape
When list or tuple are used to describe dimensions, each dimension can be written in form:
non-negative int which means static value for the dimension
(2) [min, max], dynamic dimension where min specifies lower bound and max specifies upper bound; the range includes both min and max; using -1 for min or max means no known bound (3) (min, max), the same as above (4) -1 is a dynamic dimension without known bounds (4) openvino.runtime.Dimension (5) str using next syntax:
‘?’ - to define fully dynamic dimension ‘1’ - to define dimension which length is 1 ‘1..10’ - to define bounded dimension ‘..10’ or ‘1..’ to define dimension with only lower or only upper limit
GIL is released while running this function.
- param partial_shape:
New shape.
- type partial_shape:
list
- param variables_shapes:
New shapes for variables
- type variables_shapes:
Dict[keys, values]
:return : void
reshape(self: openvino._pyopenvino.Model, partial_shape: tuple, variables_shapes: dict = {}) -> None
Reshape model input.
The allowed types of keys in the variables_shapes dictionary is str. The allowed types of values in the variables_shapes are:
openvino.runtime.PartialShape
list consisting of dimensions
tuple consisting of dimensions
str, string representation of openvino.runtime.PartialShape
When list or tuple are used to describe dimensions, each dimension can be written in form:
non-negative int which means static value for the dimension
(2) [min, max], dynamic dimension where min specifies lower bound and max specifies upper bound; the range includes both min and max; using -1 for min or max means no known bound (3) (min, max), the same as above (4) -1 is a dynamic dimension without known bounds (4) openvino.runtime.Dimension (5) str using next syntax:
‘?’ - to define fully dynamic dimension ‘1’ - to define dimension which length is 1 ‘1..10’ - to define bounded dimension ‘..10’ or ‘1..’ to define dimension with only lower or only upper limit
GIL is released while running this function.
- param partial_shape:
New shape.
- type partial_shape:
tuple
- param variables_shapes:
New shapes for variables
- type variables_shapes:
Dict[keys, values]
:return : void
reshape(self: openvino._pyopenvino.Model, partial_shape: str, variables_shapes: dict = {}) -> None
Reshape model input.
The allowed types of keys in the variables_shapes dictionary is str. The allowed types of values in the variables_shapes are:
openvino.runtime.PartialShape
list consisting of dimensions
tuple consisting of dimensions
str, string representation of openvino.runtime.PartialShape
When list or tuple are used to describe dimensions, each dimension can be written in form:
non-negative int which means static value for the dimension
(2) [min, max], dynamic dimension where min specifies lower bound and max specifies upper bound; the range includes both min and max; using -1 for min or max means no known bound (3) (min, max), the same as above (4) -1 is a dynamic dimension without known bounds (4) openvino.runtime.Dimension (5) str using next syntax:
‘?’ - to define fully dynamic dimension ‘1’ - to define dimension which length is 1 ‘1..10’ - to define bounded dimension ‘..10’ or ‘1..’ to define dimension with only lower or only upper limit
GIL is released while running this function.
- param partial_shape:
New shape.
- type partial_shape:
str
- param variables_shapes:
New shapes for variables
- type variables_shapes:
Dict[keys, values]
:return : void
reshape(self: openvino._pyopenvino.Model, partial_shapes: dict, variables_shapes: dict = {}) -> None
Reshape model inputs.
The allowed types of keys in the partial_shapes dictionary are:
int, input index
str, input tensor name
openvino.runtime.Output
The allowed types of values in the partial_shapes are:
openvino.runtime.PartialShape
list consisting of dimensions
tuple consisting of dimensions
str, string representation of openvino.runtime.PartialShape
When list or tuple are used to describe dimensions, each dimension can be written in form:
non-negative int which means static value for the dimension
[min, max], dynamic dimension where min specifies lower bound and max specifies upper bound; the range includes both min and max; using -1 for min or max means no known bound
(min, max), the same as above
(4) -1 is a dynamic dimension without known bounds (4) openvino.runtime.Dimension (5) str using next syntax:
‘?’ - to define fully dynamic dimension ‘1’ - to define dimension which length is 1 ‘1..10’ - to define bounded dimension ‘..10’ or ‘1..’ to define dimension with only lower or only upper limit
The allowed types of keys in the variables_shapes dictionary is str. The allowed types of values in the variables_shapes are:
openvino.runtime.PartialShape
list consisting of dimensions
tuple consisting of dimensions
str, string representation of openvino.runtime.PartialShape
When list or tuple are used to describe dimensions, each dimension can be written in form:
non-negative int which means static value for the dimension
(2) [min, max], dynamic dimension where min specifies lower bound and max specifies upper bound; the range includes both min and max; using -1 for min or max means no known bound (3) (min, max), the same as above (4) -1 is a dynamic dimension without known bounds (4) openvino.runtime.Dimension (5) str using next syntax:
‘?’ - to define fully dynamic dimension ‘1’ - to define dimension which length is 1 ‘1..10’ - to define bounded dimension ‘..10’ or ‘1..’ to define dimension with only lower or only upper limit
Reshape model inputs.
GIL is released while running this function.
- param partial_shapes:
New shapes.
- type partial_shapes:
Dict[keys, values]
- param variables_shapes:
New shapes for variables
- type variables_shapes:
Dict[keys, values]
- property result#
Return single result.
- Returns:
Node object representing result.
- Return type:
- property results#
Return a list of model outputs.
- Returns:
a list of model’s result nodes.
- Return type:
List[op.Result]
- property rt_info#
- set_friendly_name(self: openvino._pyopenvino.Model, name: str) None #
Sets a friendly name for a model. This does not overwrite the unique name of the model and is retrieved via get_friendly_name(). Used mainly for debugging.
- Parameters:
name (str) – String to set as the friendly name.
- set_rt_info(*args, **kwargs)#
Overloaded function.
set_rt_info(self: openvino._pyopenvino.Model, obj: object, path: list) -> None
Add value inside runtime info
- param obj:
value for the runtime info
- type obj:
py:object
- param path:
List of strings which defines a path to runtime info.
- type path:
List[str]
set_rt_info(self: openvino._pyopenvino.Model, obj: object, path: str) -> None
Add value inside runtime info
- param obj:
value for the runtime info
- type obj:
Any
- param path:
String which defines a path to runtime info.
- type path:
str
- property sinks#
Return a list of model’s sinks.
- Returns:
a list of model’s sinks.
- Return type:
List[openvino.runtime.Node]
- validate_nodes_and_infer_types(self: openvino._pyopenvino.Model) None #
- property variables#
Return a list of model’s variables.
- Returns:
a list of model’s variables.
- Return type:
List[op.util.Variable]