As a first shot, I think it’s a problem that boxes is an instance of collections.Mapping and thus default_collate will be called recursively.
Have a look at this line of code 68.
Could you wrap boxes in a list and try it again?