• Qianli Scott Zhu's avatar
    Add session hook for benchmark metric logging. (#3672) · 4b85dab1
    Qianli Scott Zhu authored
    * Add session hook for benchmark metric logging.
    
    Current hook is very similar as the LoggingTensorHook. Some of the
    function are directly copied since the original one was not
    exposed for import. We should seek to eventually move this code to
    core when it is mature enough.
    
    * Update metric_hook to use LoggingTensorHook as base.
    
    The existing hook is similar enough to LoggingTensorHook, and
    we should eliminate duplicate as much as possible.
    
    * Address review comment.
    
    1. Update global step tensor handle.
    2. Update tests.
    3. Update document.
    
    * Update tests for py3.
    
    * Fix lint error
    4b85dab1
metric_hook.py 4.24 KB