_pyngraph.Function¶
- class _pyngraph.Function¶
Bases:
pybind11_builtins.pybind11_object
ngraph.impl.Function wraps ngraph::Function
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: _pyngraph.Function, results: List[_pyngraph.op.Result], sinks: List[_pyngraph.Node], parameters: List[_pyngraph.op.Parameter], name: str) -> None
Create user-defined Function which is a representation of a model.
- resultsList[op.Result]
List of results.
- sinksList[Node]
List of Nodes to be used as Sinks (e.g. Assign ops).
- parametersList[op.Parameter]
List of parameters.
- namestr
String to set as function’s friendly name.
__init__(self: _pyngraph.Function, results: List[_pyngraph.Node], parameters: List[_pyngraph.op.Parameter], name: str) -> None
Create user-defined Function which is a representation of a model.
- resultsList[Node]
List of Nodes to be used as results.
- parametersList[op.Parameter]
List of parameters.
- namestr
String to set as function’s friendly name.
__init__(self: _pyngraph.Function, result: _pyngraph.Node, parameters: List[_pyngraph.op.Parameter], name: str) -> None
Create user-defined Function which is a representation of a model.
- resultsNode
Node to be used as result.
- parametersList[op.Parameter]
List of parameters.
- namestr
String to set as function’s friendly name.
Methods
__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().
from_capsule
(arg0)get_friendly_name
(self)Gets the friendly name for a function.
get_name
(self)Get the unique name of the function.
get_ops
(self)Return ops used in the function.
get_ordered_ops
(self)Return ops used in the function in topological order.
get_output_element_type
(self, i)Return the element type of output i
get_output_op
(self, i)Return the op that generates output i
get_output_partial_shape
(self, i)Return the partial shape of element i
get_output_shape
(self, i)Return the shape of element i
get_output_size
(self)Return the number of outputs for the function.
get_parameters
(self)Return the function parameters.
get_result
(self)Return single result.
get_results
(self)Return a list of function outputs.
is_dynamic
(self)Returns true if any of the op's defined in the function contains partial shape.
set_friendly_name
(self, name)Sets a friendly name for a function.
to_capsule
(arg0)Attributes
- __class__¶
alias of
pybind11_builtins.pybind11_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: _pyngraph.Function, results: List[_pyngraph.op.Result], sinks: List[_pyngraph.Node], parameters: List[_pyngraph.op.Parameter], name: str) -> None
Create user-defined Function which is a representation of a model.
- resultsList[op.Result]
List of results.
- sinksList[Node]
List of Nodes to be used as Sinks (e.g. Assign ops).
- parametersList[op.Parameter]
List of parameters.
- namestr
String to set as function’s friendly name.
__init__(self: _pyngraph.Function, results: List[_pyngraph.Node], parameters: List[_pyngraph.op.Parameter], name: str) -> None
Create user-defined Function which is a representation of a model.
- resultsList[Node]
List of Nodes to be used as results.
- parametersList[op.Parameter]
List of parameters.
- namestr
String to set as function’s friendly name.
__init__(self: _pyngraph.Function, result: _pyngraph.Node, parameters: List[_pyngraph.op.Parameter], name: str) -> None
Create user-defined Function which is a representation of a model.
- resultsNode
Node to be used as result.
- parametersList[op.Parameter]
List of parameters.
- namestr
String to set as function’s friendly name.
- __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: _pyngraph.Function) 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).
- property friendly_name¶
- static from_capsule(arg0: object) _pyngraph.Function ¶
- get_friendly_name(self: _pyngraph.Function) str ¶
Gets the friendly name for a function. If no friendly name has been set via set_friendly_name then the function’s unique name is returned.
- get_friendly_namestr
String with a friendly name of the function.
- get_name(self: _pyngraph.Function) str ¶
Get the unique name of the function.
- get_namestr
String with a name of the function.
- get_ops(self: _pyngraph.Function) List[_pyngraph.Node] ¶
Return ops used in the function.
- get_opsList[Node]
List of Nodes representing ops used in function.
- get_ordered_ops(self: _pyngraph.Function) List[_pyngraph.Node] ¶
Return ops used in the function in topological order.
- get_ordered_opsList[Node]
List of sorted Nodes representing ops used in function.
- get_output_element_type(self: _pyngraph.Function, i: int) _pyngraph.Type ¶
Return the element type of output i
- iint
output index
- get_output_opType
Type object of output i
- get_output_op(self: _pyngraph.Function, i: int) _pyngraph.Node ¶
Return the op that generates output i
- iint
output index
- get_output_opNode
Node object that generates output i
- get_output_partial_shape(self: _pyngraph.Function, i: int) _pyngraph.PartialShape ¶
Return the partial shape of element i
- iint
element index
- get_output_partial_shapePartialShape
PartialShape object of element i
- get_output_shape(self: _pyngraph.Function, i: int) _pyngraph.Shape ¶
Return the shape of element i
- iint
element index
- get_output_shapeShape
Shape object of element i
- get_output_size(self: _pyngraph.Function) int ¶
Return the number of outputs for the function.
- get_output_sizeint
Number of outputs.
- get_parameters(self: _pyngraph.Function) List[_pyngraph.op.Parameter] ¶
Return the function parameters.
- get_parametersParameterVector
ParameterVector containing function parameters.
- get_result(self: _pyngraph.Function) _pyngraph.Node ¶
Return single result.
- get_resultNode
Node object representing result.
- get_results(self: _pyngraph.Function) List[_pyngraph.op.Result] ¶
Return a list of function outputs.
- get_resultsResultVector
ResultVector containing function parameters.
- is_dynamic(self: _pyngraph.Function) bool ¶
Returns true if any of the op’s defined in the function contains partial shape.
is_dynamic : bool
- property name¶
- set_friendly_name(self: _pyngraph.Function, name: str) None ¶
Sets a friendly name for a function. This does not overwrite the unique name of the function and is retrieved via get_friendly_name(). Used mainly for debugging.
- namestr
String to set as the friendly name.
- static to_capsule(arg0: _pyngraph.Function) capsule ¶