Zero

#include <popops/Zero.hpp>

Set elements of tensor to zero.

namespace popops

Common functions, such as elementwise and reductions.

Functions

void zero(poplar::Graph &graph, poplar::Tensor t, const std::vector<poplar::Interval> &tileRegions, unsigned tile, poplar::ComputeSet zeroCS)

Append vertices to compute set zeroCS which zeroes elements in tileRegions of tensor t which reside on tile.

Parameters
  • graph – The graph that the operation will be added to.

  • t – The tensor whose elements are to be set to zero.

  • tileRegions – The region mapping of the tensor on tile.

  • tile – The tile which the regions relate to.

  • zeroCS – The compute set to add the operation to.

void zero(poplar::Graph &graph, const poplar::Tensor &t, unsigned tile, poplar::ComputeSet zeroCS)

Append vertices to compute set zeroCS which zeroes all elements of tensor t which reside on tile.

Parameters
  • graph – The graph that the operation will be added to.

  • t – The tensor whose elements are to be set to zero.

  • tile – The tile which the tensor is mapped to.

  • zeroCS – The compute set to add the operation to.

void zero(poplar::Graph &graph, const poplar::Tensor &t, const std::vector<std::vector<poplar::Interval>> &mapping, poplar::ComputeSet zeroCS)

Append vertices to compute set zeroCS which zeroes elements in mapping of tensor t which reside on tiles represented with mapping.

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). For example, mapping[0] is tile 0’s region mapping for tensor t.

  • zeroCS – The compute set to add the operation to.

void zero(poplar::Graph &graph, const poplar::Tensor &t, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {})

Append programs to program sequence prog which zeroes all elements of tensor t.

Parameters
  • graph – The graph that the operation will be added to.

  • t – The tensor whose elements are to be set to zero.

  • prog – The Poplar program sequence to append the operation to.

  • debugContext – Optional debug information.