This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c7f883  Fix OSX build, std::max template resolution with different 
types. (#9654)
8c7f883 is described below

commit 8c7f8831c799c3a53f6c1ad43c91a7201cd6d058
Author: Pedro Larroy <928489+lar...@users.noreply.github.com>
AuthorDate: Thu Feb 1 04:29:50 2018 +0100

    Fix OSX build, std::max template resolution with different types. (#9654)
    
    narrowing cast from ProdShape to nnvm::dim_t
---
 include/mxnet/ndarray.h               | 2 +-
 tests/cpp/operator/fully_conn_perf.cc | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/mxnet/ndarray.h b/include/mxnet/ndarray.h
index 43bc205..23c2476 100644
--- a/include/mxnet/ndarray.h
+++ b/include/mxnet/ndarray.h
@@ -834,7 +834,7 @@ class NDArray {
     void CheckAndAlloc(uint64_t dbytes) {
       CHECK_EQ(kDefaultStorage, storage_type)
           << "CheckAndAlloc(dbytes) is only intended for kDefaultStorage";
-      dbytes = std::max(dbytes, shandle.size);
+      dbytes = std::max(dbytes, static_cast<uint64_t>(shandle.size));
       if (delay_alloc) {
         shandle = Storage::Get()->Alloc(dbytes, shandle.ctx);
 #if MXNET_USE_MKLDNN == 1
diff --git a/tests/cpp/operator/fully_conn_perf.cc 
b/tests/cpp/operator/fully_conn_perf.cc
index 829c203..0ea4082 100644
--- a/tests/cpp/operator/fully_conn_perf.cc
+++ b/tests/cpp/operator/fully_conn_perf.cc
@@ -26,6 +26,7 @@
 
 #include <dmlc/logging.h>
 #include <mxnet/tensor_blob.h>
+#include <nnvm/tuple.h>
 #include "../../src/operator/nn/fully_connected-inl.h"
 #include "../include/test_op_runner.h"
 #include "../include/test_core_op.h"
@@ -76,7 +77,7 @@ TEST(FULLY_CONNECTED, FullyConnectedTimingCPU) {
     };
   }
   for (const TShape& shape : shapes) {
-    TShape shape2({250, shape.ProdShape(1, shape.ndim())});
+    TShape shape2({250, static_cast<nnvm::dim_t>(shape.ProdShape(1, 
shape.ndim()))});
     kwargs = test::op::CoreOpExecutor<float>::ArgsWithOpName(kwargs, 
"FullyConnected",
                                                              
"_backward_FullyConnected");
     runner.TimingTest("Fully connected CPU", false, false, kwargs, 2, 10,

-- 
To stop receiving notification emails like this one, please contact
marcoab...@apache.org.

Reply via email to