code: def plot_top_losses(
      x: TensorImage,
      y: TensorMask,
      samples,
      outs,
      raws,
      losses,
      nrows=None,
      ncols=None,
      figsize=None,
      **kwargs,
  ):
      axes = get_grid(
          len(samples) * 3,
          nrows=len(samples),
          ncols=3,
          figsize=figsize,
          flatten=False,
          title="Input | Target | Prediction",
      )
      if axes.ndim == 1:
          axes = (axes,)
      titles = ["input", "target", "pred"]
      for axs, s, o, l in zip(axes, samples, outs, losses):
          imgs = (s[0], s[1], o[0])
          for ax, im, title in zip(axs, imgs, titles):
              if title == "pred":
                  title += f"; loss = {l.item():.4f}"
              im.show(ctx=ax, **kwargs)
              ax.set_title(title)
  
imports: from __future__ import annotations
  from packaging.version import parse
  from ..basics import *
  from .core import *
  from .data import *
  from .augment import *
  from .None import models
  import torchvision
  from ..callback.hook import num_features_model
label_desc: Use image node_id 32 for calling a global function with example usage: plot_top_losses(x, y, samples, outs, raws, losses, nrows, ncols, figsize) without return types