Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytorch/tutorials
/ bar
Function
bar
intermediate_source/torch_compile_tutorial.py:311–315 ·
view source on GitHub ↗
(a, b)
Source
from the content-addressed store, hash-verified
309
310
311
def
bar(a, b):
312
x = a / (torch.abs(a) + 1)
313
if
b.sum() < 0:
314
b = b * -1
315
return
x * b
316
317
318
opt_bar = torch.compile(bar)
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected