code: def _check_lr_tf(policy, policy_id):
      lr = policy.cur_lr
      sess = policy.get_session()
      if sess:
          lr = sess.run(lr)
          optim_lr = sess.run(policy._optimizer._lr)
      else:
          lr = lr.numpy()
          optim_lr = policy._optimizer.lr.numpy()
      assert lr == optim_lr, "LR scheduling error!"
  
imports: import unittest
  import numpy
  import ray
  from ray.rllib.algorithms.callbacks import DefaultCallbacks
  import ray.rllib.algorithms.ppo
  from ray.rllib.algorithms.ppo.ppo_tf_policy import PPOTF2Policy
  from ray.rllib.algorithms.ppo.ppo_torch_policy import PPOTorchPolicy
  from ray.rllib.evaluation.postprocessing import compute_gae_for_sample_batch, Postprocessing
  from ray.rllib.models.tf.tf_action_dist import Categorical
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.models.torch.torch_action_dist import TorchCategorical
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID, SampleBatch
  from ray.rllib.utils.metrics.learner_info import LEARNER_INFO, LEARNER_STATS_KEY
  from ray.rllib.utils.numpy import fc
  from ray.rllib.utils.test_utils import check, check_compute_single_action, check_off_policyness, check_train_results, framework_iterator, check_inference_w_connectors
label_desc: Use image node_id 2 for calling the MyCallbacks obj's underlying member method code with example usage: obj._check_lr_tf(policy, policy_id) without return types