class_docstr: Generic class for tensor products.
class_docstr_tok: ["Generic","class","for","tensor","products","."]
code: def rank(self):
      return len(self.shape)
  
file_path: sympy/sympy/tensor/functions.py
imports: from collections.abc import Iterable
  from functools import singledispatch
  from sympy.core.expr import Expr
  from sympy.core.mul import Mul
  from sympy.core.singleton import S
  from sympy.core.sympify import sympify
  from sympy.core.parameters import global_parameters
label_desc: Use image node_id 2 for calling the TensorProduct obj's underlying member method code with example usage: obj.rank() and returns: len