docstr: Solve Traveling Salesman Problem. Cities comes from a fixed set of nodes (cities).
  Easily hit reward threshold after one batch training
docstr_tok: ["Solve","Traveling","Salesman","Problem",".","Cities","comes","from","a","fixed","set","of","nodes","(","cities",")",".","Easily","hit","reward","threshold","after","one","batch","training"]
code: def test_seq2slate_transformer_on_policy_simple_tsp(self):
      """
      Solve Traveling Salesman Problem. Cities comes from a fixed set of nodes (cities).
      Easily hit reward threshold after one batch training
      """
      device = torch.device("cpu")
      batch_size = 4096
      epochs = 1
      num_batches = 50
      expect_reward_threshold = 1.12
      hidden_size = 32
      num_candidates = 6
      diverse_input = False
      learning_rate = 0.001
      learning_method = ON_POLICY
      policy_gradient_interval = 1
      run_seq2slate_tsp(
          MODEL_TRANSFORMER,
          batch_size,
          epochs,
          num_candidates,
          num_batches,
          hidden_size,
          diverse_input,
          learning_rate,
          expect_reward_threshold,
          learning_method,
          policy_gradient_interval,
          device,
      )
  
imports: import itertools
  import logging
  import random
  import unittest
  from collections import defaultdict
  from itertools import permutations
  import numpy
  import pytest
  import reagent.core.types
  import torch
  import torch.nn.functional
  from parameterized import parameterized
  from reagent.model_utils.seq2slate_utils import DECODER_START_SYMBOL, mask_logits_by_idx, per_symbol_to_per_seq_log_probs, per_symbol_to_per_seq_probs, pytorch_decoder_mask, Seq2SlateMode, Seq2SlateOutputArch, subsequent_mask
  from reagent.test.ranking.seq2slate_utils import create_batch, create_seq2slate_net, MODEL_TRANSFORMER, ON_POLICY, rank_on_policy, run_seq2slate_tsp
label_desc: Use image node_id 9 for calling the TestSeq2SlateOnPolicy obj's underlying member method code with example usage: obj.test_seq2slate_transformer_on_policy_simple_tsp() without return types