Hello. I believe it could be done in many ways. A reasonable choice for me would be .cat method. Just make sure that the tensor B is also 1-dimensional as A.
This should work:
A = torch.tensor([1,2])
B = torch.tensor([3])
torch.cat((A,B))