The diagram is 2D, and in 3D the most straightforward solution seems to swim to the side.
There are other subtleties in 3D as well; some weirs form a downstream-pointing V when viewed from above the dam - these are generally considered safer as the currents will (generally) move you to the middle of the river and downstream where the water is more likely to be escapable - see [1].
Others can form an upstream-pointing V which has the opposite effect where the currents will move you towards the middle of the river but upstream back towards the stopper/keeper/hydraulic.
[1] https://assets.atlasobscura.com/media/W1siZiIsInVwbG9hZHMvcG...