Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jitclass doesn't use correct type for init arg #9576

Open
2 tasks done
matham opened this issue May 16, 2024 · 1 comment
Open
2 tasks done

jitclass doesn't use correct type for init arg #9576

matham opened this issue May 16, 2024 · 1 comment
Labels
bug - ice Bugs: internal compiler error

Comments

@matham
Copy link

matham commented May 16, 2024

Reporting a bug

The issue is easily demonstrated with this example code:

from numba.experimental import jitclass
from numba import uint64
import numpy as np

spec = [
    ('value', uint64),
]

@jitclass(spec)
class Data(object):
    def __init__(self, value: int):
        self.value = value

If I instantiate the data objects in this order the code works fine:

data = Data(np.iinfo(np.uint64).max)
data = Data(np.iinfo(np.uint32).max)

But, if I do this:

mybag = Data(np.iinfo(np.uint32).max)
mybag = Data(np.iinfo(np.uint64).max)

I get this error:

Traceback (most recent call last):
  File "D:\code\cellcount\cellcount\play3.py", line 15, in <module>
    mybag = Data(np.iinfo(np.uint64).max)
  File "D:\code\cellcount\lib\site-packages\numba\experimental\jitclass\base.py", line 124, in __call__
    return cls._ctor(*bind.args[1:], **bind.kwargs)
OverflowError: int too big to convert
@gmarkall
Copy link
Member

Thanks for the report - I can confirm that I can reproduce the issue locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - ice Bugs: internal compiler error
Projects
None yet
Development

No branches or pull requests

2 participants