class_docstr: This worker will take tensors from the request queue, do some computation,
  and then return the result back in the response queue.
class_docstr_tok: ["This","worker","will","take","tensors","from","the","request","queue",",","do","some","computation",",","and","then","return","the","result","back","in","the","response","queue","."]
code: def _setup(self):
      import time
  
      import torch
      from torchvision.models.resnet import BasicBlock, ResNet
  
      # Create ResNet18 on meta device
      with torch.device("meta"):
          m = ResNet(BasicBlock, [2, 2, 2, 2])
  
      # Load pretrained weights
      start_load_time = time.time()
      state_dict = torch.load(
          f"{self.model_dir}/resnet18-f37072fd.pth",
          mmap=True,
          map_location=self.device,
      )
      self.metrics_dict["torch_load_time"] = (
          time.time() - start_load_time
      )
      m.load_state_dict(state_dict, assign=True)
      m.eval()
  
      if self.compile_model:
          start_compile_time = time.time()
          m.compile()
          end_compile_time = time.time()
          self.metrics_dict["m_compile_time"] = (
              end_compile_time - start_compile_time
          )
      return m
  
imports: import argparse
  import asyncio
  import os.path
  import subprocess
  import threading
  import time
  from concurrent.futures import ThreadPoolExecutor
  from queue import Empty
  import numpy
  import pandas
  import torch
  import torch.multiprocessing
label_desc: Use image node_id 2 for calling the BackendWorker obj's underlying member method code with example usage: obj._setup() and returns: m