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
inputtensor with shape numEdges * numInputChannels, three-dimensionalweighttensor and two-dimensionalbasisandweightIndextensors, calculate output features weighted by a continuous B-spline kernel functions.basisandweightIndextensors are outputs from SplineBasis operation with shape numEdges * numSplines.weighttensor shape must be numEdges * numInputChannels * numOutputChannels andoutputtensor 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
inputbasisorweightIndexare not two-dimensional.poputil::poplibs_error – If
weighttensor is not three-dimensional.poputil::poplibs_error – If elements of
inputare not float or half type.poputil::poplibs_error – If either elements of
weightbasisoroutputnot have the same type as elements ofinputtensor.poputil::poplibs_error – If elements of
weightIndextensor are not integer type.poputil::poplibs_error – If either size of dimension 0 of
basisor dimension 0 ofweightIndexor dimension 0 ofoutputdo not match size of dimension 0inputtensor.poputil::poplibs_error – If size of dimension 1 of
basisdoes not match the size of dimension 1 ofweightIndextensor.poputil::poplibs_error – If size of dimension 1 of
weightdoes not match the size of dimension 1 ofinputtensor.poputil::poplibs_error – If size of dimension 2 of
weightdoes not match the size of dimension 1 ofoutputtensor.
- 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 = {})