Allow non-Tensor values in a batch with `dispatch_batches=True` (#3850)
* Allow non-Tensor values in a batch with dispatch_batches=True
* Add a test case that previously failed with a TypeError
* Allow non-tensor samples in batches in single-process settings; add tests