Thank you the reply Tom.
I have printed the estimated output when the exception happened.
y_true::tensor([[[0.9508, 0.9464, 0.9941,  …, 0.1872, 0.4230, 0.4505],
[0.9412, 0.9590, 0.9167,  …, 0.0199, 0.0446, 0.0476],
[1.0088, 0.9939, 1.1853,  …, 0.0752, 0.1353, 0.1411],
…,
[1.0073, 1.0330, 1.0652,  …, 0.3139, 0.7555, 0.8156],
[0.9773, 0.9773, 0.9945,  …, 0.6462, 0.8663, 0.8789],
[1.0590, 1.0328, 1.0088,  …, 0.8305, 0.9132, 0.9175]]],
device=‘cuda:0’)
y_predict::tensor([[[0.2288, 0.0000, 0.0000,  …, 0.0000, 0.0000, 0.1711],
[0.2288, 0.0000, 0.0000,  …, 0.0000, 0.0000, 0.1711],
[0.2288, 0.0000, 0.0000,  …, 0.0000, 0.0000, 0.1711],
…,
[0.2288, 0.0000, 0.0000,  …, 0.0000, 0.0000, 0.1711],
[0.2288, 0.0000, 0.0000,  …, 0.0000, 0.0000, 0.1711],
[0.2288, 0.0000, 0.0000,  …, 0.0000, 0.0000, 0.1711]]],
device=‘cuda:0’, grad_fn=)