code: def get_tensor(self, tensor_name: str, to_device=True):
      filename, tensor_name = self.get_filename(tensor_name)
      f = self._get_handle(filename)
      tensor = f.get_tensor(tensor_name)
      # Special case for gptq which shouldn't convert
      # u4 which are disguised as int32
      if tensor.dtype not in [torch.int32, torch.int64]:
          tensor = tensor.to(dtype=self.dtype)
      if to_device:
          tensor = tensor.to(device=self.device)
      return tensor
  
imports: import os
  from pathlib import Path
  from typing import List, Dict, Optional, Tuple
  from safetensors import safe_open, SafetensorError
  import torch
  from loguru import logger
  from huggingface_hub import hf_hub_download
  import json
  from text_generation_server.utils.log import log_once
label_desc: Use image node_id 6 for calling the Weights obj's underlying member method code with example usage: obj.get_tensor(tensor_name, to_device) and returns: tensor