class_docstr: Model that handles simple discrete action masking.
  
  This assumes the outputs are logits for a single Categorical action dist.
  Getting this to work with a more complex output (e.g., if the action space
  is a tuple of several distributions) is also possible but left as an
  exercise to the reader.
class_docstr_tok: ["Model","that","handles","simple","discrete","action","masking",".","This","assumes","the","outputs","are","logits","for","a","single","Categorical","action","dist",".","Getting","this","to","work","with","a","more","complex","output","(","e.g.",",","if","the","action","space","is","a","tuple","of","several","distributions",")","is","also","possible","but","left","as","an","exercise","to","the","reader","."]
code: def __init__(
      self,
      obs_space,
      action_space,
      num_outputs,
      model_config,
      name,
      **kwargs,
  ):
      orig_space = getattr(obs_space, "original_space", obs_space)
      assert (
          isinstance(orig_space, Dict)
          and "action_mask" in orig_space.spaces
          and "observations" in orig_space.spaces
      )
  
      super().__init__(
          obs_space, action_space, num_outputs, model_config, name
      )
  
      self.internal_model = FullyConnectedNetwork(
          orig_space["observations"],
          action_space,
          num_outputs,
          model_config,
          name + "_internal",
      )
  
      # disable action masking --> will likely lead to invalid actions
      self.no_masking = model_config["custom_model_config"].get(
          "no_masking", False
      )
  
file_path: ray/rllib/examples/models/action_mask_model.py
imports: from gymnasium.spaces import Dict
  from ray.rllib.models.tf.fcnet import FullyConnectedNetwork
  from ray.rllib.models.tf.tf_modelv2 import TFModelV2
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.models.torch.fcnet import FullyConnectedNetwork
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
  from ray.rllib.utils.torch_utils import FLOAT_MIN
label_desc: Use image node_id 1 to create a new ActionMaskModel object from inherited base classes: TFModelV2 with example: obj = ActionMaskModel(obs_space, action_space, num_outputs, model_config, name)