code: def register_buffer(self, name, attr):
      if type(attr) == torch.Tensor:
          if attr.device != torch.device("cuda"):
              attr = attr.to(torch.device("cuda"))
      setattr(self, name, attr)
  
file_path: NeMo/nemo/collections/multimodal/models/text_to_image/stable_diffusion/samplers/base_sampler.py
imports: from abc import ABC, abstractmethod
  import numpy
  import torch
  from tqdm import tqdm
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.samplers import Sampler
  from nemo.collections.multimodal.modules.stable_diffusion.diffusionmodules.util import make_ddim_sampling_parameters, make_ddim_timesteps, noise_like
label_desc: Use image node_id 2 for calling the AbstractBaseSampler obj's underlying member method code with example usage: obj.register_buffer(name, attr) without return types