Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ml-explore/mlx
/ step_function
Function
step_function
benchmarks/python/comparative/bench_torch.py:298–302 ·
view source on GitHub ↗
(x)
Source
from the content-addressed store, hash-verified
296
297
@torch.no_grad()
298
def
step_function(x):
299
y = x
300
for
i in range(100):
301
y = torch.where(y < 0, 0, 1)
302
sync_if_needed(x)
303
304
305
@torch.no_grad()
Callers
nothing calls this directly
Calls
1
sync_if_needed
Function · 0.85
Tested by
no test coverage detected