code: def test_ignite():
      callback = PlotLossesIgnite(outputs=(CheckOutput(),))
      model = Model()
      optimizer = optim.Adam(params=model.parameters(), lr=0.001)
      loss_fn = nn.CrossEntropyLoss()
      trainer = engine.create_supervised_trainer(
          model,
          optimizer,
          loss_fn,
          output_transform=lambda x, y, y_pred, loss: {
              "loss": loss.item()
          },
      )
  
      losses = []
  
      @trainer.on(engine.Events.ITERATION_COMPLETED)
      def _save_losses(engine):
          losses.append(engine.state.output["loss"])
  
      @trainer.on(engine.Events.EPOCH_COMPLETED)
      def _compute_epoch_loss(engine):
          engine.state.metrics = {"loss": sum(losses) / len(losses)}
  
      callback.attach(trainer)
  
      train_dataloader = get_random_data()
      trainer.run(train_dataloader, max_epochs=2)
  
file_path: livelossplot/tests/external_test_pytorch_ignite.py
imports: import torch
  from ignite import engine
  from torch import nn, optim
  from torch.utils.data import TensorDataset, DataLoader
  from livelossplot import MainLogger, PlotLossesIgnite
  from livelossplot.outputs import BaseOutput
label_desc: Use image node_id 2 for calling a global function with example usage: test_ignite() without return types