Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix test_var_base.py when FLAGS_enable_pir_api=True #62686

Merged
merged 10 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions python/paddle/base/dygraph/tensor_patch_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,7 @@ def transform(t, device, dtype, blocking):
device = t.place
if dtype is None:
dtype = t.dtype
if type(dtype) is str:
dtype = framework.convert_np_dtype_to_dtype_(dtype)

dtype = framework.convert_to_proto_type(dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. 这里对于dtype的修改是不是应该放到if t.place.is_gpu_place():内,然后应该改为proto_dtype = framework.convert_to_proto_type(dtype)吧,因为dtype变量后面还会用到dtype != t_used.dtype,如果都变成proto dtype的话应该会有问题吧
  2. 另外需要改动下test/ir/pir/cinn/symbolic/test_llama_unsqueeze_expand.py的40h,把bool改成string

Copy link
Member Author

Choose a reason for hiding this comment

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

好的,已修改

# 1. gpu place need to determine whether the memory is sufficient for allocation.
if t.place.is_gpu_place():
size_dtype = core.size_of_dtype(dtype)
Expand Down
Loading