I am building a library that converts a torchscript module to mxnet gluon. Given the two language is very similar I have an easy time parsing the .code and recreate the model. However, I am not able to extract the constants that appear in the code (e.g. CONSTANTS.c0). Any idea how I can obtain the value of this from the jit compiled module?
Are you trying to extract the constants from the serialized binary or in C++? If it’s the former you’ll have to parse the constants.pkl in the serialized zip file, which is in the same format as Python’s pickler (our reader is here).
Shouldn’t be too hard to add an endpoint that also passes back the constants table, given that we populate it with any call to PythonPrint. @ifeherva can you file a feature request on github for this?