I have tried using:
data_s=torch.split(data,512,dim=2)
        for split in data_s: 
            data = data.cuda()
            z_loc, z_scale = model.Encoder(data)
            z = model.reparam(z_loc, z_scale)
            out = model.Decoder(z)
            loss = loss_fn(out, data, z_loc, z_scale)
            optimizer.zero_grad()
            loss.backward(retain_graph=True)
            optimizer.step()

But i am not seeing anything which suggests that its passing each of the data blocks through as seperate fields, how can i check this?