Data Structures | Public Member Functions | Static Public Attributes
ngraph::op::v0::TensorIterator Class Reference

Iterate a body over tensors, accumulating into tensors. More...

#include <tensor_iterator.hpp>

Inheritance diagram for ngraph::op::v0::TensorIterator:
Inheritance graph
[legend]
Collaboration diagram for ngraph::op::v0::TensorIterator:
Collaboration graph
[legend]

Data Structures

class  BodyOutputDescription
 Produces an output from a specific iteration. More...
 
class  ConcatOutputDescription
 Produces an output by concatenating an output from each iteration. More...
 
class  InputDescription
 Describes a connection between a TensorIterator input and the body. More...
 
class  InvariantInputDescription
 
class  MergedInputDescription
 Describes a body input initialized from a TensorIterator input on the first iteration, and then a body output thereafter. More...
 
class  OutputDescription
 Describes how a TensorIterator output is produced from the body. More...
 
class  SliceInputDescription
 Describes a body input formed from slices of an input to TensorIterator. More...
 

Public Member Functions

const NodeTypeInfo & get_type_info () const override
 
bool visit_attributes (AttributeVisitor &visitor) override
 
 TensorIterator (const OutputVector &values)
 
void set_sliced_input (const std::shared_ptr< Parameter > &parameter, const Output< Node > &value, int64_t start, int64_t stride, int64_t part_size, int64_t end, int64_t axis)
 Indicate that a body parameter comes from slices of a value. More...
 
void set_merged_input (const std::shared_ptr< Parameter > &body_parameter, const Output< Node > &initial_value, const Output< Node > &successive_value)
 Indicates that a body parameter has an initial value in the first iteration and computed value thereafter. More...
 
void set_invariant_input (const std::shared_ptr< Parameter > &body_parameter, const Output< Node > &value)
 Indicates that a body parameter has an invariant value during iteration that may depend on values computed outside of the iteration. More...
 
Output< Node > get_iter_value (const Output< Node > &body_value, int64_t iteration)
 Gets a value for a particular iteration point. More...
 
Output< Node > get_concatenated_slices (const Output< Node > &value, int64_t start, int64_t stride, int64_t part_size, int64_t end, int64_t axis)
 Concatenates slices from all iterations. More...
 
std::shared_ptr< Node > clone_with_new_inputs (const OutputVector &new_args) const override
 
OutputVector decompose_op () const override
 
std::shared_ptr< Function > get_body () const
 
void set_body (const std::shared_ptr< Function > &body)
 
const std::vector< std::shared_ptr< InputDescription > > & get_input_descriptions () const
 
std::vector< std::shared_ptr< InputDescription > > & get_input_descriptions ()
 
const std::vector< std::shared_ptr< OutputDescription > > & get_output_descriptions () const
 
std::vector< std::shared_ptr< OutputDescription > > & get_output_descriptions ()
 
virtual void validate_and_infer_types () override
 
void revalidate_and_infer_types_for_body_ops ()
 
int64_t get_num_iterations () const
 
void set_num_iterations (int64_t num_iterations)
 

Static Public Attributes

static constexpr NodeTypeInfo type_info {"TensorIterator", 0}
 

Detailed Description

Iterate a body over tensors, accumulating into tensors.

Member Function Documentation

◆ get_body()

std::shared_ptr<Function> ngraph::op::v0::TensorIterator::get_body ( ) const
inline
Returns
the body of the iteration

◆ get_concatenated_slices()

Output<Node> ngraph::op::v0::TensorIterator::get_concatenated_slices ( const Output< Node > &  value,
int64_t  start,
int64_t  stride,
int64_t  part_size,
int64_t  end,
int64_t  axis 
)

Concatenates slices from all iterations.

Parameters
valueThe value supplying slice values from each iteration.
startFirst index on axis of the slicing
strideStepping of the slice
part_sizeSize of the slice on axis
endThe last index on axis of the slicing
axisThe axis to slice along
Returns
The concatenated slices.

◆ get_input_descriptions() [1/2]

std::vector<std::shared_ptr<InputDescription> >& ngraph::op::v0::TensorIterator::get_input_descriptions ( )
inline
Returns
a reference to the input descriptions. Can add input descriptions before validation.

◆ get_input_descriptions() [2/2]

const std::vector<std::shared_ptr<InputDescription> >& ngraph::op::v0::TensorIterator::get_input_descriptions ( ) const
inline
Returns
a reference to the input descriptions.

◆ get_iter_value()

Output<Node> ngraph::op::v0::TensorIterator::get_iter_value ( const Output< Node > &  body_value,
int64_t  iteration 
)

Gets a value for a particular iteration point.

Parameters
body_valueThe value
iterationThe iteration that supplies the value. Negative values are from the last iteration.
Returns
The iterator value.

◆ get_output_descriptions() [1/2]

std::vector<std::shared_ptr<OutputDescription> >& ngraph::op::v0::TensorIterator::get_output_descriptions ( )
inline
Returns
a reference to the output descriptions. Can add output descriptions before validation.

◆ get_output_descriptions() [2/2]

const std::vector<std::shared_ptr<OutputDescription> >& ngraph::op::v0::TensorIterator::get_output_descriptions ( ) const
inline
Returns
a reference to the output descriptions.

◆ set_body()

void ngraph::op::v0::TensorIterator::set_body ( const std::shared_ptr< Function > &  body)
inline
Parameters
bodyset the body of the iteration

◆ set_invariant_input()

void ngraph::op::v0::TensorIterator::set_invariant_input ( const std::shared_ptr< Parameter > &  body_parameter,
const Output< Node > &  value 
)

Indicates that a body parameter has an invariant value during iteration that may depend on values computed outside of the iteration.

Parameters
body_parameterThe body parameter
valueThe value supplied as an input to the block

◆ set_merged_input()

void ngraph::op::v0::TensorIterator::set_merged_input ( const std::shared_ptr< Parameter > &  body_parameter,
const Output< Node > &  initial_value,
const Output< Node > &  successive_value 
)

Indicates that a body parameter has an initial value in the first iteration and computed value thereafter.

Parameters
[in]body_parameterThe body parameter
initial_valueValue for the parameter in first iteration. This will be added as an input to TensorIterator.
successive_valueValue for the parameter in successive iterations. The value is what is active in the most recent completed iteration.

◆ set_sliced_input()

void ngraph::op::v0::TensorIterator::set_sliced_input ( const std::shared_ptr< Parameter > &  parameter,
const Output< Node > &  value,
int64_t  start,
int64_t  stride,
int64_t  part_size,
int64_t  end,
int64_t  axis 
)

Indicate that a body parameter comes from slices of a value.

Parameters
parameterThe parameter to receive the slices
valueThe value to be sliced. This will be added as an input to TensorIterator.
startFirst index on axis of the slicing
strideStepping of the slice
part_sizeSize of the slice on axis
endThe last index on axis of the slicing
axisThe axis to slice along

The documentation for this class was generated from the following file: