afe.load.importers.caffe2

Functions

get_caffe2_predictor(init_net_file_path, ...)

Returns a predictor object we can use to execute the caffe2 model

validate_input_parameters(→ None)

Validates the user supplied input.

import_caffe2_to_tvm(→ afe._tvm._defines.TVMIRModule)

Use TVM frontend to import a caffe2 pb model into TVM Relay IR

Module Contents

afe.load.importers.caffe2.get_caffe2_predictor(init_net_file_path: str, predict_net_file_path: str)[source]

Returns a predictor object we can use to execute the caffe2 model :param init_net_file_path: filepath to the caffe2 .pb init_net file :param predict_net_file_path: filepath to the caffe2 .pb predict_net file

afe.load.importers.caffe2.validate_input_parameters(init_net_file_path: str, predict_net_file_path: str, shape_dict: Dict[str, Tuple[int, Ellipsis]], dtype_dict: Dict[str, afe.ir.tensor_type.ScalarType]) None[source]

Validates the user supplied input. :param init_net_file_path: filepath to the caffe2 .pb init_net file :param predict_net_file_path: filepath to the caffe2 .pb predict_net file :param shape_dict: dictionary of input names to input shapes (eg. (1,224,224,3)) :param dtype_dict: dictionary of input names to input types (eg. float32 or int64)

afe.load.importers.caffe2.import_caffe2_to_tvm(init_net_file_path: str, predict_net_file_path: str, shape_dict: Dict[str, Tuple[int, Ellipsis]], dtype_dict: Dict[str, afe.ir.tensor_type.ScalarType]) afe._tvm._defines.TVMIRModule[source]

Use TVM frontend to import a caffe2 pb model into TVM Relay IR :param init_net_file_path: filepath to the caffe2 .pb init_net file :param predict_net_file_path: filepath to the caffe2 .pb predict_net file :param shape_dict: dictionary of input names to input shapes (eg. (1,224,224,3)) :param dtype_dict: dictionary of input names to input types (eg. float32 or int64) :return: Imported TVM IR module.