I am having trouble initialising a jitclass with a singular instance of numpy dtype. The following is the code where I am getting the error.
import numpy as np
from numba import jitclass, typeof
counter_dtype = np.dtype([('element', np.int32, 5)])
one_counter = np.zeros(1, dtype=counter_dtype)[0]
spec = [
("counter", typeof(one_counter))
]
@jitclass(spec)
class UpdatingStuff:
def __init__(self, counter):
self.counter = counter
UpdatingStuff(one_counter)