Skip to content

Update validate#225

Merged
Xreki merged 9 commits intoPaddlePaddle:developfrom
hxzd5568:update_validate
Aug 20, 2025
Merged

Update validate#225
Xreki merged 9 commits intoPaddlePaddle:developfrom
hxzd5568:update_validate

Conversation

@hxzd5568
Copy link
Contributor

PR Category

Bug Fix

Description

修复validate test_compiler 问题

@paddle-bot
Copy link

paddle-bot bot commented Aug 20, 2025

Thanks for your contribution!

expected_out = expected_out.numpy()
compiled_out = compiled_out.numpy()
expected_out = [expected_out.numpy().astype("float32")]
compiled_out = [compiled_out.numpy().astype("float32")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

先cast到float32,再转numpy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

name = v["name"]
dtype = v["info"]["dtype"]
shape = v["info"]["shape"]
# print(f"-- i: {i}, v: name={name}, shape={shape}, dtype={dtype}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

debug信息帮忙删除一下吧


def convert_meta_classes_to_tensors(file_path):
for name, cls in _get_classes(file_path):
# print(f"-- name: {name}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

L116、L125的debug语句帮忙删除一下吧

unnamed = importlib.util.module_from_spec(spec)
spec.loader.exec_module(unnamed)
yield from inspect.getmembers(unnamed, inspect.isclass)
# yield from inspect.getmembers(unnamed, inspect.isclass)
Copy link
Collaborator

Choose a reason for hiding this comment

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

L165删除一下

elif dtype == paddle.int32 or dtype == paddle.int64:
return paddle.cast(
paddle.randint(low=min_value, high=max_value, shape=shape, dtype="int64"),
paddle.randint(low=0, high=1, shape=shape, dtype="int64"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

int数组,还是保留min和max设置吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

目前binary_cross_entropy等只能用0,1 , 如果使用最大值,会导致很多程序崩溃,已稍微放宽。

Copy link
Collaborator

@Xreki Xreki left a comment

Choose a reason for hiding this comment

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

LGTM

@Xreki Xreki merged commit 9fe10d6 into PaddlePaddle:develop Aug 20, 2025
3 checks passed
JewelRoam pushed a commit to JewelRoam/GraphNet that referenced this pull request Oct 29, 2025
* Update validate.py

* minor fix

* Fix test_compiler

* Fix test_compiler of paddle.

* fix inputs generation error and acc calculation error

* minor fix

* delete unused expr

* delete unused expr

---------

Co-authored-by: Liu Yiqun <liuyiqun01@baidu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants