I’m trying to get a handle of the organization the pytorch code base.
I see in an earlier version where matrix inverse and the backward operation for matrix inverse are implemented:

  
      github.com
  
  
    fmassa/pytorch/blob/359356776dbd66cf2208d9f791ea2da682ae9405/torch/autograd/_functions/linalg.py 12
import torch

from ..function import Function


class Diag(Function):

    def __init__(self, diagonal_idx=0):
        super(Diag, self).__init__()
        self.diagonal_idx = diagonal_idx

    def forward(self, input):
        return input.diag(self.diagonal_idx)

    def backward(self, grad_output):
        return grad_output.diag(self.diagonal_idx)


class Tril(Function):



  This file has been truncated. show original

  
  
    
    
  
  


However, in the new 1.0 version, I can find the implementation for inverse in BatchLinearAlgebra.cpp (https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/BatchLinearAlgebra.cpp 7), but I can’t figure out where the implementation of backwards for matrix inverse is.
Can someone give me a hint where this and other other implementations of backwards are located? The organization of the C++ part of the code base is a bit obscure.