The coalescing might be getting confused by the ordering of the dimensions. Can you temporarily permute() the batch dimension to the first dimension and then permute() again as necessary for the desired data layout?