junrushao1994 commented on a change in pull request #13283: [MXNET-1215] Allow 
dynamic shape exists in imperative mode
URL: https://github.com/apache/incubator-mxnet/pull/13283#discussion_r234109094
 
 

 ##########
 File path: src/imperative/imperative_utils.h
 ##########
 @@ -117,11 +117,14 @@ inline void SetShapeType(const Context& ctx,
   for (auto& i : outputs) {
     out_shapes.push_back(i->shape());
   }
-  CHECK(infershape.count(attrs.op))
-    << "Operator " << attrs.op->name << " is missing FInferShape attribute";
-  CHECK(infershape[attrs.op](attrs, &in_shapes, &out_shapes));
-  CHECK_EQ(out_shapes.size(), outputs.size());
-
+  const bool dynamic_shape_exists = [&]() {
 
 Review comment:
   @ZhennanQin personal coding style though: in principle, having stuff defined 
and constant without uninitialized value helps reduce bugs. Meanwhile, compiler 
could optimize out the lambda function, so it doesn't introduce any overhead. 
But I admit that it does not look that straight-forward. So, if you don't like 
it, I could definitely change it back.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to