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

Method false_fn

intermediate_source/torch_export_tutorial.py:203–204  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

201 def true_fn(x):
202 return torch.sin(x)
203 def false_fn(x):
204 return torch.cos(x)
205 return torch.cond(x.sum() > 0, true_fn, false_fn, [x])
206
207exported_bad1_fixed = export(Bad1Fixed(), (torch.randn(3, 3),))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected