code: def data_to_table(data, step):
      table = []
  
      try:
          import torch
      except ImportError:
          torch = None
  
      if torch is not None and isinstance(data, torch.Tensor):
          data = data.detach().cpu().numpy()
  
      for i in range(data.shape[0]):
          if len(data.shape) == 2:
              m = data.shape[1] // 2
              row = {"step": data[i, 0], "v5": data[i, m]}
              for j in range(1, min(m, 5)):
                  row[f"v{5 - j}"] = data[i, m - j]
                  row[f"v{5 + j}"] = data[i, m + j]
          elif step is not None:
              row = {"step": step[i], "v5": data[i]}
          else:
              row = {"step": i, "v5": data[i]}
          table.append(row)
  
      return alt.Data(values=table)
  
imports: from typing import List
  import altair
  from labml.internal.analytics.altair.utils import TABLEAU_10
label_desc: Use image node_id 1 for calling a global function with example usage: data_to_table(data, step) and returns: alt