def METHOD_NAME(self):
    np.random.seed(0)
    jt.set_seed(3)
    n = 1000
    batch_size = 50
    lr = 0.05
    def get_data(n):
        for i in range(n):
            x = np.random.rand(batch_size, 1).astype("float32")
            y = x*x
            yield jt.float32(x), jt.float32(y)
    model = Model(input_size=1)
    ps = model.parameters()
    for i,(x,y) in enumerate(get_data(n)):
        jt.sync_all(True)
        pred_y = model(x).name("pred_y")
        loss = ((pred_y - y).sqr()).name("loss")
        loss_mean = loss.mean()
        gs = jt.grad(loss_mean, ps)
        for p, g in zip(ps, gs):
            p -= g * lr
        if i>2:
            assert prev == jt.liveness_info(), f"memory leak {prev} {jt.liveness_info()}"
        prev = jt.liveness_info()
        print(f"step {i}, loss = {loss_mean.data.sum()} {jt.liveness_info()}")
    possible_results = [
        0.0009948202641680837,
        0.001381353591568768,
        0.00110957445576787,
    ]
    loss_mean = loss_mean.data
    assert any(abs(loss_mean - r) < 1e-6 for r in possible_results)
    jt.clean()