Merge tensors with different dimmension

I have two tensors with different dimensions [423, 2] and [423, 10]. How can I merge these tensors (columns) to create one tensor with dimensions [423,10].

Many thanks in advance for your help.

print(categorical_data.shape)
print(categorical_data[:5])

print(numerical_data.shape)
print(numerical_data[:5])

#output:
torch.Size([423, 2])
tensor([[0, 4],
[2, 0],
[2, 1],
[2, 2],
[0, 4]])
torch.Size([423, 8])
tensor([[39.1440, 37.0711, 37.0711, 0.9470, 1.0000, 1.0000, 23.0000, 25.0000],
[39.1440, 2.0729, 1.3524, 0.0530, 0.0000, 0.6524, 23.0000, 25.0000],
[39.1440, 2.0729, 0.3276, 0.0530, 0.0000, 0.1581, 23.0000, 25.0000],
[39.1440, 2.0729, 0.3929, 0.0530, 0.0000, 0.1895, 23.0000, 25.0000],
[38.6237, 37.0152, 37.0152, 0.9584, 1.0000, 1.0000, 23.0000, 25.0000]],
dtype=torch.float64)

I believe you have a typo in your question, the two tensors are [423, 2] and [423, 8].

Here’s a link that may help:

You might have to change the ‘dim’ of the example.