Skip to content

Instantly share code, notes, and snippets.

@tucan9389
Last active May 10, 2023 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tucan9389/0a307f4ad281d319e25c7507f94d59e0 to your computer and use it in GitHub Desktop.
Save tucan9389/0a307f4ad281d319e25c7507f94d59e0 to your computer and use it in GitHub Desktop.
/*
* original code of mlir.js in netron repo
* https://github.com/lutzroeder/netron/blob/main/source/mlir.js
*/
if (process.argv.length >= 3) {
const fs = require('fs');
function runParser(textContent) {
const decoder = text.Decoder.open(textContent);
const parser = new mlir.Parser(decoder);
const obj = parser.read();
const model = new mlir.Model(obj);
}
const mlirFilePath = process.argv[2];
const fileText = fs.readFileSync(mlirFilePath, 'utf8');
runParser(fileText);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment