Skip to main content

Bias

Bias

Adds a learnable bias vector to the input tensor. Simple additive operation applied element-wise along the last dimension.

Parameters:

  • dim: Size of the bias vector (must match last dimension of input)

Shape Contract:

  • Input: [*, dim] tensor with last dimension matching bias size
  • Output: [*, dim] same shape as input

Notes:

  • Learnable parameter: bias vector of shape [dim]
  • Applied element-wise: out = input + bias
  • Often combined with Linear (which can include or exclude bias)
  • Useful when separating weight and bias learning rates

Signature

neuron Bias(dim)

Ports

Inputs:

  • default: [*, dim]

Outputs:

  • default: [*, dim]

Implementation

Source { source: "core", path: "operations/Bias" }