Moved condition for dilated grouped convolutions to CUDNN convolution implementation (#7465)

diff --git a/caffe2/operators/conv_op_cudnn.cc b/caffe2/operators/conv_op_cudnn.cc
index 52d9544..ddb0f8f 100644
--- a/caffe2/operators/conv_op_cudnn.cc
+++ b/caffe2/operators/conv_op_cudnn.cc
@@ -39,6 +39,15 @@
         dilation_h() == 1 && dilation_w() == 1,
         "The cudnn convolution does not support dilation yet.");
 #endif
+    // dilated grouped convolution supported in cuDNN v7.1
+#if !(CUDNN_VERSION_MIN(7,1,0))
+    if (group_ != 1) {
+      for (int dim = 0; dim < kernel_.size(); ++dim) {
+        OPERATOR_NEEDS_FEATURE(dilation_[dim] == 1,
+        "When group is used, dilation should not be set at the same time.");
+      }
+    }
+#endif
 
 #if CUDNN_VERSION_MIN(7, 0, 0)
     // verify TensorCore math is supported
diff --git a/caffe2/operators/conv_pool_op_base.h b/caffe2/operators/conv_pool_op_base.h
index 41b8f4a..2cd2385 100644
--- a/caffe2/operators/conv_pool_op_base.h
+++ b/caffe2/operators/conv_pool_op_base.h
@@ -165,15 +165,6 @@
       CAFFE_ENFORCE_GE(dilation_[dim], 0);
       CAFFE_ENFORCE_GE(stride_[dim], 0);
     }
-
-    if (group_ != 1) {
-      for (int dim = 0; dim < kernel_.size(); ++dim) {
-        CAFFE_ENFORCE_EQ(
-            dilation_[dim],
-            1,
-            "When group is used, dilation should not be set at the same time.");
-      }
-    }
   }
 
   // Returns the input image dimensions for the current storage order type.