Do i change dimentions correctly

in net class input picture dimention is 3x100x100.

 batch_x=(X[x:x+batch_size]).permute(0,3,1,2)
 batch_y=Y[x:x+batch_size].long()

do i permute dimentions correctly? (it doesn’t output error, but in test set it predicts same value over and over again)
above batch_size=64.
i am trying to input 64x3x100x100 picture.

If X contains [N, H, W, C] data and you would like to provide it as [N, C, H, W], then your permutation is correct.

The constant output might come from a bad training run (overfitting to the majority class or mean value in a regression?).

ok,but my data is almost perfect, i mean it’s distribution is 48% 52%.

In that case, try to overfit a small data sample (e.g. just 10 samples) and play around with the hyperparameters.
Once your model is able to overfit the small data, you could try to scale up the experiment and use more data samples.
If the model isn’t able to overfit, there might be some other bugs in the code, e.g. forgetting to zero out the gradients.