code: def test_exceptions(self):
      print("-" * 20, "test exceptions", "-" * 20)
      np_arr = np.random.normal(size=[4, 784]).astype(np.float32)
      tf_tensor = tf.random.normal(shape=[4, 784])
      ni = Input(shape=[4, 784])
  
      try:
          model = Model(inputs=[], outputs=[])
      except Exception as e:
          self.assertIsInstance(e, ValueError)
          print(e)
  
      try:
          model = Model(inputs=np_arr, outputs=np_arr + 1)
      except Exception as e:
          self.assertIsInstance(e, TypeError)
          print(e)
  
      try:
          model = Model(inputs=[np_arr], outputs=[np_arr + 1])
      except Exception as e:
          self.assertIsInstance(e, TypeError)
          print(e)
  
      try:
          model = Model(inputs=[tf_tensor], outputs=[tf_tensor + 1])
      except Exception as e:
          self.assertIsInstance(e, TypeError)
          print(e)
  
      try:
          model = Model(inputs=tf_tensor, outputs=[tf_tensor + 1])
      except Exception as e:
          self.assertIsInstance(e, TypeError)
          print(e)
  
      try:
          model = Model(inputs=ni, outputs=[tf_tensor + 1])
      except Exception as e:
          self.assertIsInstance(e, TypeError)
          print(e)
  
      try:
  
          class ill_model(Model):
              def __init__(self):
                  super(ill_model, self).__init__()
                  self.dense2 = Dense(10, act=None)
  
              def forward(self, x):
                  x = self.dense2(x)
                  return x
  
          model = ill_model()
          weights = model.all_weights
      except Exception as e:
          self.assertIsInstance(e, AttributeError)
          print(e)
  
      try:
          ni = Input([4, 784])
          nn = Dense(10)(ni)
          model = Model(inputs=ni, outputs=nn)
          outputs = model(np_arr)
      except Exception as e:
          self.assertIsInstance(e, ValueError)
          print(e)
  
      try:
          ni = Input([4, 784])
          model = Model(inputs=ni, outputs=ni)
          model.save_weights("./empty_model.h5")
      except Exception as e:
          print(e)
  
      try:
          ni = Input([4, 784])
          nn = Dense(10)(ni)
          model = Model(inputs=ni, outputs=nn)
          model._outputs = None
          outputs = model(np_arr, is_train=True)
      except Exception as e:
          self.assertIsInstance(e, ValueError)
          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 6 for calling the Model_Core_Test obj's underlying member method code with example usage: obj.test_exceptions() and returns: x