"Wrote" and "rote" are homophones. Rote memory is a learning technique where one repeats certain facts until it is instilled in their memory. This joke is playing on the word "wrote" because it sounds like "rote" which relates to a learning technique.
' ' This is all from memory , ' ' Tom wrote .