Could you print the shape of pred after the max pooling layer in forward?
It looks like cl2 should output something like [20, height, width] instead of [10, height, width].
I would check it myself, but I’m currently not on my laptop.