code: def test_lambda_func_with_args(self):
      def customize_func(x, foo=42):
          if foo == 0:
              return tf.nn.relu(x)
          elif foo == 1:
              return tf.nn.sigmoid(x)
          else:
              return tf.identity(x)
  
      class CustomizeModel(tl.models.Model):
          def __init__(self):
              super(CustomizeModel, self).__init__()
              self.dense = tl.layers.Dense(in_channels=1, n_units=5)
              self.lambdalayer = tl.layers.Lambda(
                  customize_func, fn_weights=[], fn_args={"foo": 0}
              )
  
          def forward(self, x, bar):
              z = self.dense(x)
              if bar == -1:
                  zf = self.lambdalayer(z)
              else:
                  zf = self.lambdalayer(z, foo=bar)
              return z, zf
  
      model = CustomizeModel()
      print(model.lambdalayer)
      model.train()
  
      out, out2 = model(self.data_x, bar=-1)
      self.assertTrue(
          np.array_equal(out2.numpy(), tf.nn.relu(out).numpy())
      )
      out, out2 = model(self.data_x, bar=0)
      self.assertTrue(
          np.array_equal(out2.numpy(), tf.nn.relu(out).numpy())
      )
      out, out2 = model(self.data_x, bar=1)
      self.assertTrue(
          np.array_equal(out2.numpy(), tf.nn.sigmoid(out).numpy())
      )
      out, out2 = model(self.data_x, bar=2)
      self.assertTrue(np.array_equal(out2.numpy(), out.numpy()))
  
file_path: TensorLayer/tests/layers/test_layers_lambda.py
imports: import os
  import unittest
  import numpy
  import tensorflow
  import tensorlayer
  from tests.utils import CustomTestCase
label_desc: Use image node_id 4 for calling the Layer_Lambda_Test obj's underlying member method code with example usage: obj.test_lambda_func_with_args() and returns: tf, z,  zf, tf, tf