As @tom explained, there is not a single correct answer and it depends on what you are trying to achieve.
E.g. the second example would need a reduction (reduce the shape of 99 to 1), which can be accomplished using torch.mean, torch.sum, etc. or simply by indexing.
So the more interesting question is: what kind of operation should be used (or what are you trying yo achieve)?