OK, I understand your problem now. I don’t see a solution to your problem… There is a Python module called akward 1 that is better able to deal with non-rectangular data than NumPy, but I’d say in your case, since you need to calculate f(x), where f is a NN, you cannot use this module here.
Therefore, I’d go with the sequential approach, even if that has a lower utilization of the GPU as a consequence. I’d only switch to the padding option if that’s faster (you can just time both approaches).