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__(
102102 if str (dtype ) == "floatX" :
103103 self .dtype = config .floatX
104104 else :
105- if np .obj2sctype (dtype ) is None :
105+ if np .dtype (dtype ). type is None :
106106 raise TypeError (f"Invalid dtype: { dtype } " )
107107
108108 self .dtype = np .dtype (dtype ).name
@@ -785,8 +785,7 @@ def tensor(
785785 if name is not None :
786786 # Help catching errors with the new tensor API
787787 # 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 ):
790789 raise ValueError (
791790 f"The first and only positional argument of tensor is now `name`. Got { name } .\n "
792791 "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