code: def tensorboard_log(
      x: TensorImage,
      y: TensorImageBase | TensorPoint | TensorBBox,
      samples,
      outs,
      writer,
      step,
  ):
      fig, axs = get_grid(len(samples), return_fig=True, double=True)
      for i in range(2):
          axs[::2] = [
              b.show(ctx=c)
              for b, c in zip(samples.itemgot(i), axs[::2])
          ]
      for x in [samples, outs]:
          axs[1::2] = [
              b.show(ctx=c) for b, c in zip(x.itemgot(0), axs[1::2])
          ]
      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 7 for calling a global function with example usage: tensorboard_log(x, y, samples, outs, writer, step) without return types