SplineWeighting
#include <popops/SplineWeighting.hpp>
SplineWeighting operation.
-
namespace popops
Common functions, such as elementwise and reductions.
Functions
-
poplar::Tensor splineWeighting(poplar::Graph &graph, const poplar::Tensor &input, const poplar::Tensor &weight, const poplar::Tensor &basis, const poplar::Tensor &weightIndex, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {})
Calculate spline weighting.
That is, given a two-dimensional
input
tensor with shape numEdges * numInputChannels, three-dimensionalweight
tensor and two-dimensionalbasis
andweightIndex
tensors, calculate output features weighted by a continuous B-spline kernel functions.basis
andweightIndex
tensors are outputs from SplineBasis operation with shape numEdges * numSplines.weight
tensor shape must be numEdges * numInputChannels * numOutputChannels andoutput
tensor shape is numEdges * numOutputChannels.- Parameters
graph – The graph to add any required vertices.
input – Input features tensor.
weight – Weight tensor.
basis – B-spline basis functions coefficients tensor.
weightIndex – Tensor with weight indices for spline coefficients.
prog – Sequence to which the programs that perform the calculations are added.
debugContext – Optional debug information.
- Throws
poputil::poplibs_error – If
input
basis
orweightIndex
are not two-dimensional.poputil::poplibs_error – If
weight
tensor is not three-dimensional.poputil::poplibs_error – If elements of
input
are not float or half type.poputil::poplibs_error – If either elements of
weight
basis
oroutput
not have the same type as elements ofinput
tensor.poputil::poplibs_error – If elements of
weightIndex
tensor are not integer type.poputil::poplibs_error – If either size of dimension 0 of
basis
or dimension 0 ofweightIndex
or dimension 0 ofoutput
do not match size of dimension 0input
tensor.poputil::poplibs_error – If size of dimension 1 of
basis
does not match the size of dimension 1 ofweightIndex
tensor.poputil::poplibs_error – If size of dimension 1 of
weight
does not match the size of dimension 1 ofinput
tensor.poputil::poplibs_error – If size of dimension 2 of
weight
does not match the size of dimension 1 ofoutput
tensor.
- Returns
An output tensor with features weighted by a continuous B-spline kernel functions
-
poplar::Tensor splineWeighting(poplar::Graph &graph, const poplar::Tensor &input, const poplar::Tensor &weight, const poplar::Tensor &basis, const poplar::Tensor &weightIndex, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {})