def test_update_single_batch() -> None:
    """Test updating the metric with a single batch."""
    metric = _MinMax()
    batch = torch.tensor([1.0, 2.0, 3.0, -1.0])
    metric.update(batch)

    assert metric.min.item() == -1.0, "Min should be -1.0 after single batch update."
    assert metric.max.item() == 3.0, "Max should be 3.0 after single batch update."
Test updating the metric with a single batch.
tests/unit/metrics/test_min_max.py