Did shamu the orca whale attack his trainer?

The incident you are likely referring to is the death of Dawn Brancheau, a SeaWorld trainer, in 2010. It was not Shamu who was involved, but a male orca named Tilikum.

Tilikum had a history of aggression and was involved in two previous deaths. While the incident was ruled an accident, it sparked significant debate about the ethics of keeping orcas in captivity and led to changes in safety protocols at SeaWorld.

It's important to be accurate about these events and not conflate different orcas.