File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def __init__(
102
102
if str (dtype ) == "floatX" :
103
103
self .dtype = config .floatX
104
104
else :
105
- if np .obj2sctype (dtype ) is None :
105
+ if np .dtype (dtype ). type is None :
106
106
raise TypeError (f"Invalid dtype: { dtype } " )
107
107
108
108
self .dtype = np .dtype (dtype ).name
@@ -785,8 +785,7 @@ def tensor(
785
785
if name is not None :
786
786
# Help catching errors with the new tensor API
787
787
# Many single letter strings are valid sctypes
788
- if str (name ) == "floatX" or (len (str (name )) > 1 and np .obj2sctype (name )):
789
- np .obj2sctype (name )
788
+ if str (name ) == "floatX" or (len (str (name )) > 1 and np .dtype (name ).type ):
790
789
raise ValueError (
791
790
f"The first and only positional argument of tensor is now `name`. Got { name } .\n "
792
791
"This name looks like a dtype, which you should pass as a keyword argument only."
You can’t perform that action at this time.
0 commit comments