class_docstr: Keras frontend for TVMC
class_docstr_tok: ["Keras","frontend","for","TVMC"]
code: def load(self, path, shape_dict=None, **kwargs):
      # pylint: disable=C0103
      tf = lazy_import("tensorflow")
      keras = lazy_import("keras", from_pkg_name="tensorflow")
  
      # tvm build currently imports keras directly instead of tensorflow.keras
      try:
          model = keras.models.load_model(path)
      except ValueError as err:
          raise TVMCException(str(err))
  
      # There are two flavours of keras model, sequential and
      # functional, TVM expects a functional model, so convert
      # if required:
      if self.is_sequential_p(model):
          model = self.sequential_to_functional(model)
  
      in_shapes = []
      for layer in model._input_layers:
          if tf.executing_eagerly():
              in_shapes.append(
                  tuple(
                      dim if dim is not None else 1
                      for dim in layer.input.shape
                  )
              )
          else:
              in_shapes.append(
                  tuple(
                      dim.value if dim.value is not None else 1
                      for dim in layer.input.shape
                  )
              )
  
      inputs = [
          np.random.uniform(size=shape, low=-1.0, high=1.0)
          for shape in in_shapes
      ]
      input_shapes = {
          name: x.shape for (name, x) in zip(model.input_names, inputs)
      }
      if shape_dict is not None:
          input_shapes.update(shape_dict)
      kwargs.setdefault("layout", "NHWC")
      return relay.frontend.from_keras(model, input_shapes, **kwargs)
  
imports: import logging
  import os
  import sys
  import re
  import importlib
  from abc import ABC
  from abc import abstractmethod
  from typing import Optional, List, Dict
  from pathlib import Path
  import numpy
  from tvm import relay
  from tvm import parser
  from tvm.driver.tvmc import TVMCException, TVMCImportError
  from tvm.driver.tvmc.model import TVMCModel
label_desc: Use image node_id 3 for calling the KerasFrontend obj's underlying member method code with example usage: obj.load(path, shape_dict) and returns: relay