8#ifndef popnn_CTCInference_hpp
9#define popnn_CTCInference_hpp
13#include <poplar/Graph.hpp>
14#include <poplar/OptionFlags.hpp>
15#include <poplar/Program.hpp>
46 unsigned batchSize,
unsigned maxTime,
unsigned numClasses,
65 const std::size_t batchSize,
66 const std::size_t maxTime,
67 const std::size_t numClasses,
94std::tuple<poplar::Tensor, poplar::Tensor, poplar::Tensor>
99 unsigned blankClass,
unsigned beamwidth,
100 unsigned topPaths,
const ctc::Plan &plan,
128std::tuple<poplar::Tensor, poplar::Tensor, poplar::Tensor>
132 unsigned beamwidth,
unsigned topPaths,
std::tuple< poplar::Tensor, poplar::Tensor, poplar::Tensor > beamSearchDecoderLogits(poplar::Graph &graph, const poplar::Tensor &logits, const poplar::Tensor &dataLengths, poplar::program::Sequence &prog, unsigned blankClass, unsigned beamwidth, unsigned topPaths, const ctc::Plan &plan, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Calculate the most likely topPaths labels and their probabilities given the input logits with lengths...
ctc::Plan plan(const poplar::Graph &graph, const poplar::Type &inType, unsigned batchSize, unsigned maxTime, unsigned numClasses, unsigned beamwidth, const poplar::OptionFlags &options={})
Create a plan for implementing the CTC Beam search inference function.
std::tuple< poplar::Tensor, poplar::Tensor, poplar::Tensor > beamSearchDecoderLogProbabilities(poplar::Graph &graph, const poplar::Tensor &logProbs, const poplar::Tensor &dataLengths, poplar::program::Sequence &prog, unsigned blankClass, unsigned beamwidth, unsigned topPaths, const ctc::Plan &plan, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Calculate the most likely topPaths labels and their probabilities given the input logProbs with lengt...
poplar::Tensor createDataInput(poplar::Graph &graph, const poplar::Type &type, const std::size_t batchSize, const std::size_t maxTime, const std::size_t numClasses, const ctc::Plan &plan, const poplar::DebugContext &debugContext={})
Create and map a data input [maxTime, batchSize, numClasses] tensor which the beam search function wi...
Support for planning Connectionist Temporal Classification (CTC) Operations.
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 set of option/value string flags to be used in various APIs.
Definition: OptionFlags.hpp:24
A reference to a subset of tensor elements.
Definition: Tensor.hpp:38
Class representing device data types.
Definition: Type.hpp:42
Program that executes a sequence of programs.
Definition: Program.hpp:77
An object representing a plan that describes how to map tensors and implement the CTC Loss or CTC Inf...
Definition: CTCPlan.hpp:19
Functions used in neural networks.
Definition: BatchNorm.hpp:14