code: def test_same_agent_train(self):
      if not tf.executing_eagerly():
          self.skipTest(
              "Skipping test: sequential networks not supported in TF1"
          )
  
      tf.random.set_seed(111)
      agent_seq = PPOAgentSequential()
      tf.random.set_seed(111)
      agent_act_dist = PPOAgentActorDist()
      batch_size = 2
      n_time_steps = 3
  
      action_distribution_parameters = {
          "loc": tf.constant(
              [[[0.0]] * n_time_steps] * batch_size, dtype=tf.float32
          ),
          "scale": tf.constant(
              [[[1.0]] * n_time_steps] * batch_size, dtype=tf.float32
          ),
      }
      observations = tf.constant(
          [
              [[1], [3], [5]],
              [[2], [4], [6]],
          ],
          dtype=tf.float32,
      )
  
      mid_time_step_val = ts.StepType.MID.tolist()
      time_steps = ts.TimeStep(
          step_type=tf.constant(
              [[mid_time_step_val] * n_time_steps] * batch_size,
              dtype=tf.int32,
          ),
          reward=tf.constant(
              [[1] * n_time_steps] * batch_size, dtype=tf.float32
          ),
          discount=tf.constant(
              [[1] * n_time_steps] * batch_size, dtype=tf.float32
          ),
          observation=observations,
      )
      actions = tf.constant(
          [[[0], [1], [1]], [[0], [1], [1]]], dtype=tf.float32
      )
  
      value_preds = tf.constant(
          [[9.0, 15.0, 21.0], [9.0, 15.0, 21.0]], dtype=tf.float32
      )
      policy_info = {
          "dist_params": action_distribution_parameters,
          "value_prediction": value_preds,
      }
      experience = trajectory.Trajectory(
          time_steps.step_type,
          observations,
          actions,
          policy_info,
          time_steps.step_type,
          time_steps.reward,
          time_steps.discount,
      )
      act_dist_loss = agent_act_dist.train(experience).loss
  
      policy_info["dist_params"]["scale_diag"] = policy_info[
          "dist_params"
      ].pop("scale")
      seq_loss = agent_seq.train(experience).loss
      self.assertAllEqual(act_dist_loss, seq_loss)
  
      seq_variables = agent_seq._actor_net.trainable_weights
      act_dist_variables = agent_act_dist._actor_net.trainable_weights
  
      self.assertEqual(len(seq_variables), len(act_dist_variables))
      set_seq_weights = set()
      set_act_dist_weights = set()
      for i in range(len(seq_variables)):
          set_seq_weights.add(seq_variables[i].numpy().sum())
          set_act_dist_weights.add(act_dist_variables[i].numpy().sum())
      self.assertSetEqual(set_seq_weights, set_act_dist_weights)
  
imports: from absl import flags
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents.agents.ppo import ppo_actor_network
  from tf_agents.agents.ppo import ppo_agent
  from tf_agents.agents.ppo import ppo_policy
  from tf_agents.distributions import utils
  from tf_agents.networks import actor_distribution_network
  from tf_agents.networks import value_network
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.utils import test_utils
label_desc: Use image node_id 7 for calling the PpoActorNetworkTest obj's underlying member method code with example usage: obj.test_same_agent_train() without return types