code: def test_sync_weights_with_decay(self):
      pred_program = fluid.Program()
      with fluid.program_guard(pred_program):
          obs = layers.data(name="obs", shape=[4], dtype="float32")
          model_output = self.model.predict(obs)
          target_model_output = self.target_model.predict(obs)
  
      self.executor.run(fluid.default_startup_program())
  
      decay = 0.9
      # update in numpy way
      (
          target_model_fc1_w,
          target_model_fc1_b,
          target_model_fc2_w,
          target_model_fc2_b,
          target_model_fc3_w,
          target_model_fc3_b,
      ) = self._numpy_update(self.target_model, decay)
  
      self.model.sync_weights_to(self.target_model, decay=decay)
  
      N = 10
      random_obs = np.random.random(size=(N, 4)).astype("float32")
      for i in range(N):
          x = np.expand_dims(random_obs[i], axis=0)
          real_target_outputs = self.executor.run(
              pred_program,
              feed={"obs": x},
              fetch_list=[target_model_output],
          )[0]
  
          # Ideal target output
          out_np = np.dot(x, target_model_fc1_w) + target_model_fc1_b
          out_np = (
              np.dot(out_np, target_model_fc2_w) + target_model_fc2_b
          )
          out_np = (
              np.dot(out_np, target_model_fc3_w) + target_model_fc3_b
          )
  
          self.assertLess(
              float(np.abs(real_target_outputs - out_np)), 1e-5
          )
  
imports: import numpy
  import paddle.fluid
  import parl
  import unittest
  from copy import deepcopy
  from paddle.fluid import ParamAttr
  from parl import layers
  from parl.utils import get_gpu_count
  from parl.core.fluid.plutils import fetch_value
label_desc: Use image node_id 9 for calling the ModelBaseTest obj's underlying member method code with example usage: obj.test_sync_weights_with_decay() without return types