Hi Shivani,
could you post an executable code snippet with random inputs, so that we could try to reproduce this issue?
Also, could you post your setup, i.e. used GPU, CUDA + cudnn version, PyTorch version and how you’ve installed it, please?