Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Sphinx tree for fluid directory #9403

Merged
merged 1 commit into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/fluid/build_and_install/build_from_source_cn.rst
1 change: 1 addition & 0 deletions doc/fluid/build_and_install/build_from_source_en.rst
1 change: 1 addition & 0 deletions doc/fluid/build_and_install/docker_install_cn.rst
1 change: 1 addition & 0 deletions doc/fluid/build_and_install/docker_install_en.rst
2 changes: 0 additions & 2 deletions doc/fluid/build_and_install/index_cn.rst

This file was deleted.

1 change: 1 addition & 0 deletions doc/fluid/build_and_install/index_cn.rst
2 changes: 0 additions & 2 deletions doc/fluid/build_and_install/index_en.rst

This file was deleted.

1 change: 1 addition & 0 deletions doc/fluid/build_and_install/index_en.rst
1 change: 1 addition & 0 deletions doc/fluid/build_and_install/pip_install_cn.rst
1 change: 1 addition & 0 deletions doc/fluid/build_and_install/pip_install_en.rst
7 changes: 7 additions & 0 deletions doc/fluid/design/algorithm/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
梯度更新算法
------------

.. toctree::
:maxdepth: 1

parameter_average.md
7 changes: 7 additions & 0 deletions doc/fluid/design/algorithm/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Gradient Update Algorithm
--------------------------------------

.. toctree::
:maxdepth: 1

parameter_average.md
12 changes: 6 additions & 6 deletions doc/fluid/design/concepts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ A few months ago when we were trying to replace CMake with Bazel, @emailweixu su

Here are some initial thoughts. Your comments are welcome!

### Required CMake Function
# Required CMake Function

I think we need only the following few CMake functions to make a project description mean and clean:

Expand All @@ -25,7 +25,7 @@ Also,
- to describe external dependencies, we need `external_library`.
- to build shared libraries, we need `shared_library`.

### An Example Project
## An Example Project

Suppose that we have aforementioned functions defined in our `/cmake` directory. The following example `CMakeLists.txt` describes a project including the following source files:

