tkonolige commented on a change in pull request #6516:
URL: https://github.com/apache/incubator-tvm/pull/6516#discussion_r495315240



##########
File path: src/relay/op/vision/rcnn_op.cc
##########
@@ -119,14 +119,34 @@ bool ROIPoolRel(const Array<Type>& types, int num_inputs, 
const Attrs& attrs,
   CHECK(roi_pool_attrs);
   CHECK_EQ(dshape.size(), 4) << "Input data should be 4-D.";
   CHECK_EQ(rshape.size(), 2) << "Input rois should be 2-D.";
-  CHECK_EQ(roi_pool_attrs->layout, "NCHW") << "ROI Pool only supports NCHW 
layout";
   // assign output type
-  std::vector<IndexExpr> oshape(
-      {rshape[0], dshape[1], roi_pool_attrs->pooled_size[0], 
roi_pool_attrs->pooled_size[1]});
+  std::vector<IndexExpr> oshape;
+  if (roi_pool_attrs->layout == "NCHW") {
+    oshape = {rshape[0], dshape[1], roi_pool_attrs->pooled_size[0], 
roi_pool_attrs->pooled_size[1]};
+  } else {
+    CHECK_EQ(roi_pool_attrs->layout, "NHWC") << "Unexpected ROI Pool layout";

Review comment:
       Maybe you could add what the expected layout should be?




----------------------------------------------------------------
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