pytorch_misc icon indicating copy to clipboard operation
pytorch_misc copied to clipboard

target size

Open xysong1201 opened this issue 6 years ago • 1 comments

Hi, ptrblck, I don't know why your target tensor the final dimension is a tuple. could you explain y = torch.randint(0, nb_classes, (1, 96, 96))

xysong1201 avatar Jan 25 '19 08:01 xysong1201

torch.randint expects arguments as low, high, size, out, .... Since I wanted to sample random integers in [0, nb_classes-1] in the shape [1, 96, 96], I had to pass it this way. Otherwise, the 96 might be understood as the out argument.

ptrblck avatar Feb 01 '19 00:02 ptrblck