Could you print the shapes of all tensors you are using to compute the prediction as well as to calculate the loss?
While the output width seems to be 0, the input width also looks suspicious as it’s only a single row.