@staticmethod
def backward(ctx, grad_output):
    (input, weight) = ctx.saved_tensors
    grad_input = (grad_output @ np.swapaxes(weight, (- 2), (- 1)))
    grad_weight = (np.swapaxes(input, (- 2), (- 1)) @ grad_output)
    return (grad_input, grad_weight)
@staticmethod
def backward(ctx, grad_output):
    (input, weight) = ctx.saved_tensors
    grad_input = (grad_output @ np.swapaxes(weight, (- 2), (- 1)))
    grad_weight = (np.swapaxes(input, (- 2), (- 1)) @ grad_output)
    return (grad_input, grad_weight)