code: def log_lr_and_step():
      try:
          # In optimizers, if learning_rate is set as constant, lr_var
          # name is 'learning_rate_0', and iteration counter is not
          # recorded. If learning_rate is set as decayed values from
          # learning_rate_scheduler, lr_var name is 'learning_rate',
          # and iteration counter is recorded with name '@LR_DECAY_COUNTER@',
          # better impliment is required here
          lr_var = fluid.global_scope().find_var("learning_rate")
          if not lr_var:
              lr_var = fluid.global_scope().find_var("learning_rate_0")
          lr = np.array(lr_var.get_tensor())
  
          lr_count = "[-]"
          lr_count_var = fluid.global_scope().find_var(
              "@LR_DECAY_COUNTER@"
          )
          if lr_count_var:
              lr_count = np.array(lr_count_var.get_tensor())
          logger.info(
              "------- learning rate {}, learning rate counter {} -----".format(
                  np.array(lr), np.array(lr_count)
              )
          )
      except:
          logger.warn(
              "Unable to get learning_rate and LR_DECAY_COUNTER."
          )
  
file_path: PaddleHub/modules/video/classification/videotag_tsn_lstm/resource/utils/train_utils.py
imports: import os
  import sys
  import logging
  import time
  import numpy
  import paddle.fluid
  from paddle.fluid import profiler
label_desc: Use image node_id 1 for calling a global function with example usage: log_lr_and_step() without return types