True dinosaurs were not swimmers. There were a number of very large aquatic reptiles that lived during the age of the dinosaur, but they were not technically dinosaurs. These creatures belonged to one of several other groups, such as ichthyosaurs, plesiosaurs and mosasaurs, which were types of marine reptiles.
Inherent in the definition of dinosaur is its status as a terrestrial animal. Like other land animals, some dinosaurs, like the baryonyx, may have been able to swim if they found themselves in water, but there is no conclusive scientific evidence to support this. Even massive, long-necked dinosaurs such as apatosaurus, once thought to have spent its entire life submerged in deep water, are, as of 2014, believed to have been terrestrial forest dwellers.