mbrookhart commented on a change in pull request #6388:
URL: https://github.com/apache/incubator-tvm/pull/6388#discussion_r483783861



##########
File path: src/relay/op/tensor/transform.cc
##########
@@ -3146,5 +3146,84 @@ RELAY_REGISTER_OP("matrix_set_diag")
     .set_attr<FTVMCompute>("FTVMCompute", MatrixSetDiagCompute)
     .set_attr<TOpPattern>("TOpPattern", kInjective);
 
+// adv_index
+bool AdvIndexRel(const Array<Type>& types, int num_inputs, const Attrs& attrs,
+                 const TypeReporter& reporter) {
+  CHECK_EQ(num_inputs, 1);
+  auto inputs = types[0].as<TupleTypeNode>();
+  CHECK(inputs != nullptr);

Review comment:
       I'd leave it to @jroesch to explain the InferType algorithm more fully, 
but the basic issue is that sometimes the InferType algorithm will call this 
function with an as-of yet incomplete input type, I think the class is 
`IncompleteTypeNode`. If we CHECK here, that crashes the algorithm, but if we 
return false (i.e., we failed to infer the output type), the algorithm will try 
again once it has more information on the inputs, at which point we will pass 
the check and continue with the function.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to