Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9bcfc1a8
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2292
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9bcfc1a8
编写于
8月 20, 2020
作者:
A
Aurelius84
提交者:
GitHub
8月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix paddle.nn.data in new unittest (#26484)
* Rename `Input` into `InputSpec` * remove alias
上级
ac2010f4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
8 deletion
+3
-8
python/paddle/fluid/data.py
python/paddle/fluid/data.py
+2
-7
python/paddle/fluid/tests/unittests/test_erf_op.py
python/paddle/fluid/tests/unittests/test_erf_op.py
+1
-1
未找到文件。
python/paddle/fluid/data.py
浏览文件 @
9bcfc1a8
...
@@ -24,11 +24,6 @@ __all__ = ['data']
...
@@ -24,11 +24,6 @@ __all__ = ['data']
def
data
(
name
,
shape
,
dtype
=
'float32'
,
lod_level
=
0
):
def
data
(
name
,
shape
,
dtype
=
'float32'
,
lod_level
=
0
):
"""
"""
:api_attr: Static Graph
:alias_main: paddle.nn.data
:alias: paddle.nn.data,paddle.nn.input.data
:old_api: paddle.fluid.data
**Data Layer**
**Data Layer**
This function creates a variable on the global block. The global variable
This function creates a variable on the global block. The global variable
...
@@ -52,7 +47,7 @@ def data(name, shape, dtype='float32', lod_level=0):
...
@@ -52,7 +47,7 @@ def data(name, shape, dtype='float32', lod_level=0):
The default :code:`stop_gradient` attribute of the Variable created by
The default :code:`stop_gradient` attribute of the Variable created by
this API is true, which means the gradient won't be passed backward
this API is true, which means the gradient won't be passed backward
through the data Var
ai
ble. Set :code:`var.stop_gradient = False` If
through the data Var
ia
ble. Set :code:`var.stop_gradient = False` If
user would like to pass backward gradient.
user would like to pass backward gradient.
Args:
Args:
...
@@ -88,7 +83,7 @@ def data(name, shape, dtype='float32', lod_level=0):
...
@@ -88,7 +83,7 @@ def data(name, shape, dtype='float32', lod_level=0):
z = x + y
z = x + y
# In this example, we will feed x and y with np-ndarry "1"
# In this example, we will feed x and y with np-ndarr
a
y "1"
# and fetch z, like implementing "1 + 1 = 2" in PaddlePaddle
# and fetch z, like implementing "1 + 1 = 2" in PaddlePaddle
feed_data = np.ones(shape=[3, 2, 1], dtype=np.float32)
feed_data = np.ones(shape=[3, 2, 1], dtype=np.float32)
...
...
python/paddle/fluid/tests/unittests/test_erf_op.py
浏览文件 @
9bcfc1a8
...
@@ -61,7 +61,7 @@ class TestErfLayer(unittest.TestCase):
...
@@ -61,7 +61,7 @@ class TestErfLayer(unittest.TestCase):
def
test_name
(
self
):
def
test_name
(
self
):
with
fluid
.
program_guard
(
fluid
.
Program
()):
with
fluid
.
program_guard
(
fluid
.
Program
()):
x
=
paddle
.
nn
.
data
(
'x'
,
[
3
,
4
])
x
=
paddle
.
static
.
data
(
'x'
,
[
3
,
4
])
y
=
paddle
.
erf
(
x
,
name
=
'erf'
)
y
=
paddle
.
erf
(
x
,
name
=
'erf'
)
self
.
assertTrue
(
'erf'
in
y
.
name
)
self
.
assertTrue
(
'erf'
in
y
.
name
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录