afe.load.importers.keras

Functions

import_keras_model(file_path, input_shapes)

Load a Keras model from a file path and a list of input shapes

validate_input_parameters(→ None)

Validates the user supplied input.

import_keras_to_tvm(→ afe._tvm._defines.TVMIRModule)

Module Contents

afe.load.importers.keras.import_keras_model(file_path: str, input_shapes: List[Tuple[int, Ellipsis]])[source]

Load a Keras model from a file path and a list of input shapes :param file_path: str. Filepath to the keras .h5 file :param input_shapes: List[Tupe[int, …]]. List of input shapes (eg. (1,224,224,3)) return: A Keras model

afe.load.importers.keras.validate_input_parameters(keras_file_path: str, shape_dict: Dict[str, Tuple[int, Ellipsis]]) None[source]

Validates the user supplied input. :param keras_file_path: filepath to the keras .h5 file :param shape_dict: dictionary of input names to input shapes (eg. (1,224,224,3))

afe.load.importers.keras.import_keras_to_tvm(keras_file_path: str, shape_dict: Dict[str, Tuple[int, Ellipsis]], layout: str) afe._tvm._defines.TVMIRModule[source]
Parameters:
  • keras_file_path – filepath to the keras .h5 file

  • shape_dict – dictionary of input names to input shapes (eg. (1,224,224,3))

  • layout – How data should be arranged in the imported model.

Returns:

Imported TVM IR module.