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

zhasheng 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 2d49d59  Fix warnings on cpp-package (#9089)
2d49d59 is described below

commit 2d49d59cf166b4fbc08cd5ce1acc273592a6c7e6
Author: Pedro Larroy <[email protected]>
AuthorDate: Wed Jan 10 20:34:00 2018 +0100

    Fix warnings on cpp-package (#9089)
    
    * Fix warnings on cpp-package
    
    * Make local symbols static in graph_executor
---
 cpp-package/README.md                       |  5 -----
 cpp-package/example/charRNN.cpp             |  2 --
 cpp-package/include/mxnet-cpp/optimizer.hpp |  1 -
 src/executor/graph_executor.cc              | 12 ++++++------
 4 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/cpp-package/README.md b/cpp-package/README.md
index cc65635..93edd27 100644
--- a/cpp-package/README.md
+++ b/cpp-package/README.md
@@ -1,10 +1,5 @@
 # MXNet C++ Package
 
-<!--
-[![Build 
Status](https://travis-ci.org/dmlc/MXNet.cpp.svg?branch=master)](https://travis-ci.org/dmlc/MXNet.cpp)
-[![Build 
status](https://ci.appveyor.com/api/projects/status/ckfq6j53sg5ll01d/branch/master?svg=true)](https://ci.appveyor.com/project/lx75249/mxnet-cpp/branch/master)
--->
-
 To build the package, please refer to 
<https://mxnet.incubator.apache.org/get_started/build_from_source.html#build-the-c-package>.
 
 A basic tutorial can be found at 
<https://mxnet.incubator.apache.org/tutorials/c++/basics.html>.
diff --git a/cpp-package/example/charRNN.cpp b/cpp-package/example/charRNN.cpp
index 218d11e..d28ae33 100644
--- a/cpp-package/example/charRNN.cpp
+++ b/cpp-package/example/charRNN.cpp
@@ -549,8 +549,6 @@ void trainWithBuiltInRNNOp(const string file, int 
batch_size, int max_epoch, int
   }
   start_epoch++;
 
-  mx_float learning_rate = 0.0002;
-  mx_float weight_decay = 0.000002;
   Optimizer* opt = OptimizerRegistry::Find("ccsgd");
 //  opt->SetParam("momentum", 0.9)->SetParam("rescale_grad", 1.0 / batch_size)
 //  ->SetParam("clip_gradient", 10);
diff --git a/cpp-package/include/mxnet-cpp/optimizer.hpp 
b/cpp-package/include/mxnet-cpp/optimizer.hpp
index f9c885f..cb8442d 100644
--- a/cpp-package/include/mxnet-cpp/optimizer.hpp
+++ b/cpp-package/include/mxnet-cpp/optimizer.hpp
@@ -296,7 +296,6 @@ inline void AdamOptimizer::Update(int index, NDArray 
weight, NDArray grad) {
   CHECK_EQ(keys.size(), values.size());
 
   float lr = std::stof(params_["lr"]);
-  float wd = std::stof(params_["wd"]);
   float b1 = std::stof(params_["beta1"]);
   float b2 = std::stof(params_["beta2"]);
   float t = count_[index];
diff --git a/src/executor/graph_executor.cc b/src/executor/graph_executor.cc
index 5f95df3..42508b1 100644
--- a/src/executor/graph_executor.cc
+++ b/src/executor/graph_executor.cc
@@ -139,7 +139,7 @@ const std::unordered_map<std::string, NDArray>& 
GraphExecutor::aux_state_map() c
   return aux_state_map_;
 }
 
-nnvm::NodeEntry AttrHint(nnvm::NodeEntry src, nnvm::NodeEntry like) {
+static nnvm::NodeEntry AttrHint(nnvm::NodeEntry src, nnvm::NodeEntry like) {
   static const Op* id_like = Op::Get("_identity_with_attr_like_rhs");
   nnvm::NodePtr n = nnvm::Node::Create();
   n->attrs.op = id_like;
@@ -310,7 +310,7 @@ nnvm::Graph GraphExecutor::InitFullGraph(nnvm::Symbol 
symbol,
  * \brief Assign context to the graph.
  * This is triggered by both simple_bind and bind flows.
  */
-Graph AssignContext(Graph g,
+static Graph AssignContext(Graph g,
                     const Context& default_ctx,
                     const std::map<std::string, Context>& ctx_map,
                     const std::vector<Context>& in_arg_ctxes,
@@ -435,7 +435,7 @@ Graph AssignContext(Graph g,
   return g;
 }
 
-void HandleInferShapeError(const size_t num_forward_inputs,
+static void HandleInferShapeError(const size_t num_forward_inputs,
                            const nnvm::IndexedGraph& idx,
                            const nnvm::ShapeVector& inferred_shapes) {
   int cnt = 10;
@@ -458,7 +458,7 @@ void HandleInferShapeError(const size_t num_forward_inputs,
              << oss.str();
 }
 
-void HandleInferTypeError(const size_t num_forward_inputs,
+static void HandleInferTypeError(const size_t num_forward_inputs,
                           const nnvm::IndexedGraph& idx,
                           const nnvm::DTypeVector& inferred_dtypes) {
   int cnt = 10;
@@ -481,7 +481,7 @@ void HandleInferTypeError(const size_t num_forward_inputs,
              << oss.str();
 }
 
-void HandleInferStorageTypeError(const size_t num_forward_inputs,
+static void HandleInferStorageTypeError(const size_t num_forward_inputs,
                                  const nnvm::IndexedGraph& idx,
                                  const StorageTypeVector& inferred_stypes) {
   int cnt = 10;
@@ -686,7 +686,7 @@ void GraphExecutor::InitArguments(const nnvm::IndexedGraph& 
idx,
  * Shareable storages include both default storage and row_sparse storage
  * if enable_row_sparse_sharing is `True`, otherwise default storage only.
  */
-NDArray ReshapeOrCreate(const std::string& name,
+static NDArray ReshapeOrCreate(const std::string& name,
                         const TShape& dest_arg_shape,
                         const int dest_arg_dtype,
                         const NDArrayStorageType dest_arg_stype,

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to