3.6.9. unit_scaling.transforms.Metrics

class unit_scaling.transforms.Metrics(fwd_tensor: Tensor)[source]

A set of metrics representing useful information about a tensor, in the forward and backward pass.

metrics.fwd, and optionally metrics.bwd, are objects of type Data, containing metrics about the tensor in the forward pass and its gradient in the backward pass.

class Data(mean_abs: float, abs_mean: float, std: float, abs_max: float, abs_min: float, numel: int)[source]

Data representing key metrics for a tensor.