I have two tensors A and B of the following sizes
tensor_A = [16, 100]
tensor_B = [16, 3, 64, 64]

I want to concatenate them on the tensor_B’s channel axis (i.e. 3). First I reshaped tensor_A to have 4 dimensions and then multiplied it with torch.ones() tensor with the desired shape of tensor_B with the following code.
tensor_A  = tensor_A .view(16, 100, 1, 1)
tensor_A  = tensor_A  * torch.ones(16, 100, 64, 64, device='cuda')
concat = torch.cat((tensor_A  , tensor_B ), dim=1)

I am able to concatenate the two tensors but I am not sure whether

It is the right way to do or does there exist a better solution?
By doing so does the meaning of the 2D tensor_A change?