code: def test_tensorboard():
      """Test logging to Tensorboard."""
      n_data_points = 20
      n_features = 2
      X = np.random.rand(n_data_points, n_features)
      y = [[0.0, 1.0] for x in range(n_data_points)]
      dataset = dc.data.NumpyDataset(X, y)
      pytorch_model = torch.nn.Sequential(
          torch.nn.Linear(n_features, 2), torch.nn.Softmax(dim=1)
      )
      model = dc.models.TorchModel(
          pytorch_model,
          dc.models.losses.CategoricalCrossEntropy(),
          tensorboard=True,
          log_frequency=1,
      )
      model.fit(dataset, nb_epoch=10)
      files_in_dir = os.listdir(model.model_dir)
      event_file = list(
          filter(lambda x: x.startswith("events"), files_in_dir)
      )
      assert len(event_file) > 0
      event_file = os.path.join(model.model_dir, event_file[0])
      file_size = os.stat(event_file).st_size
      assert file_size > 0
  
file_path: deepchem/deepchem/models/tests/test_torch_model.py
imports: import os
  import pytest
  import deepchem
  import numpy
  import math
  import unittest
label_desc: Use image node_id 10 for calling a global function with example usage: test_tensorboard() without return types