Understanding the use of multiple python decorators in a single statement

Viewed 86

I recently came across a code snippet which is very similar to the one given below :

def abc(a,b,c):
    a1 = a[:, :1]
    b1 = b[:1, :]
    c1 = c[:1, :]
   
    a2 = a1.conj().transpose()
    b2 = c1.conj().transpose()
   
    d = np.linalg.inv(np.sqrt(b1))
   
    e = d @ a2 @ b @ b2 @ d
   
    return e

a,b,c are numpy arrays.

I am trying to understand python decorators and learned a bit from this question.

However I am not able to figure out how the variable e is defined. What exactly is happening ?

I am a beginner in Python. As far as my knowledge, decorators wrap around a function and functions are passed as arguments. But here, these are all numpy arrays.

Any explanation to what exactly is happening when variable e is defined or what is meant by the specific index with multiple decorators in a single line would be very helpful.

1 Answers
Related