TensorInv

Added tensorinv function.
I am sorry, i dont understand the meaning of this assert. In tensorinv, x is the tensor so x.ndim should be >=3 ?