There is more to this quote than you might think.
Grammatically, in English the verb "swim" requires an "animate subject", i.e. a living being, like a human or an animal. So the question of whether a submarine can swim is about grammar. In Russian (IIRC), submarines can swim just fine, because the verb does not have this animacy requirement. Crucially, the question is not about whether or how a submarine propels itself.
Likewise, in English at least, the verb "think" requires an animate object. the question whether a machine can think is about whether you consider it to be alive. Again, whether or how the machine generates its output is not material to the question.
I don't think the distinction is animate/inanimate.
Submarines sail because they are nautical vessels. Wind-up bathtub swimmers swim, because they look like they are swimming.
Neither are animate objects.
In a browser, if you click a button and it takes a while to load, your phone is thinking.