code: def test_if_propagation(self):
      @torch.jit.script
      def foo(i: int, z):
          x = torch.ones([2, 3, 4, 5])
          y = z.view([z.size(i), 3, 2, z.size(i)])
          if i == 4:
              return x
          else:
              return y
  
      torch._C._jit_pass_constant_propagation(foo.graph)
      torch._C._jit_pass_propagate_shapes_on_graph(foo.graph)
      view = foo.graph.findNode("aten::view")
  
      def neg_to_one(li):
          return [elem if elem >= 0 else -1 for elem in li]
  
      self.assertEqual(
          neg_to_one(view.output().type().symbolic_sizes()),
          [-1, 3, 2, -1],
      )
      if_out = next(foo.graph.findNode("prim::If").outputs())
      self.assertEqual(
          neg_to_one(if_out.type().symbolic_sizes()), [-1, 3, -1, -1]
      )
  
imports: import operator
  import unittest
  from textwrap import dedent
  import torch
  from torch import nn, Tensor
  from torch.testing import FileCheck
  from torch.testing._internal.common_methods_invocations import sample_inputs_cat_concat
  from torch.testing._internal.common_utils import make_tensor
  from torch.testing._internal.jit_utils import JitTestCase, execWrapper
  from typing import List, Any
label_desc: Use image node_id 6 for calling the TestSymbolicShapeAnalysis obj's underlying member method code with example usage: obj.test_if_propagation() and returns: unknown, x, y