Implementing using pytorch does not produce same results

That probably means that you “flattened” the data incorrectly for the way that PyTorch assumes it is oriented. Or that you “scrambled” the data in the flattening process. Here’s a thread about that.

Here’s a thread which also talks about the number of true and false values in the train and test data. Your numbers show that your model is just producing “yes” for all samples.

So, yes, this indicates a problem in your implementation.