I’m not sure how your loss function work (maybe you can split 4 objects into 4 items or something), I just manually combine the data into a batch when I do it (basically your own collate_fn  function)
maybe somebody can answer that, I’ve never done dataparallel so I don’t know