I currently have a lot of code that looks like:
tensor[mask, :][..., i]
because apparently, I can’t mix masks and selection by dimensions.
tensor[mask, i] complains about dimensions not working out, but the mask has the shape of the tensor up to the last dimension.
Any better way to achieve what I want to do?