Thanks for the comments.
The pytorch code is:
" unlabel_loader1 = DataLoader(self.unlabeled, batch_size = self.args.batch_size, shuffle=True, drop_last=True, num_workers = 4)
unlabel_loader2 = DataLoader(self.unlabeled, batch_size = self.args.batch_size, shuffle=True, drop_last=True, num_workers = 4).iter()
label_loader = DataLoader(tile_labeled, batch_size = self.args.batch_size, shuffle=True, drop_last=True, num_workers = 4).iter()
        batch_num = 0
        for (unlabel1, _label1) in unlabel_loader1:
            batch_num += 1
            unlabel2, _label2 = unlabel_loader2.next()
            x, y = label_loader.next() "

I write it this way in C++:
int batch_num = 0;
auto udata_loader = unlabel_loader1->begin();
auto udata_loader2= unlabel_loader2->begin();
auto ldata_loader = label_loader->begin();
for (int idx = 0; idx < args.iter; idx++)
{
std::cout << “process in the iter loop” << std::endl;
batch_num = batch_num + 1;
            if (udata_loader == unlabel_loader1->end())
                udata_loader = unlabel_loader1->begin();
            torch::Tensor unlabel1 = udata_loader->data;

            ++udata_loader;
            if (udata_loader2 == unlabel_loader2->end())
                udata_loader2 = unlabel_loader2->begin();
            torch::Tensor unlabel2 = udata_loader2->data;

            ++udata_loader2;
            if (ldata_loader == label_loader->end())
                ldata_loader = label_loader->begin();
            torch::Tensor x = ldata_loader->data;
            torch::Tensor y = ldata_loader->target;

            ++ldata_loader;

May I ask if this translation is accurate please ? Thanks.