class_docstr: This class is a wrapper for numpy sort function.
class_docstr_tok: ["This","class","is","a","wrapper","for","numpy","sort","function","."]
code: def grad(self, inputs, output_grads):
      a, axis = inputs
      indices = self.__get_argsort_indices(a, axis)
      inp_grad = output_grads[0][tuple(indices)]
      axis_grad = grad_undefined(
          self,
          1,
          axis,
          "The gradient of sort is not defined "
          "with respect to the integer axes itself",
      )
      return [inp_grad, axis_grad]
  
imports: import numpy
  from pytensor.gradient import grad_undefined
  from pytensor.graph.basic import Apply, Constant
  from pytensor.graph.op import Op
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor.basic import arange, as_tensor_variable, flatten, switch
  from pytensor.tensor.math import eq, ge, mul
  from pytensor.tensor.shape import shape
  from pytensor.tensor.subtensor import set_subtensor
  from pytensor.tensor.type import TensorType, integer_dtypes
label_desc: Use image node_id 6 for calling the SortOp obj's underlying member method code with example usage: obj.grad(inputs, output_grads) and returns: list