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

Function autocast

sat/vae_modules/utils.py:132–141  ·  view source on GitHub ↗
(f, enabled=True)

Source from the content-addressed store, hash-verified

130
131
132def autocast(f, enabled=True):
133 def do_autocast(*args, **kwargs):
134 with torch.cuda.amp.autocast(
135 enabled=enabled,
136 dtype=torch.get_autocast_gpu_dtype(),
137 cache_enabled=torch.is_autocast_cache_enabled(),
138 ):
139 return f(*args, **kwargs)
140
141 return do_autocast
142
143
144def load_partial_from_config(config):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected