Skip to content

Commit b2cd5c1

Browse files
committed
Add support for lowercase order in tensor.copy and tensor.astype
1 parent 1993eae commit b2cd5c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpctl/tensor/_copy_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ def copy(usm_ary, order="K"):
517517
- "K": match the layout of `usm_ary` as closely as possible.
518518
519519
"""
520+
order = order.upper()
520521
if not isinstance(usm_ary, dpt.usm_ndarray):
521522
return TypeError(
522523
f"Expected object of type dpt.usm_ndarray, got {type(usm_ary)}"
@@ -581,6 +582,7 @@ def astype(usm_ary, newdtype, order="K", casting="unsafe", copy=True):
581582
582583
A view can be returned, if possible, when `copy=False` is used.
583584
"""
585+
order = order.upper()
584586
if not isinstance(usm_ary, dpt.usm_ndarray):
585587
return TypeError(
586588
f"Expected object of type dpt.usm_ndarray, got {type(usm_ary)}"

0 commit comments

Comments
 (0)