Solved by albanD in post #2 
              
              
                Hi, 
I’m a bit confused by your convert_to_correlation. It does not use m. 
For 1: all the operations your use support batching (.diagonal, .inverse and matmul), so you can write a convert_to_correlation that works on the whole batch at once. 
For 2: we have an implementation of derivatives for inve…