OK! I figured it out!
Each number indicates a value in that row that satisfies the condition.
for example  here :
1
 1
 2
 2
 2
 3
 3
 3
 3

it means that in row 1, 2 elements satisfy the condition .in row 2, 3 elements satisfy the condition, and likely the row 3, 4 values satisfy the conditions. in the second part (i.e. res1) the actual indexes for  those values are provided that is :
1
 4
 2
 3
 6
 1
 2
 4
 7

1 means, the first value in the row 1
4 means, the 4th value in the row 1
2 means the 2nd value in the row 2
3 means the third value in the row 2
and so on…
to visualize  this, simply use torch::ones instead of randn and see the output like  this :
res0.shape: 32
preds:
 1  1  1  1  1  1  1  1
 1  1  1  1  1  1  1  1
 1  1  1  1  1  1  1  1
 1  1  1  1  1  1  1  1
[ CPUFloatType{4,8} ]

res.size: 2
res0:
 0
 0
 0
 0
 0
 0
 0
 0
 1
 1
 1
 1
 1
 1
 1
 1
 2
 2
 2
 2
 2
 2
 2
 2
 3
 3
 3
 3
 3
 3
 3
 3
[ CPULongType{32} ]
res1:
 0
 1
 2
 3
 4
 5
 6
 7
 0
 1
 2
 3
 4
 5
 6
 7
 0
 1
 2
 3
 4
 5
 6
 7
 0
 1
 2
 3
 4
 5
 6
 7
[ CPULongType{32} ]

and it works just lik np.where