ndim

property Tensor7.ndim

As for numpy.ndarray