# Autograd failed after add max\_pool1d layer

**URL:** <https://discuss.pytorch.org/t/autograd-failed-after-add-max-pool1d-layer/75812>\
**Category:** autograd\
**Created:** [April 8, 2020, 7:13am UTC](https://discuss.pytorch.org/t/autograd-failed-after-add-max-pool1d-layer/75812 "2020-04-08T07:13:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 8, 2020, 9:59pm UTC](https://discuss.pytorch.org/t/autograd-failed-after-add-max-pool1d-layer/75812/6 "2020-04-08T21:59:52Z")

</div>

Thanks for the code snippet.  
Since it’s not reproducible with the last code, could you try to use:

```python
x= F.max_pool1d(x.transpose(1,2).contiguous(), kernel_size=x.size()[1])

```

and rerun the script, please?

Also, which PyTorch version are you using?  
Make sure to update to the latest stable release, as `Variables` are deprecated since `0.4`.

---

_[View the full topic](https://discuss.pytorch.org/t/autograd-failed-after-add-max-pool1d-layer/75812)._
