Poplar and PopLibs
poplar::FieldRef Class Reference

A reference to a field within a vertex instance. More...

#include <GraphElements.hpp>

Public Member Functions

FieldRef operator[] (std::size_t index) const
 Access an element of a vector field. More...
 

Detailed Description

A reference to a field within a vertex instance.

This type provides a way to address fields (inputs or internal state) within a vertex. FieldRef's are normally obtained using VertexRef::operator[](StringRef fieldName), for example:

VertexRef vertex = graph.addVertex(...);
FieldRef input = vertex["input"];
graph.connect(input, ...);

A FieldRef can also be indexed, for example:

FieldRef input_5 = vertex["input"][5];

This is used when a field is a list of regions, for example a Vector<Input<Vector<...>>> or an Input<VectorList<...>>.

Member Function Documentation

◆ operator[]()

FieldRef poplar::FieldRef::operator[] ( std::size_t  index) const
inline

Access an element of a vector field.

Subscript a vector field to access the element at position index.

Parameters
indexThe subscript of the field
Returns
A reference to the field.

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