Use it at the beginning on the script via:
torch.backends.cudnn.benchmark = True

This will use the cudnn heuristics for each new input shape, and will thus slow down this iteration.
However, the following iterations should be faster, if a fast kernel was selected.



 Sanjayvarma11:

But i didn’t found any example on this even in pytorch documentation


Thanks for this information. We should definitely fix this.