# Leaf variable has been moved into the graph interior

**URL:** <https://discuss.pytorch.org/t/leaf-variable-has-been-moved-into-the-graph-interior/18679>\
**Category:** autograd\
**Created:** [May 25, 2018, 2:36pm UTC](https://discuss.pytorch.org/t/leaf-variable-has-been-moved-into-the-graph-interior/18679 "2018-05-25T14:36:34Z")\
**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:** [May 25, 2018, 4:24pm UTC](https://discuss.pytorch.org/t/leaf-variable-has-been-moved-into-the-graph-interior/18679/6 "2018-05-25T16:24:28Z")

</div>

You can read a nice explanation of leaf variables in [this post](https://discuss.pytorch.org/t/leaf-variable-was-used-in-an-inplace-operation/308/2?u=ptrblck).

Usually you have to avoid modifying a leaf variable with an in-place operation.  
I haven’t seen your error message yet, but it seems it related to an in-place modification, because you are re-assigning the values of `W` in this line:

```
W[0]=w1 * w2; W[1]=w2 * w3; W[2]=w3 * w1
```

---

_[View the full topic](https://discuss.pytorch.org/t/leaf-variable-has-been-moved-into-the-graph-interior/18679)._
