Separating batching examples from the implementation code