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-dimensional weight tensor and two-dimensional basis and weightIndex tensors, calculate output features weighted by a continuous B-spline kernel functions. basis and weightIndex tensors are outputs from SplineBasis operation with shape numEdges * numSplines. weight tensor shape must be numEdges * numInputChannels * numOutputChannels and output 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 or weightIndex 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 or output not have the same type as elements of input 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 of weightIndex or dimension 0 of output do not match size of dimension 0 input tensor.

  • poputil::poplibs_error – If size of dimension 1 of basis does not match the size of dimension 1 of weightIndex tensor.

  • poputil::poplibs_error – If size of dimension 1 of weight does not match the size of dimension 1 of input tensor.

  • poputil::poplibs_error – If size of dimension 2 of weight does not match the size of dimension 1 of output tensor.

Returns

An output tensor with features weighted by a continuous B-spline kernel functions