docstr: Make sure ModuleSummary works for a single layer.
docstr_tok: ["Make","sure","ModuleSummary","works","for","a","single","layer","."]
code: def test_module_summary_layer(self) -> None:
      """Make sure ModuleSummary works for a single layer."""
      model = torch.nn.Conv2d(3, 8, 3)
      ms1 = get_module_summary(model)
      ms2 = get_module_summary(
          model, module_args=(torch.randn(1, 3, 8, 8),)
      )
  
      self.assertEqual(ms1.module_name, "")
      self.assertEqual(ms1.module_type, "Conv2d")
      self.assertEqual(ms1.num_parameters, 224)
      self.assertEqual(ms1.num_trainable_parameters, 224)
      self.assertEqual(ms1.size_bytes, 224 * 4)
      self.assertEqual(ms1.submodule_summaries, {})
      self.assertFalse(ms1.has_uninitialized_param)
  
      self.assertEqual(ms1.module_name, ms2.module_name)
      self.assertEqual(ms1.module_type, ms2.module_type)
      self.assertEqual(ms1.num_parameters, ms2.num_parameters)
      self.assertEqual(
          ms1.num_trainable_parameters, ms2.num_trainable_parameters
      )
      self.assertEqual(ms1.size_bytes, ms2.size_bytes)
      self.assertEqual(ms1.submodule_summaries, ms2.submodule_summaries)
  
      self.assertEqual(ms2.flops_forward, 7776)
      self.assertEqual(ms2.flops_backward, 7776)
  
      self.assertEqual(ms1.in_size, "?")
      self.assertEqual(ms1.out_size, "?")
      self.assertEqual(ms2.in_size, [1, 3, 8, 8])
      self.assertEqual(ms2.out_size, [1, 8, 6, 6])
  
imports: import unittest
  from typing import Any, Dict, Optional, Tuple
  import torch
  from torchtnt.utils.module_summary import _get_human_readable_count, get_module_summary, ModuleSummary, prune_module_summary
  from torchvision import models
  from torchvision.models.alexnet import AlexNet_Weights
  from torchvision.models.resnet import ResNet18_Weights
label_desc: Use image node_id 2 for calling the ModuleSummaryTest obj's underlying member method code with example usage: obj.test_module_summary_layer() without return types