Hi,

when I run my training function everything works perfectly and I get the desired behaviours. I decided to pass my training function through ray tune and I get the following error:

```
(pid=55480) File "/Users/paulvalsecchi/PycharmProjects/pythonProject/NCDE GAN code/Solver.py", line 160, in I
(pid=55480) du_x = x.grad[:, ::step, :]
(pid=55480) TypeError: 'NoneType' object is not subscriptable
```

This is strange as if I just run my train function I get that `x.grad`

is a tensor populated in such a way that I can subscribe it the way I have done.

I am using a variety of packages including signatory which I suspect might interfere with ray tune, but I don’t understand why I get the desired result when I run `train(config)`

instead of

```
analysis = tune.run(
train,
num_samples=200,
scheduler=ASHAScheduler(metric="Loss", mode="min", grace_period=10, max_t=200, reduction_factor=4),
config=config,
verbose=2)
```

which gives me the error I get above.

Any help would be greatly appreciated.