trevor-m opened a new pull request #6368:
URL: https://github.com/apache/incubator-tvm/pull/6368


   Sometimes input nodes will have multiple data entries. The graph runtime 
will give a separate `arg` for each entry. The previous code assumed each input 
node would have 1 entry at index 0 which would correspond with a single arg. 
This caused [this 
assert](https://github.com/apache/incubator-tvm/blob/master/src/runtime/contrib/json/json_runtime.h#L149-L150)
 to fail because the function has 3 args but 2 input + output nodes.
   
   Note that each custom runtime will also have the handle these types of 
inputs in a similar way.
   
   Example JSON representation which would fail before but works with this PR. 
See how op `input` has two entries for `dtype` and `shape`.
   
   ```
   {
     "nodes": [
       {
         "op": "input", 
         "name": "tensorrt_0_i0", 
         "attrs": {
           "dtype": [
             [
               "float32", 
               "float32"
             ]
           ], 
           "shape": [
             [
               [1, 2, 6, 6], 
               [1, 3, 6, 6]
             ]
           ]
         }
       }, 
       {
         "op": "kernel", 
         "name": "concatenate", 
         "inputs": [[
             0, 
             0, 
             0], [
             0, 
             1, 
             0]], 
         "attrs": {
           "num_outputs": "1", 
           "num_inputs": "2", 
           "dtype": [
             [
               "float32"
             ]
           ], 
           "axis": [
             [
               "1"
             ]
           ], 
           "shape": [
             [
               [1, 5, 6, 6]
             ]
           ]
         }
       }
     ], 
     "arg_nodes": [0], 
     "heads": [[
         1, 
         0, 
         0]], 
     "node_row_ptr": [0, 2, 3]
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to