blob: 3e2eb3dd57b37fe76742e4a372e01f084a34edd2 [file] [log] [blame]
<!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"/>
<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: ''
};
</script>
<script src="../_static/jquery-1.11.1.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://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script type="text/javascript"> jQuery(function() { Search.loadIndex("/searchindex.js"); Search.init();}); </script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-96378503-1', 'auto');
ga('send', 'pageview');
</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://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> -->
<!-- -->
<link href="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-icon.png" rel="icon" type="image/png"/>
</link></link></head>
<body role="document"><!-- Previous Navbar Layout
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="../" class="navbar-brand">
<img src="http://data.mxnet.io/theme/mxnet.png">
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul id="navbar" class="navbar navbar-left">
<li> <a href="../get_started/index.html">Get Started</a> </li>
<li> <a href="../tutorials/index.html">Tutorials</a> </li>
<li> <a href="../how_to/index.html">How To</a> </li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Packages <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../packages/python/index.html">
Python
</a></li>
<li><a href="../packages/r/index.html">
R
</a></li>
<li><a href="../packages/julia/index.html">
Julia
</a></li>
<li><a href="../packages/c++/index.html">
C++
</a></li>
<li><a href="../packages/scala/index.html">
Scala
</a></li>
<li><a href="../packages/perl/index.html">
Perl
</a></li>
</ul>
</li>
<li> <a href="../system/index.html">System</a> </li>
<li>
<form class="" role="search" action="../search.html" method="get" autocomplete="off">
<div class="form-group inner-addon left-addon">
<i class="glyphicon glyphicon-search"></i>
<input type="text" name="q" class="form-control" placeholder="Search">
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form> </li>
</ul>
<ul id="navbar" class="navbar navbar-right">
<li> <a href="../index.html"><span class="flag-icon flag-icon-us"></span></a> </li>
<li> <a href="..//zh/index.html"><span class="flag-icon flag-icon-cn"></span></a> </li>
</ul>
</div>
</div>
</div>
Previous Navbar Layout End -->
<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="http://data.mxnet.io/theme/mxnet.png"/></a>
</h1>
<nav class="nav-bar" id="main-nav">
<a class="main-nav-link" href="../get_started/install.html">Install</a>
<a class="main-nav-link" href="../tutorials/index.html">Tutorials</a>
<a class="main-nav-link" href="../how_to/index.html">How To</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">API <span class="caret"></span></a>
<ul class="dropdown-menu" id="package-dropdown-menu">
<li><a class="main-nav-link" href="../api/python/index.html">Python</a></li>
<li><a class="main-nav-link" href="../api/scala/index.html">Scala</a></li>
<li><a class="main-nav-link" href="../api/r/index.html">R</a></li>
<li><a class="main-nav-link" href="../api/julia/index.html">Julia</a></li>
<li><a class="main-nav-link" href="../api/c++/index.html">C++</a></li>
<li><a class="main-nav-link" href="../api/perl/index.html">Perl</a></li>
</ul>
</span>
<a class="main-nav-link" href="../architecture/index.html">Architecture</a>
<!-- <a class="main-nav-link" href="../community/index.html">Community</a> -->
<a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a>
<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">Versions(master)<span class="caret"></span></a><ul id="package-dropdown-menu" class="dropdown-menu"><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/test/>v0.10.14</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/test/versions/0.10/index.html>0.10</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/test/versions/master/index.html>master</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 dropdown-menu-right" id="burgerMenu">
<li><a href="../get_started/install.html">Install</a></li>
<li><a href="../tutorials/index.html">Tutorials</a></li>
<li><a href="../how_to/index.html">How To</a></li>
<li class="dropdown-submenu">
<a href="#" tabindex="-1">API</a>
<ul class="dropdown-menu">
<li><a href="../api/python/index.html" tabindex="-1">Python</a>
</li>
<li><a href="../api/scala/index.html" tabindex="-1">Scala</a>
</li>
<li><a href="../api/r/index.html" tabindex="-1">R</a>
</li>
<li><a href="../api/julia/index.html" tabindex="-1">Julia</a>
</li>
<li><a href="../api/c++/index.html" tabindex="-1">C++</a>
</li>
<li><a href="../api/perl/index.html" tabindex="-1">Perl</a>
</li>
</ul>
</li>
<li><a href="../architecture/index.html">Architecture</a></li>
<li><a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a></li>
<li id="dropdown-menu-position-anchor-version-mobile" class="dropdown-submenu" style="position: relative"><a href="#" tabindex="-1">Versions(master)</a><ul class="dropdown-menu"><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/test/>v0.10.14</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/test/versions/0.10/index.html>0.10</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/test/versions/master/index.html>master</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>
<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="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/master/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="http://mxnet.io/api/python/ndarray.html#mxnet.ndarray.Embedding">Embedding</a> , <a class="reference external" href="http://mxnet.io/api/python/ndarray.html#mxnet.ndarray.ROIPooling">ROIPooling</a> , <a class="reference external" href="http://mxnet.io/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 class="container">
<div class="footer">
<p> © 2015-2017 DMLC. All rights reserved. </p>
</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> <!-- pagename != index -->
<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 type="text/javascript">
$('body').ready(function () {
$('body').css('visibility', 'visible');
});
</script>
</div></body>
</html>