Upon a plea of guilty, or upon conviction by the court without a jury, of a crime or attempted crime distinguished or divided into degrees, the court must, before passing sentence, determine the degree. Upon the failure of the court to so determine, the degree of the crime or attempted crime of which the defendant is guilty, shall be deemed to be of the lesser degree.
Ca. Pen. Code § 1192