docstr: Tests the Test BC algorithm in single -agent case.
docstr_tok: ["Tests","the","Test","BC","algorithm","in","single","-agent","case","."]
code: def test_bc_algorithm(self):
      """Tests the Test BC algorithm in single -agent case."""
  
      config = (
          BCConfigTest()
          .training(model={"fcnet_hiddens": [32, 32]})
          .experimental(_enable_new_api_stack=True)
      )
  
      # TODO (Kourosh): Add tf2 support
      for fw in framework_iterator(config, frameworks=("torch")):
          algo = config.build(env="CartPole-v1")
          policy = algo.get_policy()
          rl_module = policy.model
  
          if fw == "torch":
              assert isinstance(rl_module, DiscreteBCTorchModule)
          elif fw == "tf2":
              assert isinstance(rl_module, DiscreteBCTFModule)
  
file_path: ray/rllib/core/testing/tests/test_bc_algorithm.py
imports: import unittest
  import gymnasium
  import ray
  from ray.rllib.core.testing.torch.bc_module import DiscreteBCTorchModule, BCTorchRLModuleWithSharedGlobalEncoder, BCTorchMultiAgentModuleWithSharedEncoder
  from ray.rllib.core.testing.tf.bc_module import DiscreteBCTFModule, BCTfRLModuleWithSharedGlobalEncoder, BCTfMultiAgentModuleWithSharedEncoder
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec
  from ray.rllib.core.rl_module.marl_module import MultiAgentRLModuleSpec
  from ray.rllib.core.testing.bc_algorithm import BCConfigTest
  from ray.rllib.utils.test_utils import framework_iterator
  from ray.rllib.examples.env.multi_agent import MultiAgentCartPole
label_desc: Use image node_id 3 for calling the TestLearner obj's underlying member method code with example usage: obj.test_bc_algorithm() without return types