def METHOD_NAME(self, state_dict):
    """Converts a state dict saved from a dataParallel module to normal
    module state_dict inplace
    :param state_dict is the loaded DataParallel model_state
    """
    if not next(iter(state_dict)).startswith('module.'):
        return state_dict  # abort if dict is not a DataParallel model_state
    new_state_dict = OrderedDict()
    split_index = 0
    for cur_key, cur_value in state_dict.items():
        if cur_key.startswith('module.model'):
            split_index = 13
        elif cur_key.startswith('module'):
            split_index = 7
        break
    for k, v in state_dict.items():
        name = k[split_index:]  # remove `module.`
        new_state_dict[name] = v
    return new_state_dict