def profile_online_naive_lazy_stream(benchmark, device):
    """
    Online naive strategy without Avalanche using lazy stream.
    """

    print("=" * 30)
    print("Profiling online naive strategy  using lazy streams (no AVL) ...")

    experience_0 = benchmark.train_stream[0]

    def load_all_data(data):
        return next(iter(DataLoader(data, len(data))))

    with cProfile.Profile() as pr:
        model = SimpleMLP(num_classes=10).to(device)
        model.train()
        optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
        criterion = torch.nn.CrossEntropyLoss()

        for exp in tqdm(FixedSizeExperienceSplitter(experience_0, 1)):
            x, y, _ = load_all_data(exp.dataset)
            x, y = x.to(device), torch.tensor([y]).to(device)

            optimizer.zero_grad()
            pred = model(x)
            loss = criterion(pred, y)
            loss.backward()
            optimizer.step()

    stats = pstats.Stats(pr)
    stats.sort_stats("tottime").print_stats(15)

    Online naive strategy without Avalanche using lazy stream.
    
profiling/online_strategy.py