Memory leak solved, in batch fmeasure loss function