Not sure if this should be a Numpy question but it relates to Numba tangentially. I am passing an array into my kernel that is comprised of 1D arrays of data that are flattened 3D arrays that represent boxes. The problem is that the boxes are not all the same size. To create the array and send it to the kernel I am doing something along the lines of this.
(self.imported_object_info_dict is a dictionary of info on each box object, like its dimensions)
imported_object_gpu_objects = []
for object_key in self.imported_object_info_dict.keys():
imported_object_gpu_objects.append(self.imported_object_info_dict[object_key]['cpuobject'])
When I want to turn this list of arrays into an array I just do this
np.array(imported_object_gpu_objects, dtype=np.float32)
and send that numpy array to the kernel.
If all the objects in the imported_object_gpu_objects list are of the same dimension it works perfectly. Unfortunately, very rarely are all the objects going to be the same size and if they aren't I get this error "ValueError: setting an array element with a sequence". From what I've seen online people recommend doing stuff like setting the dtype = object. Will this work with Numba? Are there other ways to pass in jagged arrays or is there another package other than numpy that can create arrays that I can pass to Numba that are jagged?