What does the inputs mean in graph.json?

When compiling the model, we can get a graph.json file, what dose the “inputs” element mean?And what does the index number mean?
image
For example, what do the numbers[1, 0, 0] mean?
And what does flatten_data:“0” mean?
I am confused and cannot find documents about its definition. Please help me.
Thanks.

1 Like

pls check this: https://docs.tvm.ai/dev/nnvm_json_spec.html#nodes

Hi @zhuochenKIDD So we have

  • node id
  • index
  • version

And what are ‘index’ and ‘version’ referring to here? They always appear as 0 for every node in my tests.

1 Like

Thank you very much, but same questions as adb, what does index and version mean?

sorry for late response, actually I am also curious about these meaning, for my use cases, they always appear as 0 like yours.

I quick go through the code in src/runtime/graph/graph_runtime.h, graph_runtime.cc and find these info:

  1. for “version” I did not see any use, perhaps just a reserved field
  2. for “index” , it is used for nodes which has more than one output:

in function GraphRuntime::SetupOpExecs() has a line uint32_t eid = this->entry_id(nid, index); I guest it might affects op forward execution order, however, I did not dive into the implementation.

Hope that helps you.

1 Like