code: def test_write_graph(self, mock_rand, mock_board, _):
      mock_board.return_value = Mock()
      mock_board.return_value.add_graph = Mock()
      mock_rand.return_value = 1
  
      state = {
          torchbearer.MODEL: nn.Sequential(nn.Conv2d(3, 3, 3)),
          torchbearer.X: torch.zeros(1, 1, 9, 9),
      }
  
      tboard = TensorBoard(write_epoch_metrics=False)
      tboard.on_start(state)
      tboard.on_sample(state)
      tboard.on_end(state)
  
      mock_rand.assert_called_once_with(
          state[torchbearer.X].size(), requires_grad=False
      )
      self.assertEqual(mock_board.return_value.add_graph.call_count, 1)
      self.assertEqual(
          str(state[torchbearer.MODEL]),
          str(
              mock_board.return_value.add_graph.call_args_list[0][0][0]
          ),
      )
      self.assertNotEqual(
          state[torchbearer.MODEL],
          mock_board.return_value.add_graph.call_args_list[0][0][0],
      )
  
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 14 for calling the TestTensorBoard obj's underlying member method code with example usage: obj.test_write_graph(mock_rand, mock_board, _) without return types