code: def test_textCNN_classification_reload():
      """Test textCNN model reloadinng."""
      np.random.seed(123)
      tf.random.set_seed(123)
      n_tasks = 1
  
      featurizer = dc.feat.RawFeaturizer()
      mols = ["C", "CO", "CC"]
      n_samples = len(mols)
      X = featurizer(mols)
      y = np.random.randint(2, size=(n_samples, n_tasks))
      dataset = dc.data.NumpyDataset(X, y, ids=mols)
  
      classification_metric = dc.metrics.Metric(
          dc.metrics.roc_auc_score
      )
  
      char_dict, length = dc.models.TextCNNModel.build_char_dict(
          dataset
      )
      batch_size = 3
  
      model_dir = tempfile.mkdtemp()
      model = dc.models.TextCNNModel(
          n_tasks,
          char_dict,
          seq_length=length,
          batch_size=batch_size,
          learning_rate=0.001,
          use_queue=False,
          mode="classification",
          model_dir=model_dir,
      )
  
      # Fit trained model
      model.fit(dataset, nb_epoch=200)
  
      # Eval model on train
      scores = model.evaluate(dataset, [classification_metric])
      assert scores[classification_metric.name] > 0.8
  
      # Reload trained model
      reloaded_model = dc.models.TextCNNModel(
          n_tasks,
          char_dict,
          seq_length=length,
          batch_size=batch_size,
          learning_rate=0.001,
          use_queue=False,
          mode="classification",
          model_dir=model_dir,
      )
      reloaded_model.restore()
  
      # Eval model on train
      scores = reloaded_model.evaluate(dataset, [classification_metric])
      assert scores[classification_metric.name] > 0.8
  
      assert len(reloaded_model.model.get_weights()) == len(
          model.model.get_weights()
      )
      for reloaded, orig in zip(
          reloaded_model.model.get_weights(), model.model.get_weights()
      ):
          assert np.all(reloaded == orig)
  
      # Check predictions match on random sample
      predmols = ["CCCC", "CCCCCO", "CCCCC"]
      Xpred = featurizer(predmols)
      predset = dc.data.NumpyDataset(Xpred, ids=predmols)
      origpred = model.predict(predset)
      reloadpred = reloaded_model.predict(predset)
      assert np.all(origpred == reloadpred)
  
      assert len(model.model.layers) == len(reloaded_model.model.layers)
  
imports: import os
  import pytest
  import tempfile
  import numpy
  import deepchem
  import scipy.io
  from flaky import flaky
  from sklearn.ensemble import RandomForestClassifier
  from deepchem.molnet.load_function.chembl25_datasets import CHEMBL25_TASKS
  from deepchem.feat import create_char_to_idx
label_desc: Use image node_id 15 for calling a global function with example usage: test_textCNN_classification_reload() without return types