docstr: The same module with an `foo` as a parameter vs. attribute shouldn't
  share types
docstr_tok: ["The","same","module","with","an","`","foo","`","as","a","parameter","vs.","attribute","shouldn't","share","types"]
code: def test_param_vs_attribute(self):
      """
      The same module with an `foo` as a parameter vs. attribute shouldn't
      share types
      """
  
      class M(torch.nn.Module):
          def __init__(self, foo):
              super().__init__()
              self.foo = foo
  
          def forward(self, x):
              return x + self.foo
  
      as_param = torch.nn.Parameter(torch.ones(2, 2))
      as_attr = torch.ones(2, 2)
      param_mod = M(as_param)
      attr_mod = M(as_attr)
      self.assertDifferentType(attr_mod, param_mod)
  
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 8 for calling the TestTypeSharing obj's underlying member method code with example usage: obj.test_param_vs_attribute() and returns: unknown