Matrix Inversion

New to TVM, still getting used to the best ways to express algorithms in te.compute:

Is there a better way to express a 2x3 matrix inverse than writing a long cascading te.compute(...te.if_then_else((i,j) == (0,0), .... te.if_then_else(... or using hybrid script?