def is_parallel(model):
    """check if model is in parallel mode."""

    parallel_type = (
        nn.parallel.DataParallel,
        nn.parallel.DistributedDataParallel,
    )
    return isinstance(model, parallel_type)
check if model is in parallel mode.
yolox/utils/ema.py