Iterate a body over tensors, accumulating into tensors. More...
#include <tensor_iterator.hpp>
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 > ¶meter, 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} |
Iterate a body over tensors, accumulating into tensors.
|
inline |
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.
value | The value supplying slice values from each iteration. |
start | First index on axis of the slicing |
stride | Stepping of the slice |
part_size | Size of the slice on axis |
end | The last index on axis of the slicing |
axis | The axis to slice along |
|
inline |
|
inline |
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.
body_value | The value |
iteration | The iteration that supplies the value. Negative values are from the last iteration. |
|
inline |
|
inline |
|
inline |
body | set the body of the iteration |
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.
body_parameter | The body parameter |
value | The value supplied as an input to the block |
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.
[in] | body_parameter | The body parameter |
initial_value | Value for the parameter in first iteration. This will be added as an input to TensorIterator. | |
successive_value | Value for the parameter in successive iterations. The value is what is active in the most recent completed iteration. |
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.
parameter | The parameter to receive the slices |
value | The value to be sliced. This will be added as an input to TensorIterator. |
start | First index on axis of the slicing |
stride | Stepping of the slice |
part_size | Size of the slice on axis |
end | The last index on axis of the slicing |
axis | The axis to slice along |