Hi,
The problem is the way you defined criterion. line 6 in last image or first line of method fit.
You need to pass a class object like criterion = torch.nn.BCELossWithLogits() note that you dont need to pass input/output at the time of definition.
Also it seems you have defined a custom method called binary_cross_entropy for criterion. The problem is from this method.
It would be great if you could share the code using text instead of image and wrapping it around a pair of ``` for better interaction.
Bests