class_docstr: A block containing a LSTM perception block followed by a
  Slicing Block keeping only the output of the final time step.
  
  For details on flattening see :class:`~maze.perception.blocks.recurrent.lstm.LSTMBlock`.
  For details on dense layers see :class:`~maze.perception.blocks.general.slice.SliceBlock`.
  
  :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 hidden_size: The number of features in the hidden state.
  :param num_layers: Number of recurrent layers.
  :param bidirectional: If True, becomes a bidirectional LSTM.
  :param non_lin: The non-linearity to apply after the final layer.
class_docstr_tok: ["A","block","containing","a","LSTM","perception","block","followed","by","a","Slicing","Block","keeping","only","the","output","of","the","final","time","step",".","For","details","on","flattening","see",":","class",":","`","~maze.perception.blocks.recurrent.lstm.LSTMBlock","`",".","For","details","on","dense","layers","see",":","class",":","`","~maze.perception.blocks.general.slice.SliceBlock","`",".",":","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","hidden_size",":","The","number","of","features","in","the","hidden","state",".",":","param","num_layers",":","Number","of","recurrent","layers",".",":","param","bidirectional",":","If","True",",","becomes","a","bidirectional","LSTM",".",":","param","non_lin",":","The","non-linearity","to","apply","after","the","final","layer","."]
docstr: implementation of :class:`~maze.perception.blocks.base.PerceptionBlock` interface
          
docstr_tok: ["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"""
  
      # forward pass of submodules
      block_output = self.lstm_block(block_input)
      block_output = self.slice_block(block_output)
  
      return block_output
  
file_path: maze/maze/perception/blocks/joint_blocks/lstm_last_step.py
imports: from typing import Union, List, Sequence, Dict
  import torch
  from torch import nn
  from maze.core.annotations import override
  from maze.perception.blocks.base import PerceptionBlock
  from maze.perception.blocks.general.slice import SliceBlock
  from maze.perception.blocks.recurrent.lstm import LSTMBlock
label_desc: Use image node_id 2 for calling the LSTMLastStepBlock obj's underlying member method code with example usage: obj.forward(block_input) and returns: block_output