Add ConditionalBlockGradInferVarType for cond_op #39585
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 types
Bug fixes
PR changes
OPs
Describe
修复了Cond_Grad_op当Input包含LoDTensorArray类型,且Input@GRAD存在时,编译期组网报错的问题。由于之前缺失了ConditionalBlockGradInferVarType,在backward.py的append_backward_vars时会默认标记Input@GRAD的所有类型均为Tensor类型,即会错误地把LoDTensorArray类型Variable变成Tensor,导致下游Op.infer_var_type时报错。