code: def _test_logging(self, history, writer_mock):
      # Each layer has 7 metric computed on them (mean, var, min, abs_min, max, abs_max and l2 norm)
      # We do 50 steps (10 epoch times 5) = 700 methods call
      self.assertEqual(len(writer_mock.method_calls), 700)
  
      # We group the seven stats entries for a layer_i intro a list
      grouped_metrics_calls = list(
          zip(*[iter(writer_mock.method_calls)] * 7)
      )
  
      # We will use an idx to group the stats in layer calls
      for history_idx, stats in enumerate(history.values()):
          for mock_calls, stats_entry in zip(
              grouped_metrics_calls[history_idx::2], stats
          ):
              # We remove non-tracked history by tensorboard
              stats_entry.pop("epoch")
              stats_entry.pop("batch")
  
              self.assertEqual(len(mock_calls), len(stats_entry))
              for stats_idx, k in enumerate(stats_entry.keys()):
                  self.assertAlmostEqual(
                      mock_calls[stats_idx][1][1][k], stats_entry[k]
                  )
  
imports: import csv
  import os
  from tempfile import TemporaryDirectory
  from unittest import TestCase
  from unittest.mock import MagicMock
  import torch
  import torch.nn
  from poutyne import AtomicCSVGradientLogger
  from poutyne import CSVGradientLogger
  from poutyne import GradientLoggerBase, MemoryGradientLogger, Model, TensorBoardGradientLogger
  from tests.framework.tools import some_data_generator
label_desc: Use image node_id 2 for calling the TensorboardGradientLoggerTest obj's underlying member method code with example usage: obj._test_logging(history, writer_mock) without return types