Thank for your reply, but the gradients got from PyTorch and TensorFlow do not agree, and alpha.grad, alpha2.grad are None. Don’t know whether it has anything to do with the implementation of the function - conversion between Tensor and np.ndarray within forward. Looking forward to the update on more matrix functions…