    def _rank(self) -> int:
        """
        Returns the rank of the tensor.
        It should not be used directly in IR.
        """
        return len(self._attrs["shape"])
Returns the rank of the tensor.
It should not be used directly in IR.
python/aitemplate/compiler/base.py