C1W4 A1: Issues with tensor concatenation

In Assignment 1 of Week 4, one part of the task is to concatenate two tensors. I think it’s fairly straightforward but turns out that it seems I overlooked something.

Assuming that I need to concatenate tensor A and B on the second dimension (in the assignment they are x and y), it should be pretty simple: new_tensor = torch.cat((A,B),dim=1). It, however, returns a quite strange error, Error: RuntimeError("Expected object of scalar type Float but got scalar type Long for sequence element 1 in sequence argument at position #1 'tensors'",)

Any feedback/help is highly welcomed and appreciated.

Kind regards,

Specify the property of value like A.float() and B.float()

1 Like