class_docstr: Interface for all perception blocks.
  Perception blocks provide a mapping of M input tensors to N output tensors.
  Both input and output tensors are stored in a dictionary with unique keys.
  
  :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: ["Interface","for","all","perception","blocks",".","Perception","blocks","provide","a","mapping","of","M","input","tensors","to","N","output","tensors",".","Both","input","and","output","tensors","are","stored","in","a","dictionary","with","unique","keys",".",":","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: Union[str, List[str]],
      out_keys: Union[str, List[str]],
      in_shapes: Union[Sequence[int], List[Sequence[int]]],
  ):
      super().__init__()
      self.in_keys: List[str] = (
          in_keys if isinstance(in_keys, List) else [in_keys]
      )
      self.out_keys: List[str] = (
          out_keys if isinstance(out_keys, List) else [out_keys]
      )
      self.in_shapes: List[Sequence[int]] = (
          in_shapes if isinstance(in_shapes, List) else [in_shapes]
      )
  
      # Initialize the dummy dict creators. That is a dictionary linking every in_key index to a callable taking no
      #   arguments and returning a random tensor with the correct shape. This dict should be updated in child
      #   classes if special properties have to hold for a given input (e.g. binary values, symmetric structure,..)
      self.dummy_dict_creators: Dict[
          int, Callable[[], torch.Tensor]
      ] = dict()
      for ii, in_key in enumerate(self.in_keys):
          self.dummy_dict_creators[
              ii
          ] = self._default_dummy_creator_factory(self.in_shapes[ii])
  
file_path: maze/maze/perception/blocks/base.py
imports: from abc import ABC, abstractmethod
  from typing import Dict, Union, List, Sequence, Callable
  import numpy
  import torch
  from torch import nn
label_desc: Use image node_id 1 to create a new PerceptionBlock object from inherited base classes: ABC, nn with example: obj = PerceptionBlock(in_keys, out_keys, in_shapes)