docstr: Test whether LeelaChessZero can be built with PyTorch frameworks.
docstr_tok: ["Test","whether","LeelaChessZero","can","be","built","with","PyTorch","frameworks","."]
code: def test_leela_chess_zero_compilation(self):
      """Test whether LeelaChessZero can be built with PyTorch frameworks."""
      config = (
          lz.LeelaChessZeroConfig()
          .environment(env=MultiAgentChess)
          .training(
              sgd_minibatch_size=256,
              train_batch_size=256,
              num_sgd_iter=1,
              model={
                  "custom_model": LeelaChessZeroModel,
                  "max_seq_len": 200,
              },
              mcts_config={"num_simulations": 2},
          )
          .resources(num_gpus=0)
      )
      num_iterations = 1
      # Only working for torch right now.
      for _ in framework_iterator(config, frameworks="torch"):
          algo = config.build()
          for i in range(num_iterations):
              results = algo.train()
              check_train_results(results)
              print(results)
          algo.stop()
  
file_path: ray/rllib_contrib/leela_chess_zero/tests/test_leela_chess_zero.py
imports: import unittest
  import rllib_leela_chess_zero.leela_chess_zero.leela_chess_zero
  from rllib_leela_chess_zero.leela_chess_zero.leela_chess_zero_model import LeelaChessZeroModel
  import ray
  from ray.rllib.examples.env.pettingzoo_chess import MultiAgentChess
  from ray.rllib.utils.test_utils import check_train_results, framework_iterator
label_desc: Use image node_id 3 for calling the TestLeelaChessZero obj's underlying member method code with example usage: obj.test_leela_chess_zero_compilation() without return types