MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / is_autocast_enabled

Function is_autocast_enabled

PATH/core/models/ckpt.py:393–397  ·  view source on GitHub ↗

Similar to torch.is_autocast_enabled, but compatible with torch 1.5.1

()

Source from the content-addressed store, hash-verified

391
392
393def is_autocast_enabled() -> bool:
394 """Similar to torch.is_autocast_enabled, but compatible with torch 1.5.1"""
395 if hasattr(torch, "is_autocast_enabled"):
396 return torch.is_autocast_enabled()
397 return False
398
399
400@contextmanager

Callers 1

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected