code: def test_rnn_summary_shapes(max_depth):
      """Test that the model summary works for RNNs."""
      model = ParityModuleRNN()
  
      b = 3
      t = 5
      i = model.rnn.input_size
      h = model.rnn.hidden_size
      o = model.linear_out.out_features
  
      model.example_input_array = torch.zeros(b, t, 10)
  
      summary = summarize(model, max_depth=max_depth)
      assert summary.in_sizes == [[b, t, i], [b, t, h]]  # rnn  # linear
      assert summary.out_sizes == [
          [[b, t, h], [[1, b, h], [1, b, h]]],
          [b, t, o],
      ]
  
imports: from collections import OrderedDict
  from typing import Any
  import pytest
  import torch
  import torch.nn
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_0
  from lightning.pytorch import LightningModule, Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.utilities.model_summary.model_summary import LEFTOVER_PARAMS_NAME, NOT_APPLICABLE, UNKNOWN_SIZE, ModelSummary, summarize
  from tests_pytorch.helpers.advanced_models import ParityModuleRNN
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 6 for calling a global function with example usage: test_rnn_summary_shapes(max_depth) without return types