My son is 18 months and does the same..
And he even smacks himself..
Me and his dad don't smack him so I haven't a clue were he learns it from.. its so frustration I understand
I'm trying to put it down to a "phase" and hoping if I ignore he will stop.. :( it's horrible watching them harm them self !!