code: def test_rich_summary_tuples(mock_table_add_row, mock_console):
      """Ensure that tuples are converted into string, and print is called correctly."""
      model_summary = RichModelSummary()
  
      class TestModel(BoringModel):
          @property
          def example_input_array(self) -> Any:
              return torch.randn(4, 32)
  
      model = TestModel()
      summary = summarize(model)
      summary_data = summary._get_summary_data()
  
      model_summary.summarize(
          summary_data=summary_data,
          total_parameters=1,
          trainable_parameters=1,
          model_size=1,
      )
  
      # ensure that summary was logged + the breakdown of model parameters
      assert mock_console.call_count == 2
      # assert that the input summary data was converted correctly
      args, _ = mock_table_add_row.call_args_list[0]
      assert args[1:] == (
          "0",
          "layer",
          "Linear",
          "66  ",
          "[4, 32]",
          "[4, 2]",
      )
  
file_path: pytorch-lightning/tests/tests_pytorch/callbacks/test_rich_model_summary.py
imports: from typing import Any
  from unittest import mock
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import RichModelSummary, RichProgressBar
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.utilities.model_summary import summarize
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 3 for calling a global function with example usage: test_rich_summary_tuples(mock_table_add_row, mock_console) and returns: torch