code: def test_layer_shared_parameter_name_different_namescopes(self):
      output_dims = 2
      with scope.NameScope("global_scope"):
          with ParameterSharing({"scope_1": "scope_0"}):
              with scope.NameScope("scope_0"):
                  fc1_output = self.model.FC(
                      self.model.input_feature_schema.float_features,
                      output_dims,
                  )
                  self.assertEqual(
                      self.model.layers[-1].w,
                      "global_scope/scope_0/fc/w",
                  )
                  self.assertEqual(
                      fc1_output(), "global_scope/scope_0/fc/output"
                  )
  
              with scope.NameScope("scope_1"):
                  fc2_output = self.model.FC(
                      self.model.input_feature_schema.float_features,
                      output_dims,
                  )
                  self.assertEqual(
                      self.model.layers[-1].w,
                      "global_scope/scope_0/fc/w",
                  )
                  self.assertEqual(
                      fc2_output(), "global_scope/scope_1/fc/output"
                  )
  
file_path: pytorch/caffe2/python/layer_parameter_sharing_test.py
imports: from caffe2.python import core, scope
  from caffe2.python.modeling.parameter_sharing import ParameterSharing
  from caffe2.python.optimizer import AdagradOptimizer, AdamOptimizer
  from caffe2.python.layer_test_util import LayersTestCase
label_desc: Use image node_id 2 for calling the ParameterSharingTest obj's underlying member method code with example usage: obj.test_layer_shared_parameter_name_different_namescopes() without return types