MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / autocast

Function autocast

sat/sgm/util.py:140–149  ·  view source on GitHub ↗
(f, enabled=True)

Source from the content-addressed store, hash-verified

138
139
140def autocast(f, enabled=True):
141 def do_autocast(*args, **kwargs):
142 with torch.cuda.amp.autocast(
143 enabled=enabled,
144 dtype=torch.get_autocast_gpu_dtype(),
145 cache_enabled=torch.is_autocast_cache_enabled(),
146 ):
147 return f(*args, **kwargs)
148
149 return do_autocast
150
151
152def load_partial_from_config(config):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected