code: def test_cgan_reload():
      """Test reloading a conditional GAN."""
  
      model_dir = tempfile.mkdtemp()
      gan = ExampleGANModel(learning_rate=0.01, model_dir=model_dir)
      gan.fit_gan(generate_data(gan, 500, 100), generator_steps=0.5)
  
      # See if it has done a plausible job of learning the distribution.
      means = 10 * np.random.random([1000, 1])
      batch_size = len(means)
      noise_input = gan.get_noise_batch(batch_size=batch_size)
      values = gan.predict_gan_generator(
          noise_input=noise_input, conditional_inputs=[means]
      )
      deltas = values - means
      assert np.std(deltas) > 1.0
      assert gan.get_global_step() == 500
  
      reloaded_gan = ExampleGANModel(
          learning_rate=0.01, model_dir=model_dir
      )
      reloaded_gan.restore(strict=False)
      reloaded_values = reloaded_gan.predict_gan_generator(
          noise_input=noise_input, conditional_inputs=[means]
      )
  
      assert np.all(values == reloaded_values)
  
file_path: deepchem/deepchem/models/torch_models/tests/test_gan.py
imports: import deepchem
  import numpy
  import pytest
  import tempfile
  from flaky import flaky
label_desc: Use image node_id 8 for calling a global function with example usage: test_cgan_reload() without return types