You can’t concatenate them in that way.
See tensor ‘A’ contains H numbers N times, tensor ‘B’ only T numbers. How do you want to concatenate first numbers with others?
The only way to concatenate them is to replace all ‘H’ numbers with ‘T’ numbers but ‘H’ times. However in most cases it is a bad idea. You can do it by:
import torch

A = torch.rand(3, 2)
B = torch.rand(5)
C = B.repeat(A.shape[0], A.shape[1], 1)

the output will be:
A torch.Size([3, 2])
tensor([[0.1305, 0.8649],
        [0.2945, 0.3027],
        [0.6107, 0.6925]])
---
B torch.Size([5])
tensor([0.3653, 0.6501, 0.8864, 0.0936, 0.6012])
---
C torch.Size([3, 2, 5])
tensor([[[0.3653, 0.6501, 0.8864, 0.0936, 0.6012],
         [0.3653, 0.6501, 0.8864, 0.0936, 0.6012]],

        [[0.3653, 0.6501, 0.8864, 0.0936, 0.6012],
         [0.3653, 0.6501, 0.8864, 0.0936, 0.6012]],

        [[0.3653, 0.6501, 0.8864, 0.0936, 0.6012],
         [0.3653, 0.6501, 0.8864, 0.0936, 0.6012]]])