Ou, I mean there are some inplace operators will cause an  error in backward, and some other operators will not. Back to the original question, is there a method that can detach a sub graph after a forward?
For example, there is a graph:
x -> a -> y -> loss
and I call the fast backward
loss -> y -> a -> x.
After that I call
y.backward(grad=some-grad)
and I only want to backward to a:
y -> a.
I know I can solve this by
x -> x.detach() -> a -> y -> loss
and backward the gradient to “a” manually in the fast backward. But is there a better method?