code: def test_dynamic_basic(self):
      print("-" * 20, "test_dynamic_basic", "-" * 20)
      model_basic = basic_dynamic_model()
  
      # test empty model before calling
      self.assertEqual(model_basic.is_train, None)
      self.assertEqual(model_basic._all_weights, None)
      self.assertEqual(model_basic._inputs, None)
      self.assertEqual(model_basic._outputs, None)
      self.assertEqual(model_basic._model_layer, None)
      self.assertEqual(model_basic._all_layers, None)
      self.assertEqual(model_basic._nodes_fixed, False)
  
      # test layer and weights access
      all_layers = model_basic.all_layers
      self.assertEqual(len(model_basic.all_layers), 7)
      self.assertEqual(model_basic._all_weights, None)
  
      self.assertIsNotNone(model_basic.all_weights)
      print([w.name for w in model_basic.all_weights])
  
      # test model mode
      model_basic.train()
      self.assertEqual(model_basic.is_train, True)
      model_basic.eval()
      self.assertEqual(model_basic.is_train, False)
      model_basic.test()
      self.assertEqual(model_basic.is_train, False)
      model_basic.infer()
      self.assertEqual(model_basic.is_train, False)
  
      # test as_layer
      try:
          model_basic.as_layer()
      except Exception as e:
          print(e)
      self.assertIsNone(model_basic._model_layer)
  
      # test print
      try:
          print(model_basic)
      except Exception as e:
          print(e)
  
      # test forwarding
      inputs = np.random.normal(size=[2, 24, 24, 3]).astype(np.float32)
      outputs1 = model_basic(inputs)
      self.assertEqual(model_basic._nodes_fixed, True)
      self.assertEqual(model_basic.is_train, False)
  
      try:
          outputs2 = model_basic(inputs, is_train=True)
      except Exception as e:
          print(e)
      outputs2 = model_basic(inputs, is_train=False)
      self.assertEqual(model_basic.is_train, False)
  
      self.assertLess(
          np.max(np.abs(outputs1.numpy() - outputs2.numpy())), 1e-7
      )
  
      # test layer node
      self.assertEqual(len(model_basic.all_layers[-1]._nodes), 0)
      self.assertEqual(model_basic.all_layers[-2]._nodes_fixed, True)
  
      # test release_memory
      try:
          model_basic.release_memory()
      except Exception as e:
          print(e)
  
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 3 for calling the Model_Core_Test obj's underlying member method code with example usage: obj.test_dynamic_basic() without return types