code: def tensor_to_df(tensor, ax_names=None):
      assert (
          tensor.ndim == 2
      ), "Can only currently convert 2D tensors to dataframes"
      df = pd.DataFrame(data=tensor, columns=np.arange(tensor.shape[1]))
      return df.melt(
          value_vars=df.columns,
          var_name=("variable" if ax_names is None else ax_names[0]),
          value_name=("value" if ax_names is None else ax_names[1]),
      )
  
file_path: mmvae/src/vis.py
imports: import matplotlib.colors
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  import torch
  from matplotlib.lines import Line2D
  from umap import UMAP
label_desc: Use image node_id 4 for calling a global function with example usage: tensor_to_df(tensor, ax_names) and returns: df