Added automatic garbage collect during *_dataset methods at trainable.lua