# Custom backward() breakpoint doesn't get hit

**URL:** <https://discuss.pytorch.org/t/custom-backward-breakpoint-doesnt-get-hit/6473>\
**Category:** autograd\
**Created:** [August 20, 2017, 6:43pm UTC](https://discuss.pytorch.org/t/custom-backward-breakpoint-doesnt-get-hit/6473 "2017-08-20T18:43:42Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![raining\_day513](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/raining_day513/32/52553_2.png) [@raining\_day513](https://discuss.pytorch.org/u/raining_day513)\
**Post date:** [May 22, 2023, 1:48pm UTC](https://discuss.pytorch.org/t/custom-backward-breakpoint-doesnt-get-hit/6473/15 "2023-05-22T13:48:39Z")

</div>

You should put this line:

```python
pydevd.settrace(suspend=False, trace_only_current_thread=True)

```

**inside** your `backward` function instead of calling it right after your import! No need to set `suspend=True`. (While you probably don’t care about it anymore, I just prove-read this thread to help future readers.)

---

_[View the full topic](https://discuss.pytorch.org/t/custom-backward-breakpoint-doesnt-get-hit/6473)._
