code: def test_fit_restore():
      """Test that the pretrainer can be restored and continue training."""
      np.random.seed(123)
      torch.manual_seed(10)
      n_samples = 6
      n_feat = 3
      d_hidden = 3
      n_layers = 1
      n_tasks = 6
  
      X = np.random.rand(n_samples, n_feat)
      y = np.zeros((n_samples, n_tasks)).astype(np.float32)
      dataset = dc.data.NumpyDataset(X, y)
  
      example_model = ExampleTorchModel(
          n_feat, d_hidden, n_layers, n_tasks
      )
      example_model.fit(dataset, nb_epoch=1000)
  
      # Create an identical model, do a single step of fitting with restore=True and make sure it got restored correctly.
      example_model2 = ExampleTorchModel(
          n_feat,
          d_hidden,
          n_layers,
          n_tasks,
          model_dir=example_model.model_dir,
      )
      example_model2.fit(dataset, nb_epoch=1, restore=True)
  
      prediction = np.squeeze(example_model2.predict_on_batch(X))
      assert np.array_equal(y, np.round(prediction))
  
imports: import pytest
  import deepchem
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_fit_restore() without return types