Ho right I forgot this was not valid, my bad. You can do w_view.select(1, label).fill_(1).
But for your case, I guess what you want is:
labels = # Tensor or list of batch integers

res = torch.zeros(batch, 10, 10)

for label in labels:
  res.select(1, label).fill_(1)

res = res.view(batch, 100)