Poplar and PopLibs
Scatter.hpp
Go to the documentation of this file.
1// Copyright (c) 2019 Graphcore Ltd. All rights reserved.
8#ifndef popops_Scatter_hpp
9#define popops_Scatter_hpp
10#include <poplar/Graph.hpp>
11#include <poplar/Program.hpp>
12
13namespace popops {
14
44void scatter(poplar::Graph &graph, const poplar::Tensor &operand,
45 const poplar::Tensor &indices, const poplar::Tensor &updates,
46 std::size_t indexVectorDim, std::vector<unsigned> updateWindowDims,
47 std::vector<std::size_t> insertWindowDims,
48 std::vector<unsigned> scatterDimsToOperandDims,
50 const poplar::DebugContext &debugContext = {});
51
52using UpdateComputationFunc = std::function<poplar::Tensor(
55
90void scatter(poplar::Graph &graph, const poplar::Tensor &operand,
91 const poplar::Tensor &indices, const poplar::Tensor &updates,
92 std::size_t indexVectorDim, std::vector<unsigned> updateWindowDims,
93 std::vector<std::size_t> insertWindowDims,
94 std::vector<unsigned> scatterDimsToOperandDims,
95 UpdateComputationFunc &updateComputation,
97 const poplar::DebugContext &debugContext = {});
98
99} // namespace popops
100
101#endif // popops_DynamicSlice_hpp
DebugContext gathers the common external parameters of the context of an operation.
Definition: DebugContext.hpp:221
This class represents a graph program to be executed on the IPU.
Definition: Graph.hpp:52
A reference to a subset of tensor elements.
Definition: Tensor.hpp:38
Program that executes a sequence of programs.
Definition: Program.hpp:77
Common functions, such as elementwise and reductions.
Definition: AllTrue.hpp:15
void scatter(poplar::Graph &graph, const poplar::Tensor &operand, const poplar::Tensor &indices, const poplar::Tensor &updates, std::size_t indexVectorDim, std::vector< unsigned > updateWindowDims, std::vector< std::size_t > insertWindowDims, std::vector< unsigned > scatterDimsToOperandDims, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
The scatter operation generates a result which is the value of the input array operand,...