RuntimeError: dimension specified as 0 but tensor has no dimensions

Hi, Actually I am trying to train skip-thought vectors on multiple-gpus, this implementation is taken from https://github.com/sanyam5/skip-thoughts code. But, while computing loss function, am getting above error. Can anybody help me to resolve this issue. Thank you.
Loss snippet code: