code: def tensorboard_log(
      x: TensorImage, y: TensorCategory, samples, outs, writer, step
  ):
      fig, axs = get_grid(len(samples), return_fig=True)
      for i in range(2):
          axs = [b.show(ctx=c) for b, c in zip(samples.itemgot(i), axs)]
      axs = [
          r.show(ctx=c, color="green" if b == r else "red")
          for b, r, c in zip(samples.itemgot(1), outs.itemgot(0), axs)
      ]
      writer.add_figure("Sample results", fig, step)
  
imports: from __future__ import annotations
  from ..basics import *
  import tensorboard
  from torch.utils.tensorboard import SummaryWriter
  from .fp16 import ModelToHalf
  from .hook import hook_output
  from ..text.all import LMLearner, TextLearner
  from ..vision.data import *
  from ..vision.core import TensorPoint, TensorBBox
label_desc: Use image node_id 6 for calling a global function with example usage: tensorboard_log(x, y, samples, outs, writer, step) without return types