def test_num_stepping_batches_with_tpu_single():
    """Test stepping batches with the single-core TPU strategy."""
    trainer = Trainer(accelerator="tpu", devices=1, max_epochs=1)
    model = BoringModel()
    trainer._data_connector.attach_data(model)
    assert isinstance(trainer.strategy, SingleDeviceXLAStrategy)
    trainer.strategy.connect(model)
    expected = len(model.train_dataloader())
    assert trainer.estimated_stepping_batches == expected
Test stepping batches with the single-core TPU strategy.
tests/tests_pytorch/trainer/properties/test_estimated_stepping_batches.py