code: def _test_sdpa_rewriter_2(self):
      def dot_prod_attention(
          query: torch.Tensor, key: torch.Tensor, value: torch.Tensor
      ) -> torch.Tensor:
          return (
              torch.matmul(query, key.transpose(-2, -1))
              .mul(1.0 / math.sqrt(key.shape[-1]))
              .softmax(dim=-1)
              .matmul(value)
          )
  
      self._check_common(dot_prod_attention)
      self._check_common(checkpoint_wrapper(dot_prod_attention))
  
imports: import functools
  import itertools
  import math
  import torch
  import torch._inductor.config
  import torch.utils.checkpoint
  from torch._dynamo.test_case import run_tests, TestCase
  from torch._dynamo.utils import counters
  from torch._inductor.utils import run_and_get_code
  from torch.testing._internal.common_cuda import PLATFORM_SUPPORTS_FUSED_ATTENTION, SM80OrLater
  from torch.testing._internal.common_utils import IS_LINUX, skipIfRocm
  from torch.testing._internal.inductor_utils import HAS_CPU, HAS_CUDA
label_desc: Use image node_id 5 for calling the TestSDPAPatternRewriterTemplate obj's underlying member method code with example usage: obj._test_sdpa_rewriter_2() and returns: torch