Expand Down Expand Up @@ -102,11 +102,11 @@ shared_library(api

```

### Implementation
## Implementation

As above example CMakeLists.txt executes, each function invocation adds "nodes" to a dependency graph. It also use this graph to generate CMake commands including `add_executable`, `add_dependencies`, `target_link_libraries`, and `add_test`.

### Using Package Manager For Go
## Using Package Manager For Go

Building Go binaries and libraries need to satisfy their dependencies, generally
we can do `go get ./...` to download and compile all external dependencies. The
Expand All @@ -122,7 +122,7 @@ problems are:
at many cloud file hosting, so users what to compile paddle by themselves can
download this "vendor" package from a mirror site.

#### Choose A Suitable Tool
### Choose A Suitable Tool

As mentioned by @wangkuiyi, [Here](https://github.com/golang/go/wiki/PackageManagementTools)
list dozens of Go package managers. We choose the tool using following principles:
Expand All @@ -140,7 +140,7 @@ management tool has been started at: https://github.com/golang/dep to resolve
such problems, but it's currently at Alpha stage. So the best choice now is
glide obviously.

#### Manage Go Packages
### Manage Go Packages

- Dependencies: `go/glide.yaml` will store the dependencies and their versions which
is directly imported by paddle. `go/glide.lock` will store all dependencies recursively
Expand Down
18 changes: 18 additions & 0 deletions doc/fluid/design/concepts/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
核心概念
-------------

.. toctree::
:maxdepth: 1

README.md
cpp_data_feeding.md
functions_operators_layers.md
program.md
variable.md
var_desc.md
tensor.md
tensor_array.md
lod_tensor.md
block.md
scope.md
executor.md
18 changes: 18 additions & 0 deletions doc/fluid/design/concepts/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Core Concepts
--------------------------------------

.. toctree::
:maxdepth: 1

README.md
cpp_data_feeding.md
functions_operators_layers.md
program.md
variable.md
var_desc.md
tensor.md
tensor_array.md
lod_tensor.md
block.md
scope.md
executor.md
4 changes: 2 additions & 2 deletions doc/fluid/design/concepts/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Scope is an association of a name to variable. All variables belong to `Scope`.

Variable can not belong to many scopes. If you want to use variables from parent scope, you can use `parent scope`.

1. Scope should destruct all Variables inside it when itself is destructed. User can never store `Variable` pointer somewhere else.
1. Scope should destruct all Variables inside it when itself is destructed. User can never store `Variable` pointer somewhere else.

Because Variable can only be got from Scope. When destroying Scope, we also need to destroy all the Variables in it. If user store `Variable` pointer to private data member or some global variable, the pointer will be an invalid pointer when associated `Scope` is destroyed.

Expand Down Expand Up @@ -78,7 +78,7 @@ In `Scope` class, there is a private data member called `parent_`. `parent_` is

A local scope is very useful when we implement Recurrent Neural Network. Each timestep of an RNN should be a `Net`. Each `Net` of timestep (`StepNet` for short) should use an independent local scope. Just like variables in a while loop is inside a local scope in programming languages. By using a single `StepNet` and changing local scope, we can implement an RNN easily.

# Interface Design
## Interface Design

```cpp
class Variable {
Expand Down
2 changes: 2 additions & 0 deletions doc/fluid/design/concepts/var_desc.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Design Doc: Var_desc

## Background
PaddlePaddle divides the description of neural network computation into two stages: compile time and runtime. At compile time, the neural network computation is described as a `ProgramDesc` whereas at runtime an `Executor` interprets the `ProgramDesc` to compute the operations.

Expand Down
8 changes: 8 additions & 0 deletions doc/fluid/design/concurrent/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
并发编程
------------

.. toctree::
:maxdepth: 1

concurrent_programming.md
parallel_do.md
8 changes: 8 additions & 0 deletions doc/fluid/design/concurrent/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Concurrent Programming
-------------------------

.. toctree::
:maxdepth: 1

concurrent_programming.md
parallel_do.md
7 changes: 7 additions & 0 deletions doc/fluid/design/data_type/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
数据类型
------------

.. toctree::
:maxdepth: 1

float16.md
7 changes: 7 additions & 0 deletions doc/fluid/design/data_type/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Data Type
------------

.. toctree::
:maxdepth: 1

float16.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Design Doc: Distributed Lookup Table Operator
# Design Doc: Distributed Lookup Table Operator

A lookup table operator in PaddlePaddle where the table could be out
of the memory of a computer.
Expand Down
9 changes: 9 additions & 0 deletions doc/fluid/design/dist_train/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
分布式训练
------------

.. toctree::
:maxdepth: 1

distributed_architecture.md
distributed_lookup_table_design.md
parameter_server.md
9 changes: 9 additions & 0 deletions doc/fluid/design/dist_train/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Distributed Training
---------------------

.. toctree::
:maxdepth: 1

distributed_architecture.md
distributed_lookup_table_design.md
parameter_server.md
8 changes: 8 additions & 0 deletions doc/fluid/design/dynamic_rnn/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
动态RNN
------------

.. toctree::
:maxdepth: 1

rnn.md
rnn_design.md
8 changes: 8 additions & 0 deletions doc/fluid/design/dynamic_rnn/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dynamic RNN
------------

.. toctree::
:maxdepth: 1

rnn.md
rnn_design.md
15 changes: 9 additions & 6 deletions doc/fluid/design/dynamic_rnn/rnn_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private:
- 由于传递过程是以复制`shared_ptr`的方式实现,因此框架只需要传递一次 `lod_start_pos`

2. 对于不感知 `lod_start_pos` 的Op足够透明
3. 需要修改 `lod_start_pos` 的producer Op可以在 `Run` 时更新自己的 `lod_start_pos` 数据
3. 需要修改 `lod_start_pos` 的producer Op可以在 `Run` 时更新自己的 `lod_start_pos` 数据

具体的设计分为以下3小节

Expand Down Expand Up @@ -189,7 +189,7 @@ struct SortedSeqItem {

std::vector<SortedSeqItem> sorted_seqs;
```
来追踪序列排序后的位置,并添加一个新的接口
来追踪序列排序后的位置,并添加一个新的接口

```c++
std::vector<SortedSeqItem> SortBySeqLen(const LODTensor& tensor);
Expand Down Expand Up @@ -233,7 +233,10 @@ x x
- 将每个序列concat 为规则的mini-batch表示

## 参考文献
1. [Tensorflow Bucketing](https://www.tensorflow.org/versions/r0.12/api_docs/python/contrib.training/bucketing)
2. [mxnet Bucketing](http://mxnet.io/how_to/bucketing.html)
3. [variable length input in RNN scenario](https://discuss.pytorch.org/t/about-the-variable-length-input-in-rnn-scenario/345/5)
4. [Level of details](https://en.wikipedia.org/wiki/Level_of_detail)
[Tensorflow Bucketing](https://www.tensorflow.org/versions/r0.12/api_docs/python/contrib.training/bucketing)

[mxnet Bucketing](http://mxnet.io/how_to/bucketing.html)

[variable length input in RNN scenario](https://discuss.pytorch.org/t/about-the-variable-length-input-in-rnn-scenario/345/5)

[Level of details](https://en.wikipedia.org/wiki/Level_of_detail)
8 changes: 8 additions & 0 deletions doc/fluid/design/execution/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
执行流程
-------------

.. toctree::
:maxdepth: 1

switch.md
if_else_op.md
8 changes: 8 additions & 0 deletions doc/fluid/design/execution/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Execution Process
--------------------------------------

.. toctree::
:maxdepth: 1

switch.md
if_else_op.md
6 changes: 3 additions & 3 deletions doc/fluid/design/execution/switch.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Design Doc: Switch
# Design Doc: Switch

### Background
## Background

Many programming languages provide `switch` as a generalization of `if-elif-else`. We want to add it to Fluid.

Expand All @@ -19,7 +19,7 @@ with switch() as switch:
fluid.print("Case 3")
```

### The Semantics
## The Semantics

1. A `switch` control-flow checks cases one-by-one.
1. The condition of each case is a boolean value, which is a scalar, and differs from the `fluid.if_else` control-flow, which condition could be a vector of boolean values.
Expand Down
17 changes: 17 additions & 0 deletions doc/fluid/design/index_cn.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
设计思想
------------

.. toctree::
:maxdepth: 1

motivation/index_cn.rst
execution/index_cn.rst
concepts/index_cn.rst
data_type/index_cn.rst
memory/index_cn.rst
muti_devices/index_cn.rst
dynamic_rnn/index_cn.rst
concurrent/index_cn.rst
algorithm/index_cn.rst
network/index_cn.rst
modules/index_cn.rst
interface/index_cn.rst
dist_train/index_cn.rst
17 changes: 17 additions & 0 deletions doc/fluid/design/index_en.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
Design
------------

.. toctree::
:maxdepth: 1

motivation/index_en.rst
execution/index_en.rst
concepts/index_en.rst
data_type/index_en.rst
memory/index_en.rst
muti_devices/index_en.rst
dynamic_rnn/index_en.rst
concurrent/index_en.rst
algorithm/index_en.rst
network/index_en.rst
modules/index_en.rst
interface/index_en.rst
dist_train/index_en.rst
4 changes: 4 additions & 0 deletions doc/fluid/design/interface/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
多语言接口
------------

TBD
4 changes: 4 additions & 0 deletions doc/fluid/design/interface/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Multi-Language Interface
-----------------------

TBD
7 changes: 7 additions & 0 deletions doc/fluid/design/memory/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
内存管理
------------

.. toctree::
:maxdepth: 1

memory_optimization.md
7 changes: 7 additions & 0 deletions doc/fluid/design/memory/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Memory Management
-------------------

.. toctree::
:maxdepth: 1

memory_optimization.md
Loading