code: def get_torch_version() -> Version:
      """
      Get the PyTorch version for the current runtime environment as a Version.
  
      Example::
  
          # if running PyTorch 1.12.0
          >>> get_torch_version()
          '1.12.0'
      """
      try:
          if hasattr(torch, "__version__"):
              pkg_version = Version(torch.__version__)
          else:
              # try pkg_resources to infer version
              pkg_version = Version(
                  pkg_resources.get_distribution("torch").version
              )
      except TypeError as e:
          raise TypeError(
              "PyTorch version could not be detected automatically."
          ) from e
  
      return pkg_version
  
file_path: tnt/torchtnt/utils/version.py
imports: import platform
  import pkg_resources
  import torch
  from packaging.version import Version
label_desc: Use image node_id 3 for calling a global function with example usage: get_torch_version() and returns: pkg_version