code: def test_batch_metrics_visdom(self, mock_visdom, mock_writer, _):
      mock_writer.return_value = Mock()
      mock_writer.return_value.add_scalar = Mock()
  
      state = {
          torchbearer.MODEL: nn.Sequential(nn.Conv2d(3, 3, 3)),
          torchbearer.EPOCH: 0,
          torchbearer.METRICS: {"test": 1},
          torchbearer.BATCH: 0,
          torchbearer.TRAIN_STEPS: 0,
      }
  
      tboard = TensorBoard(
          visdom=True,
          write_batch_metrics=True,
          write_epoch_metrics=False,
      )
      tboard.on_start(state)
      tboard.on_start_epoch(state)
      tboard.on_step_training(state)
      mock_writer.return_value.add_scalar.assert_called_once_with(
          "test", 1, 0, main_tag="batch"
      )
      mock_writer.return_value.add_scalar.reset_mock()
      tboard.on_step_validation(state)
      mock_writer.return_value.add_scalar.assert_called_once_with(
          "test", 1, 0, main_tag="batch"
      )
      tboard.on_end_epoch(state)
      tboard.on_end(state)
  
imports: import os
  from unittest import TestCase
  import warnings
  import torch
  import torch.nn
  from mock import patch, Mock, ANY, MagicMock
  import torchbearer
  from torchbearer.callbacks import TensorBoard, TensorBoardImages, TensorBoardProjector, TensorBoardText
label_desc: Use image node_id 20 for calling the TestTensorBoard obj's underlying member method code with example usage: obj.test_batch_metrics_visdom(mock_visdom, mock_writer, _) without return types