code: def test_custom_fn(self):
      obj = {"activation": custom_fn}
      serialized, _, reserialized = self.roundtrip(
          obj, custom_objects={"custom_fn": custom_fn}
      )
      self.assertEqual(serialized, reserialized)
  
      # Test inside layer
      dense = keras.layers.Dense(1, activation=custom_fn)
      dense.build((None, 2))
      _, new_dense, _ = self.roundtrip(
          dense, custom_objects={"custom_fn": custom_fn}
      )
      x = ops.random.normal((2, 2))
      y1 = dense(x)
      _ = new_dense(x)
      new_dense.set_weights(dense.get_weights())
      y2 = new_dense(x)
      self.assertAllClose(y1, y2, atol=1e-5)
  
imports: import json
  import numpy
  import pytest
  import keras
  from keras import ops
  from keras import testing
  from keras.saving import serialization_lib
label_desc: Use image node_id 5 for calling the SerializationLibTest obj's underlying member method code with example usage: obj.test_custom_fn() without return types