mirror of
https://github.com/wassname/baukit.git
synced 2026-06-27 16:14:33 +08:00
retain_grad on input
This commit is contained in:
+2
-2
@@ -78,8 +78,8 @@ class Trace(contextlib.AbstractContextManager):
|
|||||||
inputs[0] if len(inputs) == 1 else inputs,
|
inputs[0] if len(inputs) == 1 else inputs,
|
||||||
clone=clone,
|
clone=clone,
|
||||||
detach=detach,
|
detach=detach,
|
||||||
retain_grad=False,
|
retain_grad=retain_grad,
|
||||||
) # retain_grad applies to output only.
|
)
|
||||||
if retain_output:
|
if retain_output:
|
||||||
retainer.output = recursive_copy(
|
retainer.output = recursive_copy(
|
||||||
output, clone=clone, detach=detach, retain_grad=retain_grad
|
output, clone=clone, detach=detach, retain_grad=retain_grad
|
||||||
|
|||||||
Reference in New Issue
Block a user