ngraph.loop¶
- ngraph.loop(trip_count: Union[_pyngraph.Node, int, float, numpy.ndarray], execution_condition: Union[_pyngraph.Node, int, float, numpy.ndarray], inputs: List[_pyngraph.Node], graph_body: ngraph.utils.tensor_iterator_types.GraphBody, slice_input_desc: List[ngraph.utils.tensor_iterator_types.TensorIteratorSliceInputDesc], merged_input_desc: List[ngraph.utils.tensor_iterator_types.TensorIteratorMergedInputDesc], invariant_input_desc: List[ngraph.utils.tensor_iterator_types.TensorIteratorInvariantInputDesc], body_output_desc: List[ngraph.utils.tensor_iterator_types.TensorIteratorBodyOutputDesc], concat_output_desc: List[ngraph.utils.tensor_iterator_types.TensorIteratorConcatOutputDesc], body_condition_output_idx: int, current_iteration_input_idx: int = - 1, name: Optional[str] = None) _pyngraph.Node ¶
Perform recurrent execution of the network described in the body, iterating through the data.
- Parameters
trip_count – A scalar or 1D tensor with 1 element specifying maximum number of iterations.
execution_condition – A scalar or 1D tensor with 1 element specifying whether to execute the first iteration or not.
inputs – The provided to TensorIterator operator.
graph_body – The graph representing the body we execute.
slice_input_desc – The descriptors describing sliced inputs, that is nodes representing tensors we iterate through, processing single data slice in one iteration.
merged_input_desc – The descriptors describing merged inputs, that is nodes representing variables with initial value at first iteration, which may be changing through iterations.
invariant_input_desc – The descriptors describing invariant inputs, that is nodes representing variable with persistent value through all iterations.
body_output_desc – The descriptors describing body outputs from specified iteration.
concat_output_desc – The descriptors describing specified output values through all the iterations concatenated into one node.
body_condition_output_idx – Determines the purpose of the corresponding result in the graph_body. This result will determine the dynamic exit condition. If the value of this result is False, then iterations stop.
current_iteration_input_idx – Determines the purpose of the corresponding parameter in the graph_body. This parameter will be used as an iteration counter. Optional.
- Returns
The new node which performs Loop.