MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / wrapper

Function wrapper

tests/dump_fenc_from_package.py:88–94  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

86
87def _cpu_override(orig_fn):
88 def wrapper(*args, **kwargs):
89 dev = kwargs.get("device")
90 if isinstance(dev, str) and "cuda" in dev:
91 kwargs["device"] = "cpu"
92 elif isinstance(dev, torch.device) and dev.type == "cuda":
93 kwargs["device"] = "cpu"
94 return orig_fn(*args, **kwargs)
95 return wrapper
96
97_orig_arange = torch.arange

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected