Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
FluidDoc
提交
84f88c1c
F
FluidDoc
项目概览
PaddlePaddle
/
FluidDoc
通知
10
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
23
列表
看板
标记
里程碑
合并请求
111
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FluidDoc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
23
Issue
23
列表
看板
标记
里程碑
合并请求
111
合并请求
111
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
84f88c1c
编写于
2月 04, 2020
作者:
K
Kaipeng Deng
提交者:
GitHub
2月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix python example: grid_sampler, kldiv_loss, spectral_norm (#1754)
上级
949e5201
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
4 deletion
+10
-4
doc/fluid/api_cn/layers_cn/grid_sampler_cn.rst
doc/fluid/api_cn/layers_cn/grid_sampler_cn.rst
+2
-0
doc/fluid/api_cn/layers_cn/kldiv_loss_cn.rst
doc/fluid/api_cn/layers_cn/kldiv_loss_cn.rst
+3
-1
doc/fluid/api_cn/layers_cn/spectral_norm_cn.rst
doc/fluid/api_cn/layers_cn/spectral_norm_cn.rst
+5
-3
未找到文件。
doc/fluid/api_cn/layers_cn/grid_sampler_cn.rst
浏览文件 @
84f88c1c
...
@@ -62,6 +62,8 @@ step 2:
...
@@ -62,6 +62,8 @@ step 2:
.. code-block:: python
.. code-block:: python
import paddle.fluid as fluid
# 一般与 affine_grid 组合使用
# 一般与 affine_grid 组合使用
x = fluid.data(name='x', shape=[None, 10, 32, 32], dtype='float32')
x = fluid.data(name='x', shape=[None, 10, 32, 32], dtype='float32')
theta = fluid.layers.data(name='theta', shape=[2, 3], dtype='float32')
theta = fluid.layers.data(name='theta', shape=[2, 3], dtype='float32')
...
...
doc/fluid/api_cn/layers_cn/kldiv_loss_cn.rst
浏览文件 @
84f88c1c
...
@@ -34,10 +34,12 @@ kL发散损失计算如下:
...
@@ -34,10 +34,12 @@ kL发散损失计算如下:
返回类型:变量(Variable),数据类型与输入 ``x`` 一致。
返回类型:变量(Variable),数据类型与输入 ``x`` 一致。
**代码示例
**:
**代码示例
:**
.. code-block:: python
.. code-block:: python
import paddle.fluid as fluid
# 'batchmean' reduction, loss shape 为[N]
# 'batchmean' reduction, loss shape 为[N]
x = fluid.data(name='x', shape=[None,4,2,2], dtype='float32') # shape=[-1, 4, 2, 2]
x = fluid.data(name='x', shape=[None,4,2,2], dtype='float32') # shape=[-1, 4, 2, 2]
target = fluid.layers.data(name='target', shape=[4,2,2], dtype='float32')
target = fluid.layers.data(name='target', shape=[4,2,2], dtype='float32')
...
...
doc/fluid/api_cn/layers_cn/spectral_norm_cn.rst
浏览文件 @
84f88c1c
...
@@ -37,10 +37,12 @@ spectral_norm
...
@@ -37,10 +37,12 @@ spectral_norm
返回类型:变量(Variable),数据类型与输入 ``weight`` 一致。
返回类型:变量(Variable),数据类型与输入 ``weight`` 一致。
**代码示例
**:
**代码示例
:**
.. code-block:: python
.. code-block:: python
import paddle.fluid as fluid
weight = fluid.data(name='weight', shape=[2, 8, 32, 32], dtype='float32')
weight = fluid.data(name='weight', shape=[2, 8, 32, 32], dtype='float32')
x = fluid.layers.spectral_norm(weight=weight, dim=1, power_iters=2)
x = fluid.layers.spectral_norm(weight=weight, dim=1, power_iters=2)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录