import torch


def step_system(system, x_start, steps):
    """
    Step forward a closed loop system for N steps. Returns the whole path.
    """
    path = [x_start]
    with torch.no_grad():
        for i in range(steps):
            path.append(system.step_forward(path[-1]))
    return path