class_docstr: Applies a legal actions mask to a linear chain of modules / callables.
  
  It is assumed the trailing dimension of the final layer (representing
  action values) is the same as the trailing dimension of legal_actions.
code: def __init__(
      self,
      layers: Optional[Iterable[Callable[..., Any]]] = None,
      name: str = "MaskedSequential",
  ):
      super().__init__(name=name)
      self._layers = list(layers) if layers is not None else []
      self._illegal_action_penalty = -1e9
  
file_path: acme/acme/tf/networks/legal_actions.py
imports: from typing import Any, Callable, Iterable, Optional, Union
  from acme.wrappers import open_spiel_wrapper
  import numpy
  import sonnet
  import tensorflow
  import tensorflow_probability
label_desc: Use image node_id 1 to create a new MaskedSequential object from inherited base classes: snt with example: obj = MaskedSequential(layers, name)