Skip to content

Commit

Permalink
update dtype of numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
fangwei123456 committed Jun 2, 2023
1 parent b44d109 commit a5a51db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spikingjelly/activation_based/auto_cuda/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def check_ctypes(self, py_dict: dict):
``torch.half`` or ``np.float16`` ------ ``'const half2'`` or ``'half2'``
``np.int`` ------ ``'const int'`` or ``'int'``
``np.int_`` ------ ``'const int'`` or ``'int'``
If not, this function will raise an error.
"""
Expand All @@ -246,7 +246,7 @@ def check_ctypes(self, py_dict: dict):
elif value.dtype == np.float16:
assert startswiths(ctype, ('const half2', 'half2'))

elif value.dtype == np.int:
elif value.dtype == np.int_:
assert startswiths(ctype, ('const int', 'int'))

def check_half2(self, py_dict: dict):
Expand Down
2 changes: 1 addition & 1 deletion spikingjelly/datasets/cifar10_dvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def parse_raw_address(addr,
y_shift=y_shift,
polarity_mask=polarity_mask,
polarity_shift=polarity_shift):
polarity = read_bits(addr, polarity_mask, polarity_shift).astype(np.bool)
polarity = read_bits(addr, polarity_mask, polarity_shift).astype(np.bool_)
x = read_bits(addr, x_mask, x_shift)
y = read_bits(addr, y_mask, y_shift)
return x, y, polarity
Expand Down

0 comments on commit a5a51db

Please sign in to comment.