Hi,
This would be weird indeed.
I cannot reproduce your observation, running the following code returns gradients for both:
import torch
import math

weights = torch.randn(784,10)/math.sqrt(784)    # fresh weight initialization
weights.requires_grad_()

xb = torch.randn(64, 784)

prod = xb @ weights    # this yields null gradients...
# prod = 2*weights       # but this yields correct gradients! (in this case, 2)

iden = torch.ones([prod.shape[0],prod.shape[1]]) 
prod.backward(iden)
print(weights.grad)