Fill
#include <popops/Fill.hpp>
Functions to fill tensors with values.
Supported fillValue types are FLOAT, HALF, INT and UNSIGNED_INT.
-
namespace popops
Common functions, such as elementwise and reductions.
Functions
-
template<typename FillValueType>
void fill(poplar::Graph &graph, poplar::Tensor t, const std::vector<poplar::Interval> &tileRegions, unsigned tile, poplar::ComputeSet fillCS, FillValueType fillValue) Appends vertices to
fillCS
which fills elements intileRegions
oft
which reside on tiletile
.- Parameters
graph – The graph that the operation will be added to.
t – The tensor whose elements are to be set to zero.
tileRegions – Region mapping of the tensor on
tile
.tile – Tile which the regions relate to.
fillCS – Compute set to add the operation into.
fillValue – The value to fill
t
with.
-
template<typename FillValueType>
void fill(poplar::Graph &graph, const poplar::Tensor &t, unsigned tile, poplar::ComputeSet fillCS, FillValueType fillValue) Appends vertices to
fillCS
which fills all elements oft
which reside on tiletile
.- Parameters
graph – The graph that the operation will be added to.
t – The tensor whose elements are to be set to zero.
tile – Tile on which the tensor is mapped to.
fillCS – Compute set to add the operation into.
fillValue – The value to fill
t
with.
-
template<typename FillValueType>
void fill(poplar::Graph &graph, const poplar::Tensor &t, const std::vector<std::vector<poplar::Interval>> &mapping, poplar::ComputeSet fillCS, FillValueType fillValue) Appends vertices to
fillCS
which fills elements inmapping
oft
which reside on tiles represented withmapping
.- Parameters
graph – The graph that the operation will be added to.
t – The tensor whose elements are to be set to zero.
mapping – The tensor’s region mapping per tile. Each element describes a region mapping of a tile (ordered). That is,
mapping
[0] is the region oft
mapped onto tile 0.fillCS – Compute set to add the operation into.
fillValue – The value to fill
t
with.
-
template<typename FillValueType>
void fill(poplar::Graph &graph, const poplar::Tensor &t, poplar::program::Sequence &prog, FillValueType fillValue, const poplar::DebugContext &debugContext = {}) Appends programs to
prog
which fills all elements of the tensort
with a value offillValue
.Note
The type of
fillValue
must be compatible with the element type oft
.- Parameters
graph – The graph that the operation will be added to.
t – The tensor whose elements are to be filled.
prog – Poplar program sequence to append the operation onto.
fillValue – The value to fill
t
with.debugContext – Optional debug information.
-
template<typename FillValueType>