aboutsummaryrefslogtreecommitdiffhomepage
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorGravatar Vijay Vasudevan <vrv@google.com>2017-05-03 12:25:10 -0700
committerGravatar GitHub <noreply@github.com>2017-05-03 12:25:10 -0700
commit22586bdf900640217deac6dc826054bc6e785518 (patch)
tree69ab6caed1f86ef3f649c07dd61157ff1c8f65e1 /CONTRIBUTING.md
parent2e329cc8987e82a83c2cfa708a83266a76d8c833 (diff)
Branch 154885009 (#9604)
* Enable grappler to propagate shapes through queues. Change: 154789133 * Add whitelist support in uid of RunConfig. Change: 154794859 * Fix a bunch of bad links and missing docs in contrib. Change: 154820641 * Don't try to refine the shapes for a node if its inference context wasn't successfully built by the AddNode() method. Change: 154838211 * Fix issue related to empty bazel.rc file. Change: 154840138 * Remove overly precise CHECK when rendering debug output for a function. An `_Arg` node can have more than three attrs, because the runtime may (and does) add system-defined attrs (viz. "_output_shapes") that do not change the meaning of the op. Change: 154850526 * Port makefile build breakage Change: 154855106 * [TF:XLA] Try to incorporate Tensorflow node structure for large HLO GraphDefs. This change assumes that a TF subgraph/op does not cross the boundary of a HLO computation and always put top-level TF subgraphs/ops under HLO computations. Change: 154855884 * Added a unit test to check what happens when 2 shapes with known rank but unknown dimensions are merged Change: 154856675 * [XLA] Refactor constant folding operations into a dedicated module Refactor constant folding operations into a dedicated module, and added a new ReplaceInstruction() API to collapse { computation->ReplaceInstruction(); changed=true}. Change: 154857025 * Java: Docs: Update instructions for Windows. Inspired by http://stackoverflow.com/questions/43741775/tensorflow-in-java-running-failed Change: 154859066 * Add more documentation for features and labels. Change: 154859649 * Added link to high-performance models Change: 154860213 * Navigation and index for new performance section documents. Change: 154862215 * Fix shape mismatch between loss and weights. Change: 154862650 * Add examples to TensorShape documentation and ran autoformatter. Change: 154862667 * Move linking of cudnn_plugin, cublas_plugin and cufft_plugin from stream_executor to the ops that need them. Change: 154863520 * Properly track the persistent memory usage of lookup tables. Change: 154866686 * Reset the inputs to ShapeRefiner::RunShapeFn so that it behaves the same every time it's called. To properly handle queues that have populated by several enqueue ops, merge the shapes of the inputs to all the enqueue ops before calling InferenceContext::set_output_handle_shape(). This ensures that we detect incorrect queue setups (where the 2 enqueue ops might generate tensors with incompatible shapes), and that we take all the known shape information instead of that of just one of the enqueue ops. Change: 154866747 * Making sure an error message will be produced by session_manager when a non-tensor object is passed in. Otherwise the 'name' property is missing. Change: 154868022 * Don't needlessly synchronize the CUDA stream in CropAndResize. Make the op Async so we don't block an executor thread while waiting for the result of the box bounds check to be copied back to the host. Change: 154868460 * Add contribution guidelines and standards section to CONTRIBUTING.md Several parts are largely based on the post by @yaroslavvb at: #7443#issuecomment-279182613 Fixes #7443 Change: 154876045 * Final draft Change: 154876563 * Final draft Change: 154876646 * Fix losses documentation. Fix documentation of get_total_loss() to be correct. And add a helpful comment about a common pitfall. Change: 154876822 * [XLA] Second change for HLO interpreter. Extends HloEvaluator to allow evaluation of HLO Computation or single HLO instruction with non-constant operands, by traversing the instruction in post order and keeps track of each instruction along the way as evaluated literals. Change: 154877580 * [tf distributions] Move the remaining whitelisted distributions to core. Change: 154878206 * Add shape to error message. Change: 154880260 * Revert "Fix build issue when `/usr/bin/python` path is not available (#9547)" This reverts commit 95f37ebf0bd46c328266f65bbd16d319c0efab3d.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md137
1 files changed, 137 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5ae5c0fbbc..c36ef1ecd3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -27,3 +27,140 @@ contributions, often because we probably won't get to them right now. If you
decide to start on an issue, leave a comment so that other people know that
you're working on it. If you want to help out, but not alone, use the issue
comment thread to coordinate.
+
+### Contribution guidelines and standards
+
+Before sending your pull request for
+[review](https://github.com/tensorflow/tensorflow/pulls),
+make sure your changes are consistent with the guidelines and follow the
+TensorFlow coding style.
+
+#### General guidelines and philosophy for contribution
+
+* Include unit tests when you contribute new features, as they help to
+ a) prove that your code works correctly, b) guard against future breaking
+ changes to lower the maintenance cost.
+* Bug fixes also generally require unit tests, because the presense of bugs
+ usually indicates insufficient test coverage.
+* Keep API compatibility in mind when you change code in core TensorFlow,
+ e.g., code in [tensorflow/core](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core) and [tensorflow/python](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python).
+ TensorFlow has reached version 1 and hence cannot make
+ non-backward-compatible API changes without a major release. Reviewers of your
+ pull request will comment on any API compatibility issues.
+* When you contribute a new feature to TensorFlow, the maintenance burden is (by
+ default) transferred to the TensorFlow team. This means that benefit of
+ contribution must be compared against the cost of maintaining the feature.
+* Full new features (e.g., a new op implementing a cutting-edge algorithm)
+ typically will live in
+ [tensorflow/contrib](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib)
+ to get some airtime before decision is made regarding whether they are to be
+ migrated to the core.
+
+#### License
+
+Include a license at the top of new files.
+
+* [C/C++ license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/op.cc#L1)
+* [Python license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/nn.py#L1)
+* [Java license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/Graph.java#L1)
+* [Go license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/go/operation.go#L1)
+* [Bash license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/ci_build/ci_sanity.sh#L2)
+* [HTML license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tensorboard/dist/index.html#L2)
+* [JavaScript/TypeScript license example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tensorboard/components/tf_backend/backend.ts#L1)
+
+Bazel BUILD files also need to include a license section, e.g.,
+[BUILD example](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/BUILD#L61).
+
+#### C++ coding style
+
+Changes to TensorFlow C++ code should conform to
+[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
+
+Use `clang-tidy` to check your C/C++ changes. To install clang-tidy on ubuntu:16.04, do:
+
+```bash
+apt-get install -y clang-tidy
+```
+
+You can check a C/C++ file by doing:
+
+
+```bash
+clang-format <my_cc_file> --style=google > /tmp/my_cc_file.cc
+diff <my_cc_file> /tmp/my_cc_file.cc
+```
+
+#### Python coding style
+
+Changes to TensorFlow Python code should conform to
+[Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)
+
+Use `pylint` to check your Python changes. To install `pylint` and
+retrieve TensorFlow's custom style definition:
+
+```bash
+pip install pylint
+wget -O /tmp/pylintrc https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/tools/ci_build/pylintrc
+```
+
+To check a file with `pylint`:
+
+```bash
+pylint --rcfile=/tmp/pylintrc myfile.py
+```
+
+#### Coding style for other languages
+
+* [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)
+* [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
+* [Google Shell Style Guide](https://google.github.io/styleguide/shell.xml)
+
+#### Running sanity check
+
+If you have Docker installed on your system, you can perform a sanity check on
+your changes by running the command:
+
+```bash
+tensorflow/tools/ci_build/ci_build.sh CPU tensorflow/tools/ci_build/ci_sanity.sh
+```
+
+This will catch most license, Python coding style and BUILD file issues that
+may exist in your changes.
+
+#### Running unit tests
+
+There are two ways to run TensorFlow unit tests.
+
+1. Using tools and libraries installed directly on your system.
+
+ Refer to the
+ [CPU-only developer Dockerfile](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel) and
+ [GPU developer Dockerfile](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel-gpu)
+ for the required packages. Alternatively, use the said
+ [Docker images](https://hub.docker.com/r/tensorflow/tensorflow/tags/), e.g.,
+ `tensorflow/tensorflow:nightly-devel` and `tensorflow/tensorflow:nightly-devel-gpu`
+ for development to avoid installing the packages directly on your system.
+
+ Once you have the packages installed, you can run a specific unit test in
+ bazel by doing as follows:
+
+ If the tests are to be run on GPU, add CUDA paths to LD_LIBRARY_PATH and add
+ the `cuda` option flag
+
+ ```bash
+ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH"
+
+ export flags="--config=opt --config=cuda -k"
+ ```
+
+ For example, to run all tests under tensorflow/python, do:
+
+ ```bash
+ bazel test ${flags} //tensorflow/python/...
+ ```
+
+2. Using Docker and TensorFlow's CI scripts.
+
+ See
+ [TensorFlow Builds](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/ci_build) for details.
+