    def get_bare_model(self, net):
        """Get bare model, especially under wrapping with
        DistributedDataParallel or DataParallel.
        """
        if isinstance(net, (DataParallel, DistributedDataParallel)):
            net = net.module
        return net
Get bare model, especially under wrapping with
DistributedDataParallel or DataParallel.
opensora/models/super_resolution/basicsr/models/base_model.py