Skip to content

Conversation

jacob-hegna
Copy link
Collaborator

To get from TF saved model to TFLite, see:
llvm/lib/Analysis/models/saved-model-to-tflite.py.

Example usage:

python compiler_opt/tools/tflite_to_cpp.py \
  --name="InlineOzTestModel" \
  --emitc_runtime_path=/tmp/mlir-emitc/reference-implementation/include/emitc
  --iree_import_tflite_path=/tmp/iree-import-tflite \
  --input=/tmp/model.tflite \
  --emitc_opt_path=/tmp/emitc-opt \
  --mlir_translate_path=/tmp/mlir-translate \
  --output_dir=/tmp/ \
  --base_class=::llvm::MLInlineOzEmitCModel \
  --additional_headers="llvm/Analysis/MLInlineEmitCModel.h"

To get from TF saved model to tflite, see:
  llvm/lib/Analysis/models/saved-model-to-tflite.py
@jacob-hegna
Copy link
Collaborator Author

will upload tests early next week. uploaded the patch without them initially so that reviewer(s) of reviews.llvm.org/D146483 can reference the code that produces the EmitC models.

@jacob-hegna jacob-hegna requested a review from mtrofin April 22, 2023 03:17
@mtrofin
Copy link
Collaborator

mtrofin commented Apr 24, 2023

Why can't this go in llvm/llvm-project/llvm/lib/Analysis/models?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants