Importing relay IRModule from text file?

Hi All,

Is it possible to import relay IRModule from a text file?

Assume, I have a text file named “a.txt” which contains the following. Can I import it to IRModule?

def @main(%x1: Tensor[(1, 1, 1, 20), float32], %y1: Tensor[(1, 1, 1, 20), float32]) {
  %0 = add(%x1, %y1);
  %1 = subtract(%x1, %y1);
  multiply(%0, %1)
}

Here is what I have tried, but the mod is empty.

a = mod._import("a.txt")

https://tvm.apache.org/docs/tutorials/frontend/deploy_sparse.html?highlight=save_json check this turtorial out, you will find answers there.

1 Like