File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 17
17
18
18
import pytest
19
19
20
+ import dpctl
20
21
import dpctl .tensor as dpt
21
22
22
23
list_dtypes = [
@@ -127,3 +128,31 @@ def test_isdtype_kind_tuple_dtypes(dtype_str):
127
128
def test_isdtype_invalid_kind (kind ):
128
129
with pytest .raises ((TypeError , ValueError )):
129
130
dpt .isdtype (dpt .int32 , kind )
131
+
132
+
133
+ def test_finfo_array ():
134
+ try :
135
+ x = dpt .empty (tuple (), dtype = "f4" )
136
+ except dpctl .SyclDeviceCreationError :
137
+ pytest .skip ("Default-selected SYCL device unavailable" )
138
+ o = dpt .finfo (x )
139
+ assert o .dtype == dpt .float32
140
+
141
+
142
+ def test_iinfo_array ():
143
+ try :
144
+ x = dpt .empty (tuple (), dtype = "i4" )
145
+ except dpctl .SyclDeviceCreationError :
146
+ pytest .skip ("Default-selected SYCL device unavailable" )
147
+ o = dpt .iinfo (x )
148
+ assert o .dtype == dpt .int32
149
+
150
+
151
+ def test_iinfo_validation ():
152
+ with pytest .raises (ValueError ):
153
+ dpt .iinfo ("O" )
154
+
155
+
156
+ def test_finfo_validation ():
157
+ with pytest .raises (ValueError ):
158
+ dpt .iinfo ("O" )
You can’t perform that action at this time.
0 commit comments