code: def register_buffer(self, name, attr):
      if type(attr) == torch.Tensor:
          if attr.device != self.device:
              attr = attr.to(self.device)
      setattr(self, name, attr)
  
file_path: stablediffusion/ldm/models/diffusion/plms.py
imports: import torch
  import numpy
  from tqdm import tqdm
  from functools import partial
  from ldm.modules.diffusionmodules.util import make_ddim_sampling_parameters, make_ddim_timesteps, noise_like
  from ldm.models.diffusion.sampling_util import norm_thresholding
label_desc: Use image node_id 2 for calling the PLMSSampler obj's underlying member method code with example usage: obj.register_buffer(name, attr) without return types