MCPcopy Create free account
hub / github.com/OpenGVLab/InternImage / fp16_compress_wrapper

Function fp16_compress_wrapper

classification/ddp_hooks.py:111–144  ·  view source on GitHub ↗

This wrapper casts the input gradient tensor of a given DDP communication hook to half-precision floating point format (``torch.float16``), and casts the resulting tensor of the given hook back to the input data type, such as ``float32``. Therefore, ``fp16_compress_hook`` is equiva

(
    hook: Callable[[Any, dist.GradBucket], torch.futures.Future[torch.Tensor]]
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected