class_docstr: SM3 optimizer, as described in https://arxiv.org/abs/1901.11150.
class_docstr_tok: ["SM3","optimizer",",","as","described","in","https",":","\/\/arxiv.org\/abs\/1901.11150","."]
code: def update(self, step, g, w, slots, opt_params):
      del step
      m, v1, v2 = slots
      rank = len(w.shape)
      if rank > 1:
          return self._update_sketched(g, w, m, v1, v2, opt_params)
      else:
          return self._update_diagonal(g, w, m, v1, v2, opt_params)
  
file_path: trax/trax/optimizers/sm3.py
imports: import enum
  from trax.fastmath import numpy
  from trax.optimizers import base
label_desc: Use image node_id 8 for calling the SM3 obj's underlying member method code with example usage: obj.update(step, g, w, slots, opt_params) and returns: self, self