Skip to content

Commit a947b3a

Browse files
Fixing typos discovered by added tests
1 parent 70615d1 commit a947b3a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dpctl/tensor/_elementwise_common.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,21 @@ def _weak_type_num_kind(o):
191191
return _map["i"]
192192
if isinstance(o, WeakInexactType):
193193
return _map["f"]
194-
raise TypeError
194+
raise TypeError(
195+
f"Unexpected type {o} while expecting "
196+
"`WeakBooleanType`, `WeakIntegralType`, or "
197+
"`WeakInexactType`."
198+
)
195199

196200

197201
def _strong_dtype_num_kind(o):
198-
_map = {"?": 0, "i": 1, "u": 1, "f": 2, "c": 2}
202+
_map = {"b": 0, "i": 1, "u": 1, "f": 2, "c": 2}
199203
if not isinstance(o, dpt.dtype):
200204
raise TypeError
201205
k = o.kind
202206
if k in _map:
203207
return _map[k]
204-
raise ValueError
208+
raise ValueError(f"Unrecognized kind {k} for dtype {o}")
205209

206210

207211
def _resolve_weak_types(o1_dtype, o2_dtype, dev):

0 commit comments

Comments
 (0)