docstr: Check if the program consists of tensors with rank >= 6.
docstr_tok: ["Check","if","the","program","consists","of","tensors","with","rank",">","=","6","."]
code: def _check_invalid_tensor_rank(self):
      """
      Check if the program consists of tensors with rank >= 6.
      """
  
      def _check_invalid_tensor_rank_block(block):
          for op in block.operations:
              for b in op.blocks:
                  _check_invalid_tensor_rank_block(b)
              for o in op.outputs:
                  if not isinstance(o, ListVar) and (
                      o.rank < 0 or o.rank >= 6
                  ):
                      if (
                          op.op_type == "const"
                          and len(o.child_ops) == 1
                          and o.child_ops[0].op_type
                          == "constexpr_lut_to_dense"
                      ):
                          # For lut op, the lookup table is allowed to have rank > 5.
                          continue
                      raise ValueError(
                          f'Core ML only supports tensors with rank <= 5. Layer "{op.name}", '
                          f'with type "{op.op_type}", outputs a rank {o.rank} tensor. '
                      )
  
      for f in self.functions.values():
          _check_invalid_tensor_rank_block(f)
  
imports: from collections import defaultdict
  from typing import Dict, List
  import numpy
  import sympy
  from coremltools import _logger
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.input_types import InputType
  from coremltools.converters.mil.mil.input_type import InternalInputType
  from coremltools.converters.mil.mil.ops.helper import _get_version_of_op
  from coremltools.converters.mil.mil.var import ListVar
  from .None import types
  from .block import Function
  from .operation import Operation
  from .types.symbolic import k_num_internal_syms, k_used_symbols
  from .var import Var
label_desc: Use image node_id 11 for calling the Program obj's underlying member method code with example usage: obj._check_invalid_tensor_rank() without return types