Skip to content

Conversation

@Echo-Nie
Copy link
Contributor

@Echo-Nie Echo-Nie commented Sep 13, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

报错Info

由于内容太多,就不放在PR中了,链接:test_normal_info

Error主要三类

  1. AttributeError: 'Tensor' object has no attribute 'desc'

    • Test Case: TestNormalAPI
    • 静态图 Variable 被动态图 Tensor 替代,exe.run(fetch_list=[out]) 拿到的不是静态图 Variable
  2. AssertionError: data() is only supported in static graph mode

    • Test Cases:
      1. TestNormalAPI_mean_is_tensor
      2. TestNormalAPI_std_is_tensor
      3. TestNormalAPI_mean_std_are_tensor
      4. TestNormalAPI_mean_std_are_tensor_with_different_dtype
      5. TestNormalAPIComplex 系列
    • paddle.static.data() 在动态图模式下调用
  3. Mismatch

    • Test Cases: TestNormalAPIComplex* 系列
    • complex 类型输入,静态图 feed 时 dtype 或 shape 不匹配

修改

报错 类型 原因分析 解决
TestNormalAPI AttributeError 静态图 Variable 被动态图 Tensor 替代,exe.run(fetch_list=[out]) 拿到的不是静态图 Variable static_api() 开头调用 paddle.enable_static(),结束调用 paddle.disable_static(),保证 out 是静态图 Variable
TestNormalAPI_mean_is_tensor AssertionError paddle.static.data() 在动态图模式下调用 static_api 中启用静态图:paddle.enable_static(),包裹 paddle.static.data()
TestNormalAPI_std_is_tensor AssertionError 同上 同上
TestNormalAPI_mean_std_are_tensor AssertionError 同上 同上
TestNormalAPI_mean_std_are_tensor_with_different_dtype AssertionError 同上 同上
TestNormalAPIComplex AssertionError + mismatch complex case 下 dtype 不统一 统一 mean dtype 为 "complex128";feed 时使用 np.broadcast_to(self.mean, self.std.shape)
TestNormalAPIComplex_mean_is_tensor AssertionError + mismatch 同上 同上
TestNormalAPIComplex_std_is_tensor AssertionError + mismatch 同上 同上
TestNormalAPIComplex_mean_std_are_tensor AssertionError + mismatch 同上 同上
TestNormalAPIComplex_mean_std_are_tensor_with_different_dtype AssertionError + mismatch 同上 同上

结果

...
----------------------------------------------------------------------
Ran 13 tests in 28.379s

OK

@luotao1 @YqGe585

@paddle-bot
Copy link

paddle-bot bot commented Sep 13, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Sep 13, 2025
Copy link
Member

@YqGe585 YqGe585 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 15, 2025
@luotao1 luotao1 self-assigned this Sep 15, 2025
@YqGe585 YqGe585 self-requested a review September 15, 2025 11:07
@luotao1
Copy link
Contributor

luotao1 commented Sep 19, 2025

@Echo-Nie 需要处理下CI

@Echo-Nie
Copy link
Contributor Author

Echo-Nie commented Sep 19, 2025

@Echo-Nie 需要处理下CI

Done

@luotao1 luotao1 merged commit 834096b into PaddlePaddle:develop Sep 22, 2025
66 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants