MCPcopy Create free account
hub / github.com/pytorch/tutorials / jvp

Method jvp

intermediate_source/forward_ad_usage.py:145–150  ·  view source on GitHub ↗
(ctx, gI)

Source from the content-addressed store, hash-verified

143
144 @staticmethod
145 def jvp(ctx, gI):
146 gO = gI * ctx.result
147 # If the tensor stored in`` ctx`` will not also be used in the backward pass,
148 # one can manually free it using ``del``
149 del ctx.result
150 return gO
151
152fn = Fn.apply
153

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected