Is it possible save some custom value into dataloader and load them with the relative data later?

I tried to calculate the ‘weight’ of data

for example, how to save the current loss and read it in the next epoch?:

import os
from mxnet import nd
from import ImageRecordIter

rec_path = os.path.expanduser('~/.mxnet/datasets/imagenet/rec/')
train_data = ImageRecordIter(
    path_imgrec = os.path.join(rec_path, 'train.rec'),
    path_imgidx = os.path.join(rec_path, 'train.idx'),
    data_shape  = (3, 224, 224),
    batch_size  = 32,
    shuffle     = True
#how to initialize ImageRecordIter such that it will generate 3 rather than 2 element: data,label,custom_data
while training:
  for data,label,custom_data in ImageRecordIter:
    with ag.record():
    #how to save custom_data?
    #e.g., if I want save current loss and read it in the next iteration