#include <poplin/FullyConnected.hpp>

Functions and data types to for performing operations on fully-connected layers.

namespace poplin

Linear algebra functions.

namespace fc


std::vector<std::pair<MatMulParams, poplar::OptionFlags>> getMatMulPrePlanParameters(FullyConnectedParams parameters, poplar::OptionFlags matmulOptions, poplar::Type type, bool inferenceOnly)

Predict what matrix multiplications will be needed for the given parameters and return a list of corresponding matmul() parameters and options.

  • parameters – Parameters for the fully-connected layer.

  • matmulOptions – Option flags are the same as those from matmul(). They are passed through to the underlying matmul, updating the fullyConnectedPass option only.

  • type – Input and output datatype.

  • inferenceOnly – Whether the fully-connected layer is for inference only. If true, we can ignore backwards and weight-update passes.


Vector of pairs of [MatMulParams, OptionFlags] representing the complete set of matmul parameters for planning.

struct FullyConnectedParams
#include <FullyConnected.hpp>

Parameters to describe a fully-connected layer.

Public Members

std::size_t numGroups

The number of groups (where each group represents a fully-connected layer of the same shape) that operate in one layer.

Each group is totally independent of the others and so numGroups is a common dimension among the inputs, weights, and outputs for the layer.

std::size_t batchSize

Number of samples in the input to the layer.

std::size_t inputSize

Size of the input in each batch into the layer.

std::size_t outputSize

Size of the output in each batch from the layer.