class_docstr: Loader that extracts text from images
code: def set_context(self):
      if get_device() == "cuda":
          import torch
  
          n_gpus = (
              torch.cuda.device_count()
              if torch.cuda.is_available()
              else 0
          )
          if n_gpus > 0:
              self.context_class = torch.device
              if self.gpu_id is not None:
                  self.device = "cuda:%d" % self.gpu_id
              else:
                  self.device = "cuda"
          else:
              self.device = "cpu"
      else:
          self.device = "cpu"
  
imports: from typing import List, Union, Any, Tuple, Optional
  import requests
  import torch
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  import numpy
  from utils import get_device, clear_torch_cache, NullContext
  from doctr.utils.common_types import AbstractFile
label_desc: Use image node_id 2 for calling the H2OOCRLoader obj's underlying member method code with example usage: obj.set_context() without return types