The issue has been found in PCP function: examples.extend([S[140, :], L[140,:]]) it has to changed to: examples.extend([S[:,140], L[:,140]])