Solved by Napam in post #2 
              
              
                unsqueeze(-1) adds a new dimension after the last index, so the shape of t_b transforms into: 
t_b.unsqueeze(-1).unsqueeze(-1)
 (3)  (3,1)        (3,1,1)      <- shapes

For comparison, if we wanted to add the new dimensions in “front” we would do: 
t_b.unsqueeze(0).unsqueeze(0)
 (3)  (1,3)        (…