提交 552a028f 编写于 作者: C chengduozh

Remove paddle.v2

上级 968e647b
......@@ -8,7 +8,6 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees")
set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html")
set(IMPORT_PADDLE_STRING "import paddle")
set(IMPORT_PADDLEV2_STRING "import paddle.v2")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/../../templates/conf.py.en.in"
......
......@@ -1063,7 +1063,7 @@ py_reader
.. code-block:: python
import paddle.v2
import paddle
import paddle.fluid as fluid
import paddle.dataset.mnist as mnist
......@@ -1071,7 +1071,7 @@ py_reader
shapes=[(-1,3,224,224), (-1,1)],
dtypes=['float32', 'int64'])
reader.decorate_paddle_reader(
paddle.v2.reader.shuffle(paddle.batch(mnist.train())
paddle.reader.shuffle(paddle.batch(mnist.train())
img, label = fluid.layers.read_file(reader)
loss = network(img, label) # 一些网络定义
......@@ -1095,7 +1095,7 @@ py_reader
.. code-block:: python
import paddle.v2
import paddle
import paddle.fluid as fluid
import paddle.dataset.mnist as mnist
......@@ -1109,7 +1109,7 @@ py_reader
dtypes=['float32', 'int64'],
name='train_reader')
train_reader.decorate_paddle_reader(
paddle.v2.reader.shuffle(paddle.batch(mnist.train())
paddle.reader.shuffle(paddle.batch(mnist.train())
test_reader = fluid.layers.py_reader(capacity=32,
shapes=[(-1,3,224,224), (-1,1)],
......
......@@ -367,7 +367,7 @@
- 打印可读的 `Program`
```python
from paddle.v2.fluid import debuger
from paddle.fluid import debuger
print debuger.pprint_program_codes(framework.default_main_program().desc)
```
</font>
......@@ -1626,7 +1626,7 @@ class ClipKernel : public framework::OpKernel<T> {
- 当在python端执行时:
```python
import paddle.v2.fluid as fluid
import paddle.fluid as fluid
```
[`framework.py`](https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/fluid/framework.py#L1040)定义了两个全局`Program`:
```python
......
......@@ -19,7 +19,7 @@ cmake .. -DWITH_DOC=OFF -DWITH_GPU=OFF -DWITH_DISTRIBUTE=ON -DWITH_SWIG_PY=ON -D
这里,我们以[Deep Learing 101](http://www.paddlepaddle.org/docs/develop/book/01.fit_a_line/index.html)课程中的第一章 fit a line 为例,描述如何将单机训练脚本改造成支持集群训练的版本。
### 单机训练脚本示例
```python
import paddle.v2 as paddle
import paddle as paddle
import paddle.fluid as fluid
x = fluid.layers.data(name='x', shape=[13], dtype='float32')
......
......@@ -31,7 +31,7 @@ Let's take [Deep Learning 101](http://www.paddlepaddle.org/docs/develop/book/01.
The non-cluster version of this demo with fluid API is as follows:
``` python
import paddle.v2 as paddle
import paddle
import paddle.fluid as fluid
x = fluid.layers.data(name='x', shape=[13], dtype='float32')
......
......@@ -251,9 +251,8 @@ PaddleFluid 中以 :code:`fluid.layers.data` 来接收输入数据。
::
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.v2 as paddle
# define the input layers for the network.
x = fluid.layers.data(name="img", shape=[1, 28, 28], dtype="float32")
......@@ -350,10 +349,8 @@ Fluid 使用 Program 而不是计算图描述模型,一般情况下,用户
::
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.v2 as paddle
def main():
BATCH_SIZE = 128
......
......@@ -49,9 +49,9 @@ PyReader对象。
.. code-block:: python
import paddle
import paddle.fluid as fluid
import paddle.dataset.mnist as mnist
import paddle.v2
import numpy
......@@ -109,7 +109,7 @@ PyReader对象提供 :code:`decorate_tensor_provider` 和 :code:`decorate_paddle
use_cuda=True, share_vars_from=trainer, main_program=test_prog)
train_reader.decorate_paddle_reader(
paddle.v2.reader.shuffle(paddle.batch(mnist.train(), 512), buf_size=8192))
paddle.reader.shuffle(paddle.batch(mnist.train(), 512), buf_size=8192))
test_reader.decorate_paddle_reader(paddle.batch(mnist.test(), 512))
......
......@@ -54,9 +54,9 @@ Details are as follows:
.. code-block:: python
import paddle
import paddle.fluid as fluid
import paddle.dataset.mnist as mnist
import paddle.v2
import numpy
......@@ -115,7 +115,7 @@ Details are as follows(the remaining part of the code above):
use_cuda=True, share_vars_from=trainer, main_program=test_prog)
train_reader.decorate_paddle_reader(
paddle.v2.reader.shuffle(paddle.batch(mnist.train(), 512), buf_size=8192))
paddle.reader.shuffle(paddle.batch(mnist.train(), 512), buf_size=8192))
test_reader.decorate_paddle_reader(paddle.batch(mnist.test(), 512))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册