code: def get_num_bits(dtype: torch.dtype) -> int:
      if dtype == torch.bool:
          return (
              8  # see https://github.com/pytorch/pytorch/issues/41571
          )
      elif dtype.is_floating_point:
          return torch.finfo(dtype).bits
      else:
          try:
              return torch.iinfo(dtype).bits
          except TypeError:
              raise TypeError(
                  f"Could not infer size for tensor type {dtype}"
              )
  
file_path: hivemind/hivemind/compression/floating.py
imports: import math
  import numpy
  import torch
  from hivemind.compression.base import CompressionBase, CompressionInfo
  from hivemind.proto import runtime_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: get_num_bits(dtype) and returns: int, torch, torch