Ok well the first problem is in cat you need to do this
X = torch.cat((X,Y))

the two tensors you need to cat needs to be in their own parenthesis. Can you print out the shapes of the X and Y tensors going into the cat.