class_docstr: An action masking block.
  
  The block takes two keys as input where the first key contains the logits tensor and the second key contains the
  binary mask tensor. Masking is performed by adding the smallest possible float32 number to the logits where the
  corresponding mask value is False (0.0).
  
  :param in_keys: Keys identifying the input tensors.
  :param out_keys: Keys identifying the output tensors.
  :param in_shapes: List of input shapes.
class_docstr_tok: ["An","action","masking","block",".","The","block","takes","two","keys","as","input","where","the","first","key","contains","the","logits","tensor","and","the","second","key","contains","the","binary","mask","tensor",".","Masking","is","performed","by","adding","the","smallest","possible","float32","number","to","the","logits","where","the","corresponding","mask","value","is","False","(","0.0",")",".",":","param","in_keys",":","Keys","identifying","the","input","tensors",".",":","param","out_keys",":","Keys","identifying","the","output","tensors",".",":","param","in_shapes",":","List","of","input","shapes","."]
code: def __init__(
      self,
      in_keys: List[str],
      out_keys: Union[str, List[str]],
      in_shapes: List[Sequence[int]],
      num_actors: int,
      num_of_actor_actions: Union[int, None],
  ):
      super().__init__(
          in_keys=in_keys, out_keys=out_keys, in_shapes=in_shapes
      )
      assert (
          len(self.out_keys) == num_actors
      ), f"The number of out_keys should be equal to the number of actors"
      assert len(self.in_keys) == 2
      assert len(self.in_shapes) == 2
  
      self.num_actors = num_actors
      self.num_of_actor_actions = num_of_actor_actions
  
file_path: maze/maze/perception/blocks/general/action_masking.py
imports: from typing import Union, List, Dict, Sequence
  import numpy
  import torch
  from maze.core.annotations import override
  from maze.perception.blocks.base import PerceptionBlock
label_desc: Use image node_id 1 to create a new ActionMaskingBlock object from inherited base classes: PerceptionBlock with example: obj = ActionMaskingBlock(in_keys, out_keys, in_shapes, num_actors, num_of_actor_actions)