We are encountering an issue when using a NVIDIA.DALI C++ custom operator in our image processing pipeline

We have defined a function to process image data and plan to use DALI to accelerate and organize the pipeline. The code works well when we process a single image. However, when we process multiple images, the code returns the following error:

List item

RuntimeError: Critical error in pipeline:
Error in GPU operator `nvidia.dali.fn.scan`,
which was used in the pipeline definition with the following traceback:  File "/home/laityh/LaityHCode/dali_project/./dummy.py", line 38, in extract_pipe
    d_mean, d_sigma, backmean, backsig, numValidObj, numValidPix, images, obj_double, obj_float = fn.scan(encountered:std::bad_alloc
Current pipeline object is no longer valid.

Could you please provide me some help on this problem?