How to subtract tensors like matmul?

I want to apply another function instead of multiplication operation in matmul.

Is that possible?

I do not think you can, torch.matmul only does “Matrix product of two tensors.” as the site says. You can implement your custom function though.