How to suppress this warning?

UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector. warnings.warn('Was asked to gather along dimension 0, but all ’

You are probably using DataParallel but returning a scalar in the network. You should return a batched output.