1

I am trying to use heapq inside a function of jitclass , the following is my code:

spec = [('sese', types.ListType(types.ListType(types.int32)))]
@jitclass(spec)
class CK ():
    def __init__(self):
        self.sese = [[0,0,0,0]]
    
    def main_ (self):
        heapq.heapify (self.sese)

and it returns error:

Cannot cast list(list(int64)<iv=None>)<iv=None> to ListType[ListType[int32]]:

Would someone be able to guide to the correct way of the implementation of using the heapq in jitclass?

Very kind regards

Axd
  • 45
  • 2
  • 1
    It looks like the problem is happening in a low-level part of the Numba implementation (so it is generally a bug, an unexpected feature to support or a feature partially implemented so far). There is no problem without JITclasses. Please note that JITclasses are experimental so far and such problem can happen because of that. Consider filling a bug on the Numba GitHub. – Jérôme Richard Jun 30 '22 at 23:05
  • Thanks for the response, in order to get away from it, I have to have the function outside of the class, but now having another issue of memory leak. please have a look https://stackoverflow.com/questions/72823675/numba-jit-mode-memory-leak-issue – Axd Jul 01 '22 at 01:59

0 Answers0