Random integers

this should work:

import torch

batch_size = 16
y = torch.randint(low=0,high=Dout,size=(batch_size,))

docs: https://pytorch.org/docs/stable/generated/torch.randint.html#torch.randint

1 Like