adtzlr / tensortrax

Differentiable Tensors based on NumPy Arrays

Home Page:https://tensortrax.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Making transpose function as a property

adtzlr opened this issue · comments

Discussed in #96

Originally posted by ZAARAOUI999 August 9, 2023
Hi Mr Andreas, I wanna share with you this small trick, it looks like not interesting but...
So, my idea is just to add @property before this function in the Tensor class:

@property
def T(self):
        return transpose(self)

So the user can get the transpose with just typing Tensor.T rather than Tensor.T()
Thanks.