code: def test_modellayer(self):
      print("-" * 20, "test_modellayer", "-" * 20)
      test_flag = True
  
      try:
  
          class inner_model(Model):
              def __init__(self):
                  super(inner_model, self).__init__()
                  self.layer1 = tl.layers.Dense(
                      n_units=4, in_channels=5, name="dense1"
                  )
                  self.layer2 = tl.layers.Dense(
                      n_units=4, in_channels=4, name="dense1"
                  )
  
              def forward(self, x):
                  return self.layer2(self.layer1(x))
  
          inputs = tl.layers.Input([10, 5])
          model_layer = tl.layers.ModelLayer(inner_model())(inputs)
          model = tl.models.Model(
              inputs=inputs, outputs=model_layer, name="modellayermodel"
          )
          print(model)
          print([w.name for w in model.all_weights])
          test_flag = False
      except Exception as e:
          print(e)
      if not test_flag:
          self.fail("Fail to detect duplicate name in ModelLayer")
  
imports: import os
  import unittest
  import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer.layers import *
  from tensorlayer.models import *
  from tests.utils import CustomTestCase
label_desc: Use image node_id 8 for calling the Auto_Naming_Test obj's underlying member method code with example usage: obj.test_modellayer() and returns: self