The output shape is given in the formula in the docs 4.
Based on this formula, the output is expected, as the layers will return:
L_out = math.floor((L_in + 2 * padding - dilation * (kernel_size - 1) - 1) / stride + 1)

# 1st layer
(24 + 2 * 1 - 1 * (2-1) - 1) / 1 + 1 = 25
# 2nd layer
(25 + 2 * 1 - 2 * (2-1) - 1) / 1 + 1 = 25
# 3rd layer
(25 + 2 * 1 - 4 * (2-1) - 1) / 1 + 1 = 23