Poplar and PopLibs
Encoding.hpp
Go to the documentation of this file.
1// Copyright (c) 2018 Graphcore Ltd. All rights reserved.
8#ifndef popops_Encoding_hpp
9#define popops_Encoding_hpp
10
11#include "EncodingConstants.hpp"
12#include "poplar/Graph.hpp"
13#include "poplar/Tensor.hpp"
14#include "poplar/Type.hpp"
15#include <string>
16
17namespace popops {
18
42void encodeOneHot(poplar::Graph &graph, const poplar::Tensor &indices,
43 const poplar::Tensor &encoded,
45 const poplar::DebugContext &debugContext = {});
46
72void encodeOneHot(poplar::Graph &graph, const poplar::Tensor &indices,
73 const poplar::Tensor &encoded,
75 const poplar::Tensor &off,
76 const poplar::DebugContext &debugContext = {});
77
94void iota(poplar::Graph &graph, const poplar::Tensor &t, unsigned startInteger,
96 const poplar::DebugContext &debugContext = {});
97
114void iota(poplar::Graph &graph, const poplar::Tensor &t, int startInteger,
116 const poplar::DebugContext &debugContext = {});
117
118} // end namespace popops
119
120#endif // popops_Encoding_hpp
Constants used by encoding functions.
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 encodeOneHot(poplar::Graph &graph, const poplar::Tensor &indices, const poplar::Tensor &encoded, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Encode a given set of indices as a set of one-hot vectors per-index with a hot element at that index.
void iota(poplar::Graph &graph, const poplar::Tensor &t, unsigned startInteger, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Fill a tensor with a right-open range of unsigned integers: [startInteger, startInteger + length),...