File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -196,10 +196,13 @@ def elements(self):
196
196
safe_call (clib .af_get_elements (ct .pointer (num ), self .arr ))
197
197
return num .value
198
198
199
- def type (self ):
199
+ def dtype (self ):
200
200
dty = ct .c_int (f32 .value )
201
201
safe_call (clib .af_get_type (ct .pointer (dty ), self .arr ))
202
- return dty .value
202
+ return dty
203
+
204
+ def type (self ):
205
+ return self .dtype ().value
203
206
204
207
def dims (self ):
205
208
d0 = ct .c_longlong (0 )
Original file line number Diff line number Diff line change @@ -36,10 +36,19 @@ def number_dtype(a):
36
36
37
37
def implicit_dtype (number , a_dtype ):
38
38
n_dtype = number_dtype (number )
39
- if n_dtype == f64 and (a_dtype == f32 or a_dtype == c32 ):
39
+ n_value = n_dtype .value
40
+
41
+ f64v = f64 .value
42
+ f32v = f32 .value
43
+ c32v = c32 .value
44
+ c64v = c64 .value
45
+
46
+ if n_value == f64v and (a_dtype == f32v or a_dtype == c32v ):
40
47
return f32
41
- if n_dtype == c64 and (a_dtype == f32 or a_dtype == c32 ):
48
+
49
+ if n_value == c64v and (a_dtype == f32v or a_dtype == c32v ):
42
50
return c32
51
+
43
52
return n_dtype
44
53
45
54
def dim4_tuple (dims , default = 1 ):
You can’t perform that action at this time.
0 commit comments