You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import os
os.environ['NUMBA_DISABLE_JIT'] = '1'
import numba
import numpy as np
from numba import njit
from numba.core import types
from numba.experimental import structref
@structref.register
class ValueType(types.StructRef):
def preprocess_fields(self, fields):
return tuple((name, types.unliteral(typ)) for name, typ in fields)
class Value(structref.StructRefProxy):
def __new__(cls, val):
return structref.StructRefProxy.__new__(cls, val)
@property
def val(self):
return Value_get_val(self)
@njit
def Value_get_val(self):
return self.val
structref.define_proxy(Value, ValueType, ["val"])
@njit
def div_by_zero(node):
return node.val / 0
node1 = Value(54321)
div_by_zero(node1)
---------------------------------------------------------------------------
RecursionError Traceback (most recent call last)
structref_mini_test.py in
35 return node.val / 0
36
---> 37 node1 = Value(54321)
38
39 div_by_zero(node1)
structref_mini_test.py in __new__(cls, val)
18 class Value(structref.StructRefProxy):
19 def __new__(cls, val):
---> 20 return structref.StructRefProxy.__new__(cls, val)
21
22 @property
~/anaconda3/envs/py38/lib/python3.8/site-packages/numba/experimental/structref.py in __new__(cls, *args)
374 # cache it to attribute to avoid recompilation
375 cls.__numba_ctor = ctor
--> 376 return ctor(*args)
377
378 @property
~/anaconda3/envs/py38/lib/python3.8/site-packages/numba/experimental/structref.py in ctor(*args)
371 @njit
372 def ctor(*args):
--> 373 return cls(*args)
374 # cache it to attribute to avoid recompilation
375 cls.__numba_ctor = ctor
... last 3 frames repeated, from the frame below ...
structref_mini_test.py in __new__(cls, val)
18 class Value(structref.StructRefProxy):
19 def __new__(cls, val):
---> 20 return structref.StructRefProxy.__new__(cls, val)
21
22 @property
RecursionError: maximum recursion depth exceeded
The text was updated successfully, but these errors were encountered:
bairdlampard534
changed the title
NUMBA_DISABLE_JIT leads infinite loop for Structref instance creation.
NUMBA_DISABLE_JIT causes an infinite loop in Structref instance creation.
Jun 14, 2021
The text was updated successfully, but these errors were encountered: