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

Function foo

recipes_source/torch_compiler_set_stance_tutorial.py:37–43  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

35
36@torch.compile
37def foo(x):
38 if torch.compiler.is_compiling():
39 # torch.compile is active
40 return x + 1
41 else:
42 # torch.compile is not active
43 return x - 1
44
45
46inp = torch.zeros(3)

Callers 2

barFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected