docstr: Since we can't guarantee that methods are the same between different
  trace runs, tracing must always generate a unique type.
docstr_tok: ["Since","we","ca","n't","guarantee","that","methods","are","the","same","between","different","trace","runs",",","tracing","must","always","generate","a","unique","type","."]
code: def test_tracing_gives_different_types(self):
      """
      Since we can't guarantee that methods are the same between different
      trace runs, tracing must always generate a unique type.
      """
  
      class M(torch.nn.Module):
          def forward(self, x, y):
              if x.sum() > y.sum():
                  return x
              else:
                  return y
  
      a = torch.jit.trace(M(), (torch.zeros(1, 1), torch.ones(1, 1)))
      b = torch.jit.trace(M(), (torch.ones(1, 1), torch.zeros(1, 1)))
      self.assertDifferentType(a, b)
  
imports: import os
  import sys
  import io
  import torch
  from torch.testing._internal.jit_utils import JitTestCase
  from torch.testing._internal.common_utils import suppress_warnings
label_desc: Use image node_id 19 for calling the TestTypeSharing obj's underlying member method code with example usage: obj.test_tracing_gives_different_types() and returns: x, y