code: def test_checkpoint_serialization(tmpdir):
      optimizer = RectifiedAdam()
      optimizer2 = RectifiedAdam()
  
      var_0 = tf.Variable([1.0, 2.0], dtype=tf.dtypes.float32)
      var_1 = tf.Variable([3.0, 4.0], dtype=tf.dtypes.float32)
  
      grad_0 = tf.constant([0.1, 0.2], dtype=tf.dtypes.float32)
      grad_1 = tf.constant([0.03, 0.04], dtype=tf.dtypes.float32)
  
      grads_and_vars = list(zip([grad_0, grad_1], [var_0, var_1]))
  
      optimizer.apply_gradients(grads_and_vars)
  
      checkpoint = tf.train.Checkpoint(optimizer=optimizer)
      checkpoint2 = tf.train.Checkpoint(optimizer=optimizer2)
      model_path = str(tmpdir / "rectified_adam_chkpt")
      checkpoint.write(model_path)
      checkpoint2.read(model_path)
  
      optimizer2.apply_gradients(grads_and_vars)
  
imports: import numpy
  import pytest
  from packaging.version import Version
  import tensorflow
  from tensorflow_addons.optimizers import RectifiedAdam, Lookahead
label_desc: Use image node_id 17 for calling a global function with example usage: test_checkpoint_serialization(tmpdir) without return types