Skip to content

Commit 6da909f

Browse files
committed
fix the bug in new construct
1 parent 98859bb commit 6da909f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/paddle/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def new_init(self, *args, **kwargs):
103103
try:
104104
original_init(self, *args, **kwargs)
105105
except Exception as e:
106+
kwargs_cnt = len(kwargs) - int("dtype" in kwargs)
107+
if kwargs_cnt:
108+
raise ValueError(e)
106109
default_dtype = kwargs.get("dtype", "float32")
107110
if len(args) == 0:
108111
original_init(

0 commit comments

Comments
 (0)