I dont know how to implement above code in a DataLoader class but You dont have to implemnt it in that class.
You can separate channels after you get a batch from the DataLoader . Something like doing calculations on the fly.