pytorch 中的 tensorflow stop_gradient 等效项 [英] tensorflow stop_gradient equivalent in pytorch
本文介绍了pytorch 中的 tensorflow stop_gradient 等效项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
pytorch 中的 tf.stop_gradient()
等价物是什么(提供了一种在反向传播期间不计算某些变量的梯度的方法)?
What is the tf.stop_gradient()
equivalent (provides a way to not compute gradient with respect to some variables during back-propagation) in pytorch?
推荐答案
你能用 x.detach() 检查一下吗?
Could you check with x.detach().
这篇关于pytorch 中的 tensorflow stop_gradient 等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文