TensorCloneMethod
#include <poplar/TensorCloneMethod.hpp>
-
namespace poplar
Poplar classes and functions.
A VectorList is a list of vectors with a specific layout and with the usage semantics of a 2D vector.
A 1D vector must be laid out in a contiguous memory region. A 2D vector is a vector of 1D vectors. Each of these 1D vectors that make up a 2D vector is called a “sub-vector” for the remainder of this document. The elements of a 2D vector can be accessed by indexing the 2D vector along the
outer
andinner
dimensions asA[outer][inner]
.The following two categories of layouts are supported:
VectorListLayout::DELTANELEMENTS
is a memory efficient 2D vector layout. For legacy systemsVectorListLayout::DELTAN
served a similar purpose. Each sub-vector must be laid out as a contiguous memory region but the sub-vectors may may not be laid out contiguous with respect to each other in memory. Each sub-vector may have a different length.VectorListLayout::ONE_PTR
and otherVectorListLayout
layouts that are prefixed by SCALED_PTR are for Poplar runtime use only.
Enums
-
enum class TensorCloneMethod
Define behaviour when a Tensor is cloned.
See also
Values:
-
enumerator PRESERVE_ORDER_AND_ALIASES
Preserve the ordering and aliasing within the original tensor reference.
-
enumerator CREATE_NEW_ORDER
Create a new tensor with natural ordering based on the dimensions of the cloned tensor (in the same way as poplar::Graph::addVariable()).
-
enumerator PRESERVE_ORDER_UNLESS_ALIASES
Preserve the ordering of the original tensor unless it contains aliases.
In the case of aliases, create a new tensor ordering and duplicate the aliased elements.
-
enumerator GATHER_AND_PRESERVE_TILE_ORDER_AND_ALIASES
Gather elements of the underlying variables that are mapped to the same tile so they form one contiguous region on the tile in the cloned tensor.
Contiguous regions on the tile and the aliasing of elements are preserved.
-
enumerator PRESERVE_ORDER_AND_ALIASES
-
enum class TensorCloneDuplicationMethod
Define behaviour when a Tensor is cloned and duplicated using Graph::cloneN.
Throws an error if DUPLICATE_BY_TILE_CONTIGUOUS_REGION and a new order needs to be created (either via TensorCloneMethod::CREATE_NEW_ORDER or TensorCloneMethod::PRESERVE_ORDER_UNLESS_ALIASES)
See also
See also
Values:
-
enumerator DUPLICATE_BY_OUTER_DIMENSION
-
enumerator DUPLICATE_BY_TILE_CONTIGUOUS_REGION
< The multiple clones are concatenated in their outermost dimension.
This means that the result is the same as
concat(clone1, clone2, ..., cloneN)
. There is no guarantee of any ordering constraints in memory between the clones.
-
enumerator DUPLICATE_BY_OUTER_DIMENSION
Functions
-
std::string toString(const TensorCloneMethod &method)
-
std::string toString(const TensorCloneDuplicationMethod &method)