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

Method forward

intermediate_source/forward_ad_usage.py:137–142  ·  view source on GitHub ↗
(ctx, foo)

Source from the content-addressed store, hash-verified

135class Fn(torch.autograd.Function):
136 @staticmethod
137 def forward(ctx, foo):
138 result = torch.exp(foo)
139 # Tensors stored in ``ctx`` can be used in the subsequent forward grad
140 # computation.
141 ctx.result = result
142 return result
143
144 @staticmethod
145 def jvp(ctx, gI):

Callers 1

trainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected