class_docstr: Test Case: To test simple fork/wait operation in a graph
  fork is called on simple addition operation on input tensors
class_docstr_tok: ["Test","Case",":","To","test","simple","fork\/wait","operation","in","a","graph","fork","is","called","on","simple","addition","operation","on","input","tensors"]
code: def test_fork_wait_exception(self):
      # incompatible tensors for add due to shape mismatch
      input1 = torch.randn(4, 7)
      input2 = torch.randn(4, 5)
      torch_graph = torch.jit.script(fork_wait_graph_exception)
      try:
          static_runtime_module = StaticModule(torch_graph)
          output_test = static_runtime_module(input1, input2)
      except Exception as error:
          expected_error_msg = (
              "The size of tensor a (7) must match the size "
              "of tensor b (5) at non-singleton dimension 1"
          )
          # test fails if error does not contain expected substr
          if str(error).find(expected_error_msg) == -1:
              raise RuntimeError(
                  "Tried execution of add.Tensors with incompatible shape. "
                  "Exception raised by forked runtime execution does "
                  f'not contain expected substring: "{expected_error_msg}"'
              ) from error
  
imports: import unittest
  from typing import Dict, Optional
  import numpy
  import torch
  from torch import nn
  from torch.testing._internal.common_utils import TestCase, run_tests
  from typing import List
label_desc: Use image node_id 9 for calling the TestStaticModule obj's underlying member method code with example usage: obj.test_fork_wait_exception() without return types