tf.stop_gradiente em pytorch

x.detach()
Lazy Lizard