(self)
return self.__class__(
            backend=self.backend,
            ary=ary,
            dtype=self._tensor.dtype,
            base=self)
Return a transposed view.

        For 2D tensor, will do a normal transpose
        For 3D tensor, will keep the 0 dim, swap the 1 and 2 dimensions
Return a transposed view.
Return a transposed view .
def T(self):
        """
        Return a transposed view.

        For 2D tensor, will do a normal transpose
        For 3D tensor, will keep the 0 dim, swap the 1 and 2 dimensions

        """
        if len(self.shape) <= 2:
            ary = self._tensor.transpose()
        else:
            # support for batched dot.
            # perserve outer dimension but reverse inner dims
            # shape = np.concatenate((shape[-1:], shape[:-1])
            ary = self._tensor.swapaxes(1, 2)

        return self.__class__(
            backend=self.backend,
            ary=ary,
            dtype=self._tensor.dtype,
            base=self)
def T ( self ) : if len ( self . shape ) <= 2 : ary = self . _tensor . transpose ( ) else : # support for batched dot. # perserve outer dimension but reverse inner dims # shape = np.concatenate((shape[-1:], shape[:-1]) ary = self . _tensor . swapaxes ( 1 , 2 ) return self . __class__ ( backend = self . backend , ary = ary , dtype = self . _tensor . dtype , base = self )