[eager][utils] fix GRAD_SLOT_META_TEMPLATE
fmt error
#63345
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
User Experience
PR Types
Bug fixes
Description
修复
GLOG_v>=6
下格式化输出的错误在 log_v 6 下
const char* GRAD_SLOT_META_TEMPLATE = " {SlotSize: [%d]: %s} ";
需要传大小和内容,而修复前只传了内容修复后
I0409 14:24:41.228745 3900504768 eager_op_function.cc:28054] Running Eager Final State API: arange I0409 14:24:41.228746 3900504768 eager_op_function.cc:28056] args count: 2 I0409 14:24:41.228751 3900504768 dygraph_functions.cc:56816] Running AD API: arange I0409 14:24:41.228753 3900504768 dygraph_functions.cc:56840] No Type Promotion for arange_ad_func api. I0409 14:24:41.228755 3900504768 dygraph_functions.cc:56862] Running C++ API: arange I0409 14:24:41.228794 3900504768 dygraph_functions.cc:56879] { Input: [ ( start , [{Name: None, Initialized: 1, Ptr: 0x12f4864d8,TensorInfo: [ Type: DenseTensor, Dtype: int32, Place: Place(cpu), Shape: 1, DistAttr: Unknown ], ADInfo:[ Grad: [ {Name: None, Initialized: 0, Ptr: 0x0,TensorInfo: [ Unknown ], ADInfo:[ None ]} ], GradNode: [ BackwardOutMeta: [ {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]} ], BackwardInMeta: [ {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]} ] ], StopGradient: [ 1 ] ]}]), ( end , [{Name: None, Initialized: 1, Ptr: 0x12f4fcf68,TensorInfo: [ Type: DenseTensor, Dtype: int32, Place: Place(cpu), Shape: 1, DistAttr: Unknown ], ADInfo:[ Grad: [ {Name: None, Initialized: 0, Ptr: 0x0,TensorInfo: [ Unknown ], ADInfo:[ None ]} ], GradNode: [ BackwardOutMeta: [ {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]} ], BackwardInMeta: [ {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]} ] ], StopGradient: [ 1 ] ]}]), ( step , [{Name: None, Initialized: 1, Ptr: 0x12f4dca28,TensorInfo: [ Type: DenseTensor, Dtype: int32, Place: Place(cpu), Shape: 1, DistAttr: Unknown ], ADInfo:[ Grad: [ {Name: None, Initialized: 0, Ptr: 0x0,TensorInfo: [ Unknown ], ADInfo:[ None ]} ], GradNode: [ BackwardOutMeta: [ {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]} ], BackwardInMeta: [ {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]} ] ], StopGradient: [ 1 ] ]}]), ]}