code: def get_arc_weights(graph: "k2.Fsa") -> torch.Tensor:
      """Returns 1d torch.Tensor with arc weights of a given graph."""
      if len(graph.shape) > 2:
          raise NotImplementedError(
              "FsaVec is not supported at the moment."
          )
      weights_int = graph.arcs.values()[:, -1].tolist()
      weights_float = struct.unpack(
          "%sf" % len(weights_int),
          struct.pack("%si" % len(weights_int), *weights_int),
      )
      return torch.Tensor(weights_float)
  
imports: import os
  import struct
  from pickle import UnpicklingError
  from typing import List, Optional, Tuple, Union
  import torch
  from nemo.core.utils.k2_guard import k2
  from nemo.utils import logging
label_desc: Use image node_id 14 for calling a global function with example usage: get_arc_weights(graph) and returns: torch