(rontolisp) docs
← Functions

torch:detach

(torch:detach tensor)

Returns a new leaf tensor sharing the tensor's data but cut off from the autograd tape: no requires-grad, no recorded history, so nothing computed from it flows gradients back. The whole-block spelling is the torch:no-grad macro.