_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
__init__
(*args, **kwargs)Overloaded function.
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
friendly_name
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
-
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¶
-