hunk.code_window: from ray.rllib.utils.framework import try_import_tf
   from ray.rllib.agents.registry import get_agent_class
   from ray.rllib.models.tf.fcnet_v2 import FullyConnectedNetwork as FCNetV2
   from ray.rllib.models.tf.visionnet_v2 import VisionNetwork as VisionNetV2
   from ray.rllib.tests.test_multi_agent_env import MultiCartpole, \
       MultiMountainCar
   from ray.rllib.utils.error import UnsupportedSpaceException
   from ray.tune.registry import register_env
  
hunk.labels: keep keep keep add keep keep keep keep
hunk.after_edit: from ray.rllib.models.torch.visionnet import VisionNetwork as TorchVisionNetV2
   from ray.rllib.models.torch.fcnet import FullyConnectedNetwork as TorchFCNetV2
  
hunk.file_path: rllib/tests/test_supported_spaces.py
hunk.type: add
file: import unittest
  
  import ray
  from ray.rllib.agents.a3c import a2c_pipeline
  
  
  class TestA2C(unittest.TestCase):
      """Sanity tests for A2CPipeline."""
  
      def setUp(self):
          ray.init()
  
      def tearDown(self):
          ray.shutdown()
  
      def test_a2c_pipeline(ray_start_regular):
          trainer = a2c_pipeline.A2CPipeline(
              env="CartPole-v0", config={"min_iter_time_s": 0})
          assert isinstance(trainer.train(), dict)
  
      def test_a2c_pipeline_microbatch(ray_start_regular):
          trainer = a2c_pipeline.A2CPipeline(
              env="CartPole-v0",
              config={
                  "min_iter_time_s": 0,
                  "microbatch_size": 10
              })
          assert isinstance(trainer.train(), dict)
  
  
  if __name__ == "__main__":
      import pytest
      import sys
      sys.exit(pytest.main(["-v", __file__]))
  