docstr: Check if non const tensor feed into const input.
  This might happen in the early stage of conversion, for instance:
      constexpr_ -> reshape -> transpose -> linear
  
  However, the pattern is optimized into the following in a graph pass.
      constexpr_ -> linear
docstr_tok: ["Check","if","non","const","tensor","feed","into","const","input",".","This","might","happen","in","the","early","stage","of","conversion",",","for","instance",":","constexpr_","-",">","reshape","-",">","transpose","-",">","linear","However",",","the","pattern","is","optimized","into","the","following","in","a","graph","pass",".","constexpr_","-",">","linear"]
code: def _check_invalid_const_tensor_input(self):
      """
      Check if non const tensor feed into const input.
      This might happen in the early stage of conversion, for instance:
          constexpr_ -> reshape -> transpose -> linear
  
      However, the pattern is optimized into the following in a graph pass.
          constexpr_ -> linear
      """
  
      def _check_invalid_const_tensor_input_block(block):
          for op in block.operations:
              for b in op.blocks:
                  _check_invalid_const_tensor_input_block(b)
  
              for k, v in op.inputs.items():
                  input_type = op.input_spec.input_types[k]
  
                  if (
                      input_type.const
                      and not isinstance(input_type, InternalInputType)
                      and not (
                          v.op.op_type.startswith("constexpr_")
                          or v.val is not None
                      )
                  ):
                      raise ValueError(
                          f"In op {op.name}. Input {k} ({v.name}) must be const or constexpr ops."
                      )
  
      for f in self.functions.values():
          _check_invalid_const_tensor_input_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 12 for calling the Program obj's underlying member method code with example usage: obj._check_invalid_const_tensor_input() without return types