def _softmax_output_grad(ans, x, y):
    """Gradient function for softmax output."""
    def grad(_0): #pylint: disable= missing-docstring
        N = x.shape[0]
        return (ans - y) / N
    return grad