• C
    Refactor and simplify hook design & add Tensor.register_hook API (#31775) · dbeb3ea4
    Chen Weihang 提交于
    * refactor and simplify hook design
    
    * fix reducer add hook error
    
    * add Tensor.register_hook basic impl
    
    * refine prepare data impl
    
    * revert prepare data change
    
    * support register_hook for Tensor
    
    * add hook test in model
    
    * polish tests and doc example
    
    * fix double grad test failed
    
    * remove reduce hook func
    
    * fix set empty error
    
    * polish code by comments
    
    * change reduce_hook to mutable_hook
    
    * remove useless tmp_ins
    
    * fix shape code format error
    
    * fix shape code format error
    dbeb3ea4
gradient_accumulator.cc 26.2 KB