Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 908447b

Browse files
committed
Change tags and typings
1 parent 07c4206 commit 908447b

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

‎arrayfire/array_api/array_object.py‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
from dataclasses import dataclass
77
from typing import Any
88

9-
from arrayfire import backend, safe_call # TODO refactor
10-
from arrayfire.algorithm import count # TODO refactor
11-
from arrayfire.array import _get_indices, _in_display_dims_limit # TODO refactor
9+
# TODO replace imports from original lib with refactored ones
10+
from arrayfire import backend, safe_call
11+
from arrayfire.algorithm import count
12+
from arrayfire.array import _get_indices, _in_display_dims_limit
1213

1314
from .device import PointerSource
1415
from .dtypes import CShape, Dtype
@@ -630,35 +631,35 @@ def __iadd__(self, other: int | float | Array, /) -> Array:
630631
"""
631632
return _process_c_function(self, other, backend.get().af_add)
632633

633-
def __isub__(self, other: int | float | bool|complex|Array, /) -> Array:
634+
def __isub__(self, other: int | float | Array, /) -> Array:
634635
"""
635636
Return self -= other.
636637
"""
637638
return _process_c_function(self, other, backend.get().af_sub)
638639

639-
def __imul__(self, other: int | float | bool|complex|Array, /) -> Array:
640+
def __imul__(self, other: int | float | Array, /) -> Array:
640641
"""
641642
Return self *= other.
642643
"""
643644
return _process_c_function(self, other, backend.get().af_mul)
644645

645-
def __itruediv__(self, other: int | float | bool|complex|Array, /) -> Array:
646+
def __itruediv__(self, other: int | float | Array, /) -> Array:
646647
"""
647648
Return self /= other.
648649
"""
649650
return _process_c_function(self, other, backend.get().af_div)
650651

651-
def __ifloordiv__(self, other: int | float | bool|complex|Array, /) -> Array:
652+
def __ifloordiv__(self, other: int | float | Array, /) -> Array:
652653
# TODO
653654
return NotImplemented
654655

655-
def __imod__(self, other: int | float | bool|complex|Array, /) -> Array:
656+
def __imod__(self, other: int | float | Array, /) -> Array:
656657
"""
657658
Return self %= other.
658659
"""
659660
return _process_c_function(self, other, backend.get().af_mod)
660661

661-
def __ipow__(self, other: int | float | bool|complex|Array, /) -> Array:
662+
def __ipow__(self, other: int | float | Array, /) -> Array:
662663
"""
663664
Return self **= other.
664665
"""
@@ -1078,10 +1079,12 @@ def _constant_array(value: int | float | bool | complex, shape: CShape, dtype: D
10781079
elif dtype == af_int64:
10791080
# TODO discuss workaround for passing float to ctypes
10801081
safe_call(backend.get().af_constant_long(
1081-
ctypes.pointer(out.arr), ctypes.c_longlong(value.real), 4, ctypes.pointer(shape.c_array)))
1082+
ctypes.pointer(out.arr), ctypes.c_longlong(value.real), # type: ignore[arg-type]
1083+
4, ctypes.pointer(shape.c_array)))
10821084
elif dtype == af_uint64:
10831085
safe_call(backend.get().af_constant_ulong(
1084-
ctypes.pointer(out.arr), ctypes.c_ulonglong(value.real), 4, ctypes.pointer(shape.c_array)))
1086+
ctypes.pointer(out.arr), ctypes.c_ulonglong(value.real), # type: ignore[arg-type]
1087+
4, ctypes.pointer(shape.c_array)))
10851088
else:
10861089
safe_call(backend.get().af_constant(
10871090
ctypes.pointer(out.arr), ctypes.c_double(value), 4, ctypes.pointer(shape.c_array), dtype.c_api_value))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /