class maze.perception.blocks.general.functional.FunctionalBlock(*args: Any, **kwargs: Any)

A block applying a custom callable. It processes a tensor or sequence of tensors and returns a tensor or sequence of tensors. If the callable has more than one argument the names of the arguments of the function declaration have to match the in_keys of the tensors.

  • in_keys – One key identifying the input tensors.

  • out_keys – One key identifying the output tensors.

  • in_shapes – List of input shapes.

  • func – A simple callable taking a tensor or a sequence of tensors and returning a tensor or a sequence of tensors.

forward(block_input: Dict[str, torch.Tensor]) → Dict[str, torch.Tensor]

(overrides PerceptionBlock)

Forward pass through the block, applying the callable to the input.

param block_input

The block’s input dictionary.


The block’s output dictionary.