def test_optimizer_progress_default_factory():
    """Ensure that the defaults are created appropriately.

    If `default_factory` was not used, the default would be shared between instances.

    """
    p1 = _OptimizerProgress()
    p2 = _OptimizerProgress()
    p1.step.increment_completed()
    assert p1.step.total.completed == p1.step.current.completed
    assert p1.step.total.completed == 1
    assert p2.step.total.completed == 0
Ensure that the defaults are created appropriately.

    If `default_factory` was not used, the default would be shared between instances.

    
tests/tests_pytorch/loops/test_progress.py