reminisce commented on a change in pull request #14612: [Numpy] Misc fix
URL: https://github.com/apache/incubator-mxnet/pull/14612#discussion_r271955022
 
 

 ##########
 File path: src/kvstore/gradient_compression.cc
 ##########
 @@ -100,9 +100,9 @@ int64_t GradientCompression::GetCompressedSize(const 
int64_t original_size) {
 
 void GradientCompression::Quantize(const mxnet::NDArray &from, mxnet::NDArray 
*to,
                   mxnet::NDArray *residual, const int priority) {
-  CHECK(from.shape().ndim() != 0) << "source operand has zero dimension shape";
-  CHECK(to->shape().ndim() != 0) << "destination operand has zero dimension 
shape";
-  CHECK(residual->shape().ndim() != 0) << "residual operand has zero dimension 
shape";
+  CHECK(!mxnet::op::shape_is_none(from.shape())) << "source operand has 
undefined shape";
 
 Review comment:
   One suggestion here: we'd better use `shape_is_known` going forward, instead 
of `shape_is_none`, because the latter's naming has the flavor of negative 
boolean which is usually not recommended in practice.

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


With regards,
Apache Git Services

Reply via email to