code: def test_crf_decode_save_load(tmpdir):
      class DummyLoss(tf.keras.losses.Loss):
          def call(self, y_true, y_pred):
              return tf.zeros(shape=())
  
      tf.keras.backend.clear_session()
      input_tensor = tf.keras.Input(
          shape=(10, 3), dtype=tf.float32, name="input_tensor"
      )
      seq_len = tf.keras.Input(shape=(), dtype=tf.int32, name="seq_len")
      transition = tf.constant(
          [[1, 1, 0], [0, 1, 1], [1, 0, 1]], dtype=tf.float32
      )
  
      output = tf.multiply(input_tensor, tf.constant(1.0))
      decoded, _ = CRFDecode()(input_tensor, transition, seq_len)
  
      model = tf.keras.Model(
          inputs=[input_tensor, seq_len],
          outputs=[output, decoded],
          name="example_model",
      )
      model.compile(optimizer="Adam", loss=DummyLoss())
  
      x_data = {
          "input_tensor": np.random.random_sample((5, 10, 3)).astype(
              dtype=np.float32
          ),
          "seq_len": np.array([10] * 5, dtype=np.int32),
      }
  
      tensor_name = (
          "tf.math.multiply"
          if Version(tf.__version__) >= Version("2.5.0")
          else "tf_op_layer_Mul"
      )
      y_data = {tensor_name: np.random.randint(0, 3, (5, 10))}
  
      model.fit(x_data, y_data)
      model.predict(
          {
              "input_tensor": tf.expand_dims(
                  x_data["input_tensor"][0], 0
              ),
              "seq_len": np.array([10]),
          }
      )
  
      temp_dir = str(tmpdir.mkdir("model"))
      model.save(temp_dir)
  
      tf.keras.backend.clear_session()
      model = tf.keras.models.load_model(
          temp_dir,
          custom_objects={
              "CrfDecodeForwardRnnCell": text.crf.CrfDecodeForwardRnnCell,
              "DummyLoss": DummyLoss,
          },
      )
      model.fit(x_data, y_data)
      model.predict(
          {
              "input_tensor": tf.expand_dims(
                  x_data["input_tensor"][0], 0
              ),
              "seq_len": np.array([10]),
          }
      )
  
imports: import itertools
  from packaging.version import Version
  import pytest
  import numpy
  import tensorflow
  from tensorflow_addons import text
  from tensorflow_addons.utils import test_utils
  from numpy.testing import assert_array_equal
label_desc: Use image node_id 17 for calling a global function with example usage: test_crf_decode_save_load(tmpdir) and returns: tf