 
     auto& dev_ctx = ctx.template device_context<DeviceContext>();
 
+    // get batch id by lod in CPU
     Tensor roi_batch_id_list;
     roi_batch_id_list.Resize({roi_num});
     int* roi_batch_id_data =

    for (int i = 0; i < num_level; ++i) {
      Tensor sub_lod = sub_lod_list.Slice(i, i + 1);
      int* sub_lod_data = sub_lod.data<int>();
      transform_lod(sub_lod_data, lod_size + 1, offset_lod_data);
      int sub_rois_num = offset_lod_data[lod_size];
      Tensor sub_idx = index_out_t.Slice(0, sub_rois_num);


                  kNumMaxinumNumBlocks);
}

static inline void TransLoD(const int* length_lod, const int lod_size,
                            int* offset_lod) {
  int offset = 0;
  for (int i = 0; i < lod_size; ++i) {
    offset_lod[i] = offset;
