@Samuel_Adu I think since the size of outputs is (N, 1) where n_classes or C = 1 here, whereas the labels tensor contains values like for eg. [1, 0, 1, 0, 0] i.e labels for class 0 and 1, this error is thrown.
The variable output_dim should be 2 and size of outputs tensor should be (N, 2).
Just to make sure, is this a binary classification task?