(f, enabled=True)
| 50 | |
| 51 | |
| 52 | def autocast(f, enabled=True): |
| 53 | def do_autocast(*args, **kwargs): |
| 54 | with torch.cuda.amp.autocast( |
| 55 | enabled=enabled, |
| 56 | dtype=torch.get_autocast_gpu_dtype(), |
| 57 | cache_enabled=torch.is_autocast_cache_enabled(), |
| 58 | ): |
| 59 | return f(*args, **kwargs) |
| 60 | |
| 61 | return do_autocast |
| 62 | |
| 63 | |
| 64 | def load_partial_from_config(config): |
no outgoing calls
no test coverage detected