MCPcopy Create free account
hub / github.com/BeastyZ/ConvSearch-R1 / __init__

Method __init__

index/dense/libs.py:246–252  ·  view source on GitHub ↗
(self, activated, use_cuda)

Source from the content-addressed store, hash-verified

244
245class MixedPrecisionManager:
246 def __init__(self, activated, use_cuda):
247 assert (not activated) or PyTorch_over_1_6, "Cannot use AMP for PyTorch version < 1.6"
248
249 print("Using FP16:", activated)
250 self.activated = activated and use_cuda
251 if self.activated:
252 self.scaler = torch.cuda.amp.GradScaler()
253
254 def context(self):
255 return torch.cuda.amp.autocast() if self.activated else NullContextManager()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected