class_docstr: Author: {Xiang An, Yang Xiao, XuHan Zhu} in DeepGlint,
  Partial FC: Training 10 Million Identities on a Single Machine
  See the original paper:
  https://arxiv.org/abs/2010.05222
code: def step(self, optimizer):
      if int(self.sample_ratio) < 1:
          warnings.warn(
              "Explicitly call the function paddle._C_ops.sparse_momentum is a temporary manner. "
              "We will merge it to optimizer in the future, please don't follow."
          )
  
          found_inf = paddle.logical_not(
              paddle.all(paddle.isfinite(self._parameter_list[0].grad))
          )
          if found_inf:
              print("Found inf or nan in classifier")
          else:
              if (
                  self.weight.name
                  not in optimizer._accumulators[
                      optimizer._velocity_acc_str
                  ]
              ):
                  optimizer._add_accumulator(
                      optimizer._velocity_acc_str, self.weight
                  )
  
              velocity = optimizer._accumulators[
                  optimizer._velocity_acc_str
              ][self.weight.name]
              _, _ = paddle._C_ops.sparse_momentum(
                  self.weight,
                  self._parameter_list[0].grad,
                  velocity,
                  self.index,
                  paddle.to_tensor(optimizer.get_lr(), dtype="float32"),
                  self.weight,
                  velocity,
                  "mu",
                  optimizer._momentum,
                  "use_nesterov",
                  optimizer._use_nesterov,
                  "regularization_method",
                  optimizer._regularization_method,
                  "regularization_coeff",
                  optimizer._regularization_coeff,
                  "axis",
                  1,
              )
  
file_path: insightface/recognition/arcface_paddle/dynamic/classifiers/lsc.py
imports: import warnings
  import math
  import os
  import paddle
  import paddle.nn
label_desc: Use image node_id 2 for calling the LargeScaleClassifier obj's underlying member method code with example usage: obj.step(optimizer) without return types