SplineBasis
#include <popops/SplineBasis.hpp>
SplineBasis operation.
-
namespace popops
Common functions, such as elementwise and reductions.
Functions
-
void splineBasis(poplar::Graph &graph, const poplar::Tensor &pseudo, const poplar::Tensor &kernelSize, const poplar::Tensor &isOpenSpline, const poplar::Tensor &basis, const poplar::Tensor &weightIndex, unsigned degree, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {})
Calculate B-spline basis.
That is, given a two-dimensional
pseudotensor with shape numEdges * numDims and one-dimensionalkernelSizeandisOpenSplinetensors with length numDims, calculatebasistensor of shape numEdges * numSplines containing B-spline basis functions coefficients for the givendegree. TheweightIndexoutput contains weight index for each spline coefficient.- Parameters
graph – The graph to add any vertices needed for calculating
basisandweightIndexoutputs.pseudo – Pseudo coordinates, of shape numEdges * numDims.
kernelSize – One-dimensional tensor containing kernel size at each dimension of edge’s pseudo coordinates.
isOpenSpline – One-dimenstional tensor that for each dimension encodes whether open or closed B-spline basis must be used.
basis – Two-dimensional output tensor with shape numEdges * numSplines for B-spline basis functions coefficients.
weightIndex – Two-dimensional output tensor with shape numEdges * numSplines for weight indices for each spline coefficient.
prog – Sequence to which the programs that perform the calculations are added.
debugContext – Optional debug information.
- Throws
poputil::poplibs_error – If
pseudois not two-dimensional.poputil::poplibs_error – If
kernelSizeorisOpenSplineare not one-dimensional.poputil::poplibs_error – If
kernelSizeandisOpenSplinedo not have the same size as number of columns inpseudotensor.poputil::poplibs_error – If elements of
pseudoare not float or half type.poputil::poplibs_error – If elements of
kernelSizeare not integer type.poputil::poplibs_error – If elements of
isOpenSplineare not unsigned char type.poputil::poplibs_error – If degree is neither 1, 2 or 3.
-
void splineBasis(poplar::Graph &graph, const poplar::Tensor &pseudo, const poplar::Tensor &kernelSize, const poplar::Tensor &isOpenSpline, const poplar::Tensor &basis, const poplar::Tensor &weightIndex, unsigned degree, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {})