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 pseudo tensor with shape numEdges * numDims and one-dimensional kernelSize and isOpenSpline tensors with length numDims, calculate basis tensor of shape numEdges * numSplines containing B-spline basis functions coefficients for the given degree. The weightIndex output contains weight index for each spline coefficient.

Parameters
  • graph – The graph to add any vertices needed for calculating basis and weightIndex outputs.

  • 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 pseudo is not two-dimensional.

  • poputil::poplibs_error – If kernelSize or isOpenSpline are not one-dimensional.

  • poputil::poplibs_error – If kernelSize and isOpenSpline do not have the same size as number of columns in pseudo tensor.

  • poputil::poplibs_error – If elements of pseudo are not float or half type.

  • poputil::poplibs_error – If elements of kernelSize are not integer type.

  • poputil::poplibs_error – If elements of isOpenSpline are not unsigned char type.

  • poputil::poplibs_error – If degree is neither 1, 2 or 3.