var_mean(x: Tensor, dim: int | Sequence[int] | None = None, correction: int = 1, keepdim: bool = False)Return (var, mean) along dim in a single call.
Variance counterpart to std_mean. Useful inside
normalisation layers where the squared deviation is the quantity
actually wanted (e.g. BatchNorm / LayerNorm forward computes
(x - mean) / sqrt(var + eps)).
Parameters
Input.
dimint, sequence of int, or None= NoneAxis or axes to reduce.
None (default) → full-tensor
reduction.correctionint= 1Bessel correction passed to
lucid.var. Default 1
(unbiased sample variance).keepdimbool= FalseRetain the reduced axes as size-1 dimensions. Default
False.Returns
tuple of Tensor(var, mean).
See Also
std_mean—standard-deviation + mean variant.