class_docstr: Torch module that allows loading variables from the state dict even in the case of shape mismatch.
class_docstr_tok: ["Torch","module","that","allows","loading","variables","from","the","state","dict","even","in","the","case","of","shape","mismatch","."]
docstr: Resizes the local buffers to match those stored in the state dict.
  
  Overrides method from parent class.
  
  Args:
    state_dict (dict): State dictionary containing weights
    prefix (str): Prefix of the weight file.
    *args:
docstr_tok: ["Resizes","the","local","buffers","to","match","those","stored","in","the","state","dict",".","Overrides","method","from","parent","class",".","Args",":","state_dict","(","dict",")",":","State","dictionary","containing","weights","prefix","(","str",")",":","Prefix","of","the","weight","file",".","*","args",":"]
code: def _load_from_state_dict(self, state_dict: dict, prefix: str, *args):
      """Resizes the local buffers to match those stored in the state dict.
  
      Overrides method from parent class.
  
      Args:
        state_dict (dict): State dictionary containing weights
        prefix (str): Prefix of the weight file.
        *args:
      """
      persistent_buffers = {
          k: v
          for k, v in self._buffers.items()
          if k not in self._non_persistent_buffers_set
      }
      local_buffers = {
          k: v for k, v in persistent_buffers.items() if v is not None
      }
  
      for param in local_buffers.keys():
          for key in state_dict.keys():
              if (
                  key.startswith(prefix)
                  and key[len(prefix) :].split(".")[0] == param
              ):
                  if (
                      not local_buffers[param].shape
                      == state_dict[key].shape
                  ):
                      attribute = self.get_tensor_attribute(param)
                      attribute.resize_(state_dict[key].shape)
  
      super()._load_from_state_dict(state_dict, prefix, *args)
  
imports: from abc import ABC
  from torch import Tensor, nn
label_desc: Use image node_id 2 for calling the DynamicBufferModule obj's underlying member method code with example usage: obj._load_from_state_dict(state_dict, prefix) without return types