已关闭
[Bug-Report|缺陷反馈]: TensorFlow Mean output shape loses dimensions after a zero-sized dimension #594
KaranocaVe创建于 28 天前关闭于 14 天前
28 天前 修改了issue 的描述
28 天前 关联了pull request:fix: preserve empty dimensions in TensorFlow Mean output shapes
28 天前 修改了issue 的描述
28 天前 修改了issue 的描述
28 天前 修改了issue 的描述
28 天前 修改了issue 的描述
28 天前 修改了issue 的描述
ClarkXie
28 天前 评论:
28 天前 评论:
感谢您的反馈,我们会尽快检视并合入您的修复!


28 天前 修改了issue 的描述
ClarkXie
14 天前 评论:
14 天前 评论:
代码已完成检视并发出,预计今晚合入develop


14 天前 issue状态由 进行中 改变为 已完成
14 天前 关闭了 issue
KaranocaVe
4 天前 评论:
4 天前 评论:
@ClarkXie 您好,这个 Issue 对应的修复已经合入:https://gitcode.com/cann/ge/merge_requests/5216
开发者计划反馈,Issue 需要有 Accepted 标签才能计入积分,仅关闭或标记 resolved 还不够。目前这条 Issue 尚未标记 Accepted,麻烦您结合问题和已合入的修复复核一下;确认符合受理条件后,帮忙补上 Accepted 标签。
感谢您的支持!


[Bug-Report|缺陷反馈]: TensorFlow Mean output shape loses dimensions after a zero-sized dimension
Problem
TensorFlow
Meanoutput descriptor translation drops dimensions after a zero-sized dimension. For a serialized output shape[0, 3],TensorFlowUtil::TransTensorDescriptorreturns[0]. A normal[2, 3]shape is preserved.The corruption is caused by a special case for
Meanthat replaces the descriptor shape with a one-dimensional shape when it encounters any zero dimension, then stops scanning dimensions. The source comment says theMeanandFusedBatchNormGradworkarounds address inaccurate TensorFlow inference for ResNet50; this case does not verify a full ResNet50 model.Reproduction
The parser unit test
UtestTensorflowParser.tensorflow_MeanPreservesEmptyOutputShape_testpasses serialized TensorFlow output descriptors for[0, 3]and[2, 3]throughTransTensorDescriptorand compares the resulting dimensions.At source commit
abaf3791a9ed60b5f871baf5eaade7b58fbbecd9, the empty-shape case fails with actual dimensions[0]; the ordinary shape control passes. After removing theMeanrewrite, both cases pass.Fix
Remove the
Meanzero-dimension shape rewrite. Keep theFusedBatchNormGradadjustment unchanged. The change updates descriptor translation, adds a parser regression test, and documents the serialized-shape behavior.Validation
The parser regression test reproduces the shape collapse before the change and passes after it. The
[0, 3]empty shape and[2, 3]control are both preserved. Theut_parsertarget builds successfully. The target repository's applicablepre-commithooks,clang-format, andgit diff --checkpass.These test and build results were recorded against the original source commit and have not been rerun locally against the current
developbase. GitCode Actions reportsci-pipeline-passedfor the current head of PR !5216. The historical ResNet50 workaround was not validated with a full model, so compatibility with that scenario remains unverified.关联 PR: https://gitcode.com/cann/ge/merge_requests/5216