versions/0.11.0/community/contribute.html (473 lines of code) (raw):

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta content="IE=edge" http-equiv="X-UA-Compatible"/> <meta content="width=device-width, initial-scale=1" name="viewport"/> <meta content="Contribute to MXNet" property="og:title"> <meta content="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/og-logo.png" property="og:image"> <meta content="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/og-logo.png" property="og:image:secure_url"> <meta content="Contribute to MXNet" property="og:description"/> <title>Contribute to MXNet — mxnet documentation</title> <link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" rel="stylesheet"/> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/> <link href="../_static/basic.css" rel="stylesheet" type="text/css"> <link href="../_static/pygments.css" rel="stylesheet" type="text/css"> <link href="../_static/mxnet.css" rel="stylesheet" type="text/css"/> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script> <script src="../_static/underscore.js" type="text/javascript"></script> <script src="../_static/searchtools_custom.js" type="text/javascript"></script> <script src="../_static/doctools.js" type="text/javascript"></script> <script src="../_static/selectlang.js" type="text/javascript"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script> <script type="text/javascript"> jQuery(function() { Search.loadIndex("/versions/0.11.0/searchindex.js"); Search.init();}); </script> <!-- --> <!-- <script type="text/javascript" src="../_static/jquery.js"></script> --> <!-- --> <!-- <script type="text/javascript" src="../_static/underscore.js"></script> --> <!-- --> <!-- <script type="text/javascript" src="../_static/doctools.js"></script> --> <!-- --> <!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> --> <!-- --> <link href="../genindex.html" rel="index" title="Index"> <link href="../search.html" rel="search" title="Search"/> <link href="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-icon.png" rel="icon" type="image/png"/> </link></link></link></meta></meta></meta></head> <body background="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg" role="document"> <div class="content-block"><div class="navbar navbar-fixed-top"> <div class="container" id="navContainer"> <div class="innder" id="header-inner"> <h1 id="logo-wrap"> <a href="../" id="logo"><img src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"/></a> </h1> <nav class="nav-bar" id="main-nav"> <a class="main-nav-link" href="/versions/0.11.0/get_started/install.html">Install</a> <span id="dropdown-menu-position-anchor"> <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Gluon <span class="caret"></span></a> <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu"> <li><a class="main-nav-link" href="/versions/0.11.0/tutorials/gluon/gluon.html">About</a></li> <li><a class="main-nav-link" href="https://www.d2l.ai/">Dive into Deep Learning</a></li> <li><a class="main-nav-link" href="https://gluon-cv.mxnet.io">GluonCV Toolkit</a></li> <li><a class="main-nav-link" href="https://gluon-nlp.mxnet.io/">GluonNLP Toolkit</a></li> </ul> </span> <span id="dropdown-menu-position-anchor"> <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">API <span class="caret"></span></a> <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu"> <li><a class="main-nav-link" href="/versions/0.11.0/api/python/index.html">Python</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/c++/index.html">C++</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/julia/index.html">Julia</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/perl/index.html">Perl</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/r/index.html">R</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/scala/index.html">Scala</a></li> </ul> </span> <span id="dropdown-menu-position-anchor-docs"> <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Docs <span class="caret"></span></a> <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-docs"> <li><a class="main-nav-link" href="/versions/0.11.0/how_to/faq.html">FAQ</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/tutorials/index.html">Tutorials</a> <li><a class="main-nav-link" href="https://github.com/apache/incubator-mxnet/tree/v0.11.0/example">Examples</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/architecture/index.html">Architecture</a></li> <li><a class="main-nav-link" href="https://cwiki.apache.org/confluence/display/MXNET/Apache+MXNet+Home">Developer Wiki</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/model_zoo/index.html">Model Zoo</a></li> <li><a class="main-nav-link" href="https://github.com/onnx/onnx-mxnet">ONNX</a></li> </li></ul> </span> <span id="dropdown-menu-position-anchor-community"> <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Community <span class="caret"></span></a> <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-community"> <li><a class="main-nav-link" href="http://discuss.mxnet.io">Forum</a></li> <li><a class="main-nav-link" href="https://github.com/apache/incubator-mxnet/tree/v0.11.0">Github</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/community/contribute.html">Contribute</a></li> </ul> </span> <span id="dropdown-menu-position-anchor-version" style="position: relative"><a href="#" class="main-nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">0.11.0<span class="caret"></span></a><ul id="package-dropdown-menu" class="dropdown-menu"><li><a href="/">master</a></li><li><a href="/versions/1.7.0/">1.7.0</a></li><li><a href=/versions/1.6.0/>1.6.0</a></li><li><a href=/versions/1.5.0/>1.5.0</a></li><li><a href=/versions/1.4.1/>1.4.1</a></li><li><a href=/versions/1.3.1/>1.3.1</a></li><li><a href=/versions/1.2.1/>1.2.1</a></li><li><a href=/versions/1.1.0/>1.1.0</a></li><li><a href=/versions/1.0.0/>1.0.0</a></li><li><a href=/versions/0.12.1/>0.12.1</a></li><li><a href=/versions/0.11.0/>0.11.0</a></li></ul></span></nav> <script> function getRootPath(){ return "../" } </script> <div class="burgerIcon dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">☰</a> <ul class="dropdown-menu" id="burgerMenu"> <li><a href="/versions/0.11.0/get_started/install.html">Install</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/tutorials/index.html">Tutorials</a></li> <li class="dropdown-submenu dropdown"> <a aria-expanded="true" aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown" href="#" tabindex="-1">Gluon</a> <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu"> <li><a class="main-nav-link" href="/versions/0.11.0/tutorials/gluon/gluon.html">About</a></li> <li><a class="main-nav-link" href="http://gluon.mxnet.io">The Straight Dope (Tutorials)</a></li> <li><a class="main-nav-link" href="https://gluon-cv.mxnet.io">GluonCV Toolkit</a></li> <li><a class="main-nav-link" href="https://gluon-nlp.mxnet.io/">GluonNLP Toolkit</a></li> </ul> </li> <li class="dropdown-submenu"> <a aria-expanded="true" aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown" href="#" tabindex="-1">API</a> <ul class="dropdown-menu"> <li><a class="main-nav-link" href="/versions/0.11.0/api/python/index.html">Python</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/c++/index.html">C++</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/julia/index.html">Julia</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/perl/index.html">Perl</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/r/index.html">R</a></li> <li><a class="main-nav-link" href="/versions/0.11.0/api/scala/index.html">Scala</a></li> </ul> </li> <li class="dropdown-submenu"> <a aria-expanded="true" aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown" href="#" tabindex="-1">Docs</a> <ul class="dropdown-menu"> <li><a href="/versions/0.11.0/how_to/faq.html" tabindex="-1">FAQ</a></li> <li><a href="/versions/0.11.0/tutorials/index.html" tabindex="-1">Tutorials</a></li> <li><a href="https://github.com/apache/incubator-mxnet/tree/v0.11.0/example" tabindex="-1">Examples</a></li> <li><a href="/versions/0.11.0/architecture/index.html" tabindex="-1">Architecture</a></li> <li><a href="https://cwiki.apache.org/confluence/display/MXNET/Apache+MXNet+Home" tabindex="-1">Developer Wiki</a></li> <li><a href="/versions/0.11.0/model_zoo/index.html" tabindex="-1">Gluon Model Zoo</a></li> <li><a href="https://github.com/onnx/onnx-mxnet" tabindex="-1">ONNX</a></li> </ul> </li> <li class="dropdown-submenu dropdown"> <a aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown" href="#" role="button" tabindex="-1">Community</a> <ul class="dropdown-menu"> <li><a href="http://discuss.mxnet.io" tabindex="-1">Forum</a></li> <li><a href="https://github.com/apache/incubator-mxnet/tree/v0.11.0" tabindex="-1">Github</a></li> <li><a href="/versions/0.11.0/community/contribute.html" tabindex="-1">Contribute</a></li> </ul> </li> <li id="dropdown-menu-position-anchor-version-mobile" class="dropdown-submenu" style="position: relative"><a href="#" tabindex="-1">0.11.0</a><ul class="dropdown-menu"><li><a tabindex="-1" href=/>master</a></li><li><a tabindex="-1" href=/versions/1.6.0/>1.6.0</a></li><li><a tabindex="-1" href=/versions/1.5.0/>1.5.0</a></li><li><a tabindex="-1" href=/versions/1.4.1/>1.4.1</a></li><li><a tabindex="-1" href=/versions/1.3.1/>1.3.1</a></li><li><a tabindex="-1" href=/versions/1.2.1/>1.2.1</a></li><li><a tabindex="-1" href=/versions/1.1.0/>1.1.0</a></li><li><a tabindex="-1" href=/versions/1.0.0/>1.0.0</a></li><li><a tabindex="-1" href=/versions/0.12.1/>0.12.1</a></li><li><a tabindex="-1" href=/versions/0.11.0/>0.11.0</a></li></ul></li></ul> </div> <div class="plusIcon dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span></a> <ul class="dropdown-menu dropdown-menu-right" id="plusMenu"></ul> </div> <div id="search-input-wrap"> <form action="../search.html" autocomplete="off" class="" method="get" role="search"> <div class="form-group inner-addon left-addon"> <i class="glyphicon glyphicon-search"></i> <input class="form-control" name="q" placeholder="Search" type="text"/> </div> <input name="check_keywords" type="hidden" value="yes"> <input name="area" type="hidden" value="default"/> </input></form> <div id="search-preview"></div> </div> <div id="searchIcon"> <span aria-hidden="true" class="glyphicon glyphicon-search"></span> </div> <!-- <div id="lang-select-wrap"> --> <!-- <label id="lang-select-label"> --> <!-- <\!-- <i class="fa fa-globe"></i> -\-> --> <!-- <span></span> --> <!-- </label> --> <!-- <select id="lang-select"> --> <!-- <option value="en">Eng</option> --> <!-- <option value="zh">中文</option> --> <!-- </select> --> <!-- </div> --> <!-- <a id="mobile-nav-toggle"> <span class="mobile-nav-toggle-bar"></span> <span class="mobile-nav-toggle-bar"></span> <span class="mobile-nav-toggle-bar"></span> </a> --> </div> </div> </div> <script type="text/javascript"> $('body').css('background', 'white'); </script> <div class="container"> <div class="row"> <div aria-label="main navigation" class="sphinxsidebar leftsidebar" role="navigation"> <div class="sphinxsidebarwrapper"> <ul> <li class="toctree-l1"><a class="reference internal" href="../api/python/index.html">Python Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../api/r/index.html">R Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../api/julia/index.html">Julia Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../api/c++/index.html">C++ Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../api/scala/index.html">Scala Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../api/perl/index.html">Perl Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../how_to/index.html">HowTo Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../architecture/index.html">System Documents</a></li> <li class="toctree-l1"><a class="reference internal" href="../tutorials/index.html">Tutorials</a></li> </ul> </div> </div> <div class="content"> <div class="page-tracker"></div> <div class="section" id="contribute-to-mxnet"> <span id="contribute-to-mxnet"></span><h1>Contribute to MXNet<a class="headerlink" href="#contribute-to-mxnet" title="Permalink to this headline">¶</a></h1> <p>MXNet has been developed and is used by a group of active community members. Please contribute to improve the project. After your patch has been merged, remember to add your name to <a class="reference external" href="https://github.com/dmlc/mxnet/blob/master/CONTRIBUTORS.md">CONTRIBUTORS.md</a>.</p> <div class="section" id="code-contribution"> <span id="code-contribution"></span><h2>Code Contribution<a class="headerlink" href="#code-contribution" title="Permalink to this headline">¶</a></h2> <div class="section" id="core-library"> <span id="core-library"></span><h3>Core Library<a class="headerlink" href="#core-library" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Follow the <a class="reference external" href="https://google.github.io/styleguide/cppguide.html">Google C++ Style Guide</a> for C++ code.</li> <li>Use doxygen to document all of the interface code.</li> <li>To reproduce the linter checks, type <code class="docutils literal"><span class="pre">make</span> <span class="pre">lint</span></code>.</li> </ul> </div> <div class="section" id="python-package"> <span id="python-package"></span><h3>Python Package<a class="headerlink" href="#python-package" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Always add docstring to the new functions in numpydoc format.</li> <li>To reproduce the linter checks, type <code class="docutils literal"><span class="pre">make</span> <span class="pre">lint</span></code>.</li> </ul> </div> <div class="section" id="r-package"> <span id="r-package"></span><h3>R Package<a class="headerlink" href="#r-package" title="Permalink to this headline">¶</a></h3> <div class="section" id="code-style"> <span id="code-style"></span><h4>Code Style<a class="headerlink" href="#code-style" title="Permalink to this headline">¶</a></h4> <ul class="simple"> <li>Most of the C++ code in the R package relies heavily on <a class="reference external" href="https://github.com/RcppCore/Rcpp">Rcpp</a>.</li> <li>We follow the Google C++ Style Guide for C++ code. This allows us to maintain consistency with the rest of the project. It also allows us to check style automatically with a linter.</li> <li>To check the code style, type the following command at the root folder:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>make rcpplint </pre></div> </div> <ul class="simple"> <li>If necessary, disable the linter warning on certain lines with <code class="docutils literal"><span class="pre">//</span> <span class="pre">NOLINT(*)</span></code> comments.</li> </ul> </div> <div class="section" id="auto-generated-api"> <span id="auto-generated-api"></span><h4>Auto-Generated API<a class="headerlink" href="#auto-generated-api" title="Permalink to this headline">¶</a></h4> <ul class="simple"> <li>Many MXNet APIs are exposed dynamically from Rcpp.</li> <li>mxnet_generated.R is the auto-generated API and documents for these functions.</li> <li>Remake the file by typing the following command at root folder:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>make rcppexport </pre></div> </div> <ul class="simple"> <li>Use this command only when there is an update to dynamic functions.</li> </ul> </div> <div class="section" id="api-document"> <span id="api-document"></span><h4>API Document<a class="headerlink" href="#api-document" title="Permalink to this headline">¶</a></h4> <p>The document is generated using roxygen2. To remake the documents in the root folder, use the following command:</p> <div class="highlight-bash"><div class="highlight"><pre><span></span>make roxygen. </pre></div> </div> </div> <div class="section" id="r-markdown-vignettes"> <span id="r-markdown-vignettes"></span><h4>R Markdown Vignettes<a class="headerlink" href="#r-markdown-vignettes" title="Permalink to this headline">¶</a></h4> <p>R Markdown vignettes are located on GitHub in <a class="reference external" href="https://github.com/dmlc/mxnet/tree/master/R-package/vignettes">R-package/vignettes</a>. These R Markdown files aren’t compiled. We host the compiled version on <a class="reference external" href="https://github.com/dmlc/mxnet/tree/master/R-package/">doc/R-package</a>.</p> <p>To add a new R Markdown vignettes:</p> <ul class="simple"> <li>Add the original R Markdown file to <code class="docutils literal"><span class="pre">R-package/vignettes</span></code></li> <li>Modify <code class="docutils literal"><span class="pre">doc/R-package/Makefile</span></code> to add the Markdown files to be built.</li> <li>Clone the <a class="reference external" href="https://github.com/dmlc/web-data">dmlc/web-data</a> repo to the <code class="docutils literal"><span class="pre">doc</span></code> folder.</li> <li>Type the following command for the <code class="docutils literal"><span class="pre">doc/R-package</span></code> package:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>make the-markdown-to-make.md </pre></div> </div> <ul class="simple"> <li>This generates the markdown and the figures and places them into <code class="docutils literal"><span class="pre">doc/web-data/mxnet/knitr</span></code>.</li> <li>Modify the <code class="docutils literal"><span class="pre">doc/R-package/index.md</span></code> to point to the generated markdown.</li> <li>Add the generated figure to the <code class="docutils literal"><span class="pre">dmlc/web-data</span></code> repo.<ul> <li>If you have already cloned the repo to doc, use <code class="docutils literal"><span class="pre">git</span> <span class="pre">add</span></code>.</li> </ul> </li> <li>Create a pull request for both the markdown and <code class="docutils literal"><span class="pre">dmlc/web-data</span></code>.</li> <li>You can also build the document locally with the following command: <code class="docutils literal"><span class="pre">doc</span></code></li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>make html </pre></div> </div> </div> </div> <div class="section" id="test-cases"> <span id="test-cases"></span><h3>Test Cases<a class="headerlink" href="#test-cases" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>All of our tests can be found in the GitHub repo in <a class="reference external" href="https://github.com/dmlc/mxnet/tree/master/tests">this directory</a>.</li> <li>We use Python nose for python test cases, and gtest for C++ unit tests.</li> </ul> </div> <div class="section" id="examples"> <span id="examples"></span><h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Use cases and examples are on GitHub in <a class="reference external" href="https://github.com/dmlc/mxnet/tree/master/example">examples</a></li> <li>If you write a blog post or tutorial about or using MXNet, please tell us by creating an issue in our github repo. We regularly feature high-quality contributed content from the community.</li> </ul> </div> </div> <div class="section" id="standard-for-contributing-apis"> <span id="standard-for-contributing-apis"></span><h2>Standard for Contributing APIs<a class="headerlink" href="#standard-for-contributing-apis" title="Permalink to this headline">¶</a></h2> <p>Make sure to add documentation with any code you contribute. Follow these standards:</p> <div class="section" id="api-documentation"> <span id="api-documentation"></span><h3>API Documentation<a class="headerlink" href="#api-documentation" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Document are created with Sphinx and <a class="reference external" href="http://recommonmark.readthedocs.org/en/latest/">recommonmark</a>.</li> <li>Follow <a class="reference external" href="https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard">numpy doc standards</a> and some changes we made <a class="reference external" href="https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard">MXNet doc standards</a>.</li> <li>If an API is implemented in Python or has a wrapper defined, the documentation and the examples reside where the function is defined in <code class="docutils literal"><span class="pre">.py</span></code> file in <a class="reference external" href="https://github.com/dmlc/mxnet/tree/0.11.0/python/mxnet">python/mxnet</a> folder. Same goes for other languages.</li> <li>If the API is dynamically generated from the MXNet backend, the documentation is in the C++ code(.cc file) where the operator is registered in describe method of the <code class="docutils literal"><span class="pre">NNVM_REGISTER_OP</span></code>. The file and line number for the function is usually printed with the API documentation on mxnet.io.</li> <li>A clear and concise description of the function and its behavior.</li> <li>List and describe each parameter with the valid input values, whether it is required or optional, and the default value if the parameter is optional.</li> <li>Add an example to help the user understand the API better. If the example can be language-neutral or is conceptual, add it in the C++ documentation. Make sure your example works by running a Python version of the example.<ul> <li>If a concrete and simple language-specific example can further clarify the API and the API arguments, add the example in language-specific files.</li> </ul> </li> <li>Refer to these examples for guidance:- <a class="reference external" href="/versions/0.11.0/api/python/ndarray.html#mxnet.ndarray.Embedding">Embedding</a> , <a class="reference external" href="/versions/0.11.0/api/python/ndarray.html#mxnet.ndarray.ROIPooling">ROIPooling</a> , <a class="reference external" href="/versions/0.11.0/api/python/ndarray.html#mxnet.ndarray.Reshape">Reshape</a>.</li> </ul> </div> <div class="section" id="testing-and-rendering"> <span id="testing-and-rendering"></span><h3>Testing and Rendering<a class="headerlink" href="#testing-and-rendering" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Make sure not to break any coding standards. Run</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>make lint </pre></div> </div> <ul class="simple"> <li>You can build documents locally to proof them.</li> </ul> </div> </div> <div class="section" id="guidelines-to-submit-a-pull-request"> <span id="guidelines-to-submit-a-pull-request"></span><h2>Guidelines to submit a Pull Request<a class="headerlink" href="#guidelines-to-submit-a-pull-request" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Before submitting your contribution, rebase your code on the most recent version of the master:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span> git remote add upstream https://github.com/dmlc/mxnet git fetch upstream git rebase upstream/master </pre></div> </div> <ul class="simple"> <li>If you have multiple small commits, merge them into meaningful groups (use <code class="docutils literal"><span class="pre">git</span> <span class="pre">rebase</span></code> then <code class="docutils literal"><span class="pre">squash</span></code>).</li> <li>Send the pull request.</li> <li>Fix problems reported by automatic checks.</li> <li>If you are contributing a new module, consider adding a test case in <a class="reference external" href="https://github.com/dmlc/mxnet/tree/master/tests">tests</a>.</li> </ul> <div class="section" id="resolving-a-conflict-with-the-master"> <span id="resolving-a-conflict-with-the-master"></span><h3>Resolving a Conflict with the Master<a class="headerlink" href="#resolving-a-conflict-with-the-master" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Rebase to the current master:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span> <span class="c1"># The first two steps can be skipped after you do it once.</span> git remote add upstream https://github.com/dmlc/mxnet git fetch upstream git rebase upstream/master </pre></div> </div> <ul class="simple"> <li>Git might show some conflicts that prevent merging, for example, <code class="docutils literal"><span class="pre">conflicted.py</span></code>.</li> <li>Manually modify the file to resolve the conflict.<ul> <li>After you resolve the conflict, mark it as resolved by using:</li> </ul> </li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>git add conflicted.py. </pre></div> </div> <ul class="simple"> <li>Continue rebasing by using this command:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span> git rebase --continue </pre></div> </div> <ul class="simple"> <li>Finally push to your fork. You might need to force the push:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span> git push --force </pre></div> </div> </div> <div class="section" id="combining-multiple-commits"> <span id="combining-multiple-commits"></span><h3>Combining Multiple Commits<a class="headerlink" href="#combining-multiple-commits" title="Permalink to this headline">¶</a></h3> <p>If you are submitting multiple commits with later commits that are just fixes to previous ones, you can combine commits into meaningful groups before creating a push request.</p> <ul class="simple"> <li>Before doing so, configure Git’s default editor if you haven’t already done that:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>git config core.editor the-editor-you-like </pre></div> </div> <ul class="simple"> <li>Assuming that you want to merge last the last three commits, type the following commands:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>git rebase -i HEAD~3 </pre></div> </div> <ul class="simple"> <li>In the text editor that appears, set the first commit as <code class="docutils literal"><span class="pre">pick</span></code>, and change later ones to <code class="docutils literal"><span class="pre">squash</span></code>.</li> <li>After you save the file, another text editor will appear and ask you to modify the combined commit message.</li> <li>Push the changes to your fork by forcing a push:</li> </ul> <div class="highlight-bash"><div class="highlight"><pre><span></span>git push --force. </pre></div> </div> </div> <div class="section" id="what-is-the-consequence-of-forcing-a-push"> <span id="what-is-the-consequence-of-forcing-a-push"></span><h3>What Is the Consequence of Forcing a Push?<a class="headerlink" href="#what-is-the-consequence-of-forcing-a-push" title="Permalink to this headline">¶</a></h3> <p>The previous two tips require forcing a push because we altered the path of the commits. It’s fine to force a push to your own fork, as long as only your commits are changed.</p> </div> </div> </div> </div> </div> <div aria-label="main navigation" class="sphinxsidebar rightsidebar" role="navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Contribute to MXNet</a><ul> <li><a class="reference internal" href="#code-contribution">Code Contribution</a><ul> <li><a class="reference internal" href="#core-library">Core Library</a></li> <li><a class="reference internal" href="#python-package">Python Package</a></li> <li><a class="reference internal" href="#r-package">R Package</a><ul> <li><a class="reference internal" href="#code-style">Code Style</a></li> <li><a class="reference internal" href="#auto-generated-api">Auto-Generated API</a></li> <li><a class="reference internal" href="#api-document">API Document</a></li> <li><a class="reference internal" href="#r-markdown-vignettes">R Markdown Vignettes</a></li> </ul> </li> <li><a class="reference internal" href="#test-cases">Test Cases</a></li> <li><a class="reference internal" href="#examples">Examples</a></li> </ul> </li> <li><a class="reference internal" href="#standard-for-contributing-apis">Standard for Contributing APIs</a><ul> <li><a class="reference internal" href="#api-documentation">API Documentation</a></li> <li><a class="reference internal" href="#testing-and-rendering">Testing and Rendering</a></li> </ul> </li> <li><a class="reference internal" href="#guidelines-to-submit-a-pull-request">Guidelines to submit a Pull Request</a><ul> <li><a class="reference internal" href="#resolving-a-conflict-with-the-master">Resolving a Conflict with the Master</a></li> <li><a class="reference internal" href="#combining-multiple-commits">Combining Multiple Commits</a></li> <li><a class="reference internal" href="#what-is-the-consequence-of-forcing-a-push">What Is the Consequence of Forcing a Push?</a></li> </ul> </li> </ul> </li> </ul> </div> </div> </div><div class="footer"> <div class="section-disclaimer"> <div class="container"> <div> <img height="60" src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/apache_incubator_logo.png"/> <p> Apache MXNet is an effort undergoing incubation at The Apache Software Foundation (ASF), <strong>sponsored by the <i>Apache Incubator</i></strong>. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. </p> <p> "Copyright © 2017-2018, The Apache Software Foundation Apache MXNet, MXNet, Apache, the Apache feather, and the Apache MXNet project logo are either registered trademarks or trademarks of the Apache Software Foundation." </p> </div> </div> </div> </div> <!-- pagename != index --> </div> <script crossorigin="anonymous" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="../_static/js/sidebar.js" type="text/javascript"></script> <script src="../_static/js/search.js" type="text/javascript"></script> <script src="../_static/js/navbar.js" type="text/javascript"></script> <script src="../_static/js/clipboard.min.js" type="text/javascript"></script> <script src="../_static/js/copycode.js" type="text/javascript"></script> <script src="../_static/js/page.js" type="text/javascript"></script> <script src="../_static/js/docversion.js" type="text/javascript"></script> <script type="text/javascript"> $('body').ready(function () { $('body').css('visibility', 'visible'); }); </script> </body> </html>