Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pytorch detach

When we don't need a tensor to be traced for the gradient computation,
we detach the tensor from the current computational graph.
It returns a new tensor that doesn't require a gradient.
 
PREVIOUS NEXT
Tagged: #pytorch #detach
ADD COMMENT
Topic
Name
3+1 =