code: def test_enum_as_module_attribute(self):
      class Color(Enum):
          RED = 1
          GREEN = 2
  
      class TestModule(torch.nn.Module):
          def __init__(self, e: Color):
              super().__init__()
              self.e = e
  
          def forward(self):
              return self.e.value
  
      m = TestModule(Color.RED)
      scripted = torch.jit.script(m)
  
      FileCheck().check("TestModule").check_next("Color").check_same(
          'prim::GetAttr[name="e"]'
      ).check_next("prim::EnumValue").check_next("return").run(
          str(scripted.graph)
      )
  
      self.assertEqual(scripted(), Color.RED.value)
  
imports: import os
  import sys
  import torch
  from torch.testing import FileCheck
  from enum import Enum
  from typing import Any, List
  from torch.testing._internal.jit_utils import JitTestCase, make_global
label_desc: Use image node_id 11 for calling the TestEnum obj's underlying member method code with example usage: obj.test_enum_as_module_attribute() and returns: self