code: def testTrainAgentWithMask(self):
      time_step_spec = ts.time_step_spec(
          observation_spec=(
              tensor_spec.TensorSpec([2], tf.float32),
              tensor_spec.TensorSpec([3], tf.int32),
          ),
          reward_spec=tensor_spec.TensorSpec([3], tf.float32),
      )
      optimizer = tf.compat.v1.train.GradientDescentOptimizer(
          learning_rate=0.01
      )
      agent = greedy_multi_objective_agent.GreedyMultiObjectiveNeuralAgent(
          time_step_spec,
          self._action_spec,
          self._scalarizer,
          objective_network_and_loss_fn_sequence=self._create_objective_network_and_loss_fn_sequence(),
          optimizer=optimizer,
          observation_and_action_constraint_splitter=lambda x: (
              x[0],
              x[1],
          ),
      )
      observations = (
          np.array([[1, 2], [3, 4]], dtype=np.float32),
          np.array([[1, 0, 0], [1, 1, 0]], dtype=np.int32),
      )
      actions = np.array([0, 1], dtype=np.int32)
      objectives = np.array([[1, 2, 3], [6, 5, 4]], dtype=np.float32)
      (
          initial_step,
          final_step,
      ) = _get_initial_and_final_steps_with_action_mask(
          observations, objectives
      )
      action_step = _get_action_step(actions)
      experience = _get_experience(
          initial_step, action_step, final_step
      )
      loss_before, _ = agent.train(experience, None)
      loss_after, _ = agent.train(experience, None)
      self.evaluate(tf.compat.v1.initialize_all_variables())
      self.assertAllClose(self.evaluate(loss_before), 763.5)
      self.assertLess(self.evaluate(loss_after), 763.5)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import List, Tuple
  import numpy
  import tensorflow
  from tf_agents.bandits.agents import greedy_multi_objective_neural_agent
  from tf_agents.bandits.drivers import driver_utils
  from tf_agents.bandits.multi_objective import multi_objective_scalarizer
  from tf_agents.bandits.networks import global_and_arm_feature_network
  from tf_agents.bandits.networks import heteroscedastic_q_network
  from tf_agents.bandits.specs import utils
  from tf_agents.networks import network
  from tf_agents.policies import utils
  from tf_agents.specs import array_spec
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
label_desc: Use image node_id 17 for calling the MultiObjectiveAgentTest obj's underlying member method code with example usage: obj.testTrainAgentWithMask() without return types