docstr: Generate a simple test case that has multiple simultaneously-live intermediate tensors.
docstr_tok: ["Generate","a","simple","test","case","that","has","multiple","simultaneously-live","intermediate","tensors","."]
code: def _generate(self, *, device):
      """
      Generate a simple test case that has multiple simultaneously-live intermediate tensors.
      """
  
      def f(x, y, z):
          t0 = x.matmul(y)
          t1 = x.matmul(z)
          t0 = x.transpose(0, 1).matmul(t1)
          t1 = x.matmul(t0)
          return t0.sum() + t1.sum()
  
      x = torch.randn((3, 2), device=device)
      y = torch.randn((2, 4), device=device)
      z = torch.randn((2, 3), device=device)
      return (f, (x, y, z))
  
file_path: pytorch/test/inductor/test_memory_planning.py
imports: import sys
  from torch.testing._internal.common_utils import IS_CI, IS_WINDOWS, skipIfRocm
  import unittest
  from typing import List
  import torch
  from test_torchinductor import run_and_get_cpp_code
  from torch._C import FileCheck
  from torch._dynamo.test_case import run_tests, TestCase
  from torch._dynamo.utils import same
  from torch._inductor import config
  from torch.utils._triton import has_triton
label_desc: Use image node_id 1 for calling the TestMemoryPlanning obj's underlying member method code with example usage: obj._generate() and returns: f,  x,  y,  z, unknown