Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
TonyTonyFun
Paddle
提交
768dab44
P
Paddle
项目概览
TonyTonyFun
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
768dab44
编写于
11月 23, 2020
作者:
C
Chen Weihang
提交者:
GitHub
11月 23, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polish two api doc detail, test=document_fix (#28971)
上级
7c7cdf08
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
6 addition
and
17 deletion
+6
-17
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+2
-3
python/paddle/fluid/dygraph/io.py
python/paddle/fluid/dygraph/io.py
+4
-14
未找到文件。
paddle/fluid/pybind/pybind.cc
浏览文件 @
768dab44
...
...
@@ -1714,8 +1714,7 @@ All parameter, weight, gradient are variables in Paddle.
m
.
def
(
"init_gflags"
,
framework
::
InitGflags
);
m
.
def
(
"init_glog"
,
framework
::
InitGLOG
);
m
.
def
(
"load_op_library"
,
framework
::
LoadOpLib
);
m
.
def
(
"init_devices"
,
[]()
{
framework
::
InitDevices
();
});
m
.
def
(
"init_devices"
,
[]()
{
framework
::
InitDevices
();
});
m
.
def
(
"is_compiled_with_cuda"
,
IsCompiledWithCUDA
);
m
.
def
(
"is_compiled_with_xpu"
,
IsCompiledWithXPU
);
...
...
@@ -2280,7 +2279,7 @@ All parameter, weight, gradient are variables in Paddle.
"configured again."
));
self
.
gradient_scale_
=
strategy
;
},
R"DOC((
fluid
.BuildStrategy.GradientScaleStrategy, optional): there are three
R"DOC((
paddle.static
.BuildStrategy.GradientScaleStrategy, optional): there are three
ways of defining :math:`loss@grad` in ParallelExecutor, that is, CoeffNumDevice,
One and Customized. By default, ParallelExecutor sets the :math:`loss@grad`
according to the number of devices. If you want to customize :math:`loss@grad`,
...
...
python/paddle/fluid/dygraph/io.py
浏览文件 @
768dab44
...
...
@@ -566,12 +566,12 @@ def _construct_params_and_buffers(model_path,
class
TranslatedLayer
(
layers
.
Layer
):
"""
TranslatedLayer is a
imperative Layer for holding the model loaded by
:ref:`api_imperative_jit_load` . It can be used like a general Layer
object in eval or train mode.
TranslatedLayer is a
``paddle.nn.Layer`` for holding the model
loaded by :ref:`api_paddle_jit_load` . It can be used like a
general Layer
object in eval or train mode.
.. note:
The TranslatedLayer objects should not be created by constructor, it only can be loaded and constructed by :ref:`api_
imperativ
e_jit_load` .
The TranslatedLayer objects should not be created by constructor, it only can be loaded and constructed by :ref:`api_
paddl
e_jit_load` .
Examples:
.. code-block:: python
...
...
@@ -621,10 +621,6 @@ class TranslatedLayer(layers.Layer):
print("Epoch {} batch {}: loss = {}".format(
epoch_id, batch_id, np.mean(loss.numpy())))
# enable dygraph mode
place = paddle.CPUPlace()
paddle.disable_static(place)
# 1. train & save model.
# create network
...
...
@@ -635,7 +631,6 @@ class TranslatedLayer(layers.Layer):
# create data loader
dataset = RandomDataset(BATCH_NUM * BATCH_SIZE)
loader = paddle.io.DataLoader(dataset,
places=place,
batch_size=BATCH_SIZE,
shuffle=True,
drop_last=True,
...
...
@@ -896,10 +891,6 @@ class TranslatedLayer(layers.Layer):
print("Epoch {} batch {}: loss = {}".format(
epoch_id, batch_id, np.mean(loss.numpy())))
# enable dygraph mode
place = paddle.CPUPlace()
paddle.disable_static(place)
# create network
layer = LinearNet()
loss_fn = nn.CrossEntropyLoss()
...
...
@@ -908,7 +899,6 @@ class TranslatedLayer(layers.Layer):
# create data loader
dataset = RandomDataset(BATCH_NUM * BATCH_SIZE)
loader = paddle.io.DataLoader(dataset,
places=place,
batch_size=BATCH_SIZE,
shuffle=True,
drop_last=True,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录