Try the solution in my latest updated reply.
I think the issue is that the extra channel dimension in your tensor is retained in the output so your model output has shape (n_examples, 1, 10), which makes your loss function expect a label of shape (1, 10). If you reshape your output to (n_examples, 10), then the loss will take scalar labels.