It is not a bug.
In python, (2) is considered as single element scalar, where as (2,) is considered as a tuple with one element (pl. note the comma inside brackets).
To get your expected output,
lab_ = torch.tensor((2,))

will print
torch.Size([1])