Chris,
They contract in both directions. They initially shorten in their lengh, but once sufficiently taut, if the tightening continues, this will cause the carpet to pull from the sides too.
Some shop carpet fitters cut corners by only installing gripper rods at the ends of the room, rather than around the entire perimeter. Often this is only discovered, when the UNSUSPECTING CC turne up to clean it. In this case, if its a shrinker and the backing fets damp, it will try to shrink. Now, if the fitter has properly compression fitted the ends, the carpet should not move from there, but in this case the pull in at the sides will be even greater and extremely dificult if not impossible to stretch back.
Any attempts at re stretching a shrunk carpet should be avoided until after it has properly settled down (1 to 2 weeks). Attempting to do so too early, rather than stretching the carpet backing you will tearing it apart, and when it does finally settle may well develop ripples.
Dave.