src/models/utils.py
def _model_state_dict(self, model):
        """Returns state dict of model, taking care of DataParallel case."""
        if isinstance(model, nn.DataParallel):
            return model.module.state_dict()
        else:
            return model.state_dict()
Returns state dict of model, taking care of DataParallel case.
Returns state dict of model, taking care of DataParallel case.
Returns state dict of model taking care of DataParallel case .
def _model_state_dict(self, model):
        if isinstance(model, nn.DataParallel):
            return model.module.state_dict()
        else:
            return model.state_dict()
def _model_state_dict ( self , model ) : if isinstance ( model , nn . DataParallel ) : return model . module . state_dict ( ) else : return model . state_dict ( )
Returns state dict of model, taking care of DataParallel case.
Returns state dict of model taking care of DataParallel case .
"""Returns state dict of model, taking care of DataParallel case."""
self
model