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

Method forward

intermediate_source/torch_export_tutorial.py:115–118  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

113
114class Bad1(torch.nn.Module):
115 def forward(self, x):
116 if x.sum() > 0:
117 return torch.sin(x)
118 return torch.cos(x)
119
120import traceback as tb
121try:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected