docstr: Check weight sharing.
docstr_tok: ["Check","weight","sharing","."]
code: def test_weight_sharing(self):
      """Check weight sharing."""
      m = objax.ModuleList([objax.TrainVar(jn.ones(3))])
      all_vars = m.vars("m1") + m.vars("m2")
      self.assertEqual(len(all_vars), 2)
      self.assertEqual(len(list(all_vars)), 1)
      self.assertEqual(len(all_vars.tensors()), 1)
      all_vars.assign([x + 1 for x in all_vars.tensors()])
      self.assertEqual(m[0].value.sum(), 6)
  
file_path: objax/tests/var_collection.py
imports: import re
  import unittest
  import jax.numpy
  import objax
  from objax.zoo import wide_resnet
label_desc: Use image node_id 3 for calling the TestVarCollection obj's underlying member method code with example usage: obj.test_weight_sharing() without return types