class_docstr: A slicing block. This is for example useful for slicing the last time step in recurrent blocks by its index.
  
  :param in_keys: One key identifying the input tensors.
  :param out_keys: One key identifying the output tensors.
  :param in_shapes: List of input shapes.
  :param slice_dim: The dimension to slice from.
  :param slice_idx: The index to slice.
docstr: implementation of :class:`~maze.perception.blocks.base.PerceptionBlock` interface
          
code: def forward(
      self, block_input: Dict[str, torch.Tensor]
  ) -> Dict[str, torch.Tensor]:
      """implementation of :class:`~maze.perception.blocks.base.PerceptionBlock` interface"""
  
      # check input tensor
      input_tensor = block_input[self.in_keys[0]]
  
      # forward pass
      output_tensor = torch.narrow(
          input_tensor,
          dim=self.slice_dim,
          start=self.slice_idx,
          length=1,
      )
      output_tensor = output_tensor.squeeze(dim=self.slice_dim)
  
      return {self.out_keys[0]: output_tensor}
  
file_path: maze/maze/perception/blocks/general/slice.py
imports: from typing import Union, List, Sequence, Dict
  import torch
  from maze.core.annotations import override
  from maze.perception.blocks.base import PerceptionBlock
label_desc: Use image node_id 2 for calling the SliceBlock obj's underlying member method code with example usage: obj.forward(block_input) and returns: dict