xnn.hybnn.fast.mlp_kernels.residual_mlps#

xnn.hybnn.fast.mlp_kernels.residual_mlps(x, n_residual, output, params)[source]#

G residual MLPs of one structure on x, fused.

Parameters:
  • x (Tensor) – Input, shape (N, F).

  • n_residual (int) – Residual blocks per MLP.

  • output (bool) – Whether an output layer follows the blocks.

  • params (list of Tensor) – Per layer (A_0, B_0, ..., O): alpha, beta (G, F), the transposed weights (G, F, F') (y = a w) and, when the layers have them, the biases (G, F'). All layers have biases or none has.

Returns:

Shape (G, N, F').

Return type:

Tensor