Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
2a191d8f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
未验证
提交
2a191d8f
编写于
7月 30, 2020
作者:
L
liym27
提交者:
GitHub
7月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix error in convert_dtype: ValueError->TypeError and polish message (#25788)
上级
452be895
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
5 deletion
+5
-5
python/paddle/fluid/data_feeder.py
python/paddle/fluid/data_feeder.py
+2
-2
python/paddle/fluid/tests/unittests/test_create_global_var.py
...on/paddle/fluid/tests/unittests/test_create_global_var.py
+1
-1
python/paddle/fluid/tests/unittests/test_fill_constant_op.py
python/paddle/fluid/tests/unittests/test_fill_constant_op.py
+1
-1
python/paddle/fluid/tests/unittests/test_full_op.py
python/paddle/fluid/tests/unittests/test_full_op.py
+1
-1
未找到文件。
python/paddle/fluid/data_feeder.py
浏览文件 @
2a191d8f
...
@@ -66,9 +66,9 @@ def convert_dtype(dtype):
...
@@ -66,9 +66,9 @@ def convert_dtype(dtype):
# may still be a long-lasting problem.
# may still be a long-lasting problem.
return
str
(
dtype
)
return
str
(
dtype
)
raise
Valu
eError
(
raise
Typ
eError
(
"dtype must be any of [bool, float16, float32, float64, int8, int16, "
"dtype must be any of [bool, float16, float32, float64, int8, int16, "
"int32, int64, uint8]
"
)
"int32, int64, uint8]
, but received %s"
%
dtype
)
def
check_variable_and_dtype
(
input
,
def
check_variable_and_dtype
(
input
,
...
...
python/paddle/fluid/tests/unittests/test_create_global_var.py
浏览文件 @
2a191d8f
...
@@ -38,7 +38,7 @@ class TestCreateGlobalVarError(unittest.TestCase):
...
@@ -38,7 +38,7 @@ class TestCreateGlobalVarError(unittest.TestCase):
def
test_dtype
():
def
test_dtype
():
fluid
.
layers
.
create_global_var
([
1
,
2
,
3
],
2.0
,
np
.
complex128
)
fluid
.
layers
.
create_global_var
([
1
,
2
,
3
],
2.0
,
np
.
complex128
)
self
.
assertRaises
(
Valu
eError
,
test_dtype
)
self
.
assertRaises
(
Typ
eError
,
test_dtype
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
python/paddle/fluid/tests/unittests/test_fill_constant_op.py
浏览文件 @
2a191d8f
...
@@ -297,7 +297,7 @@ class TestFillConstantOpError(unittest.TestCase):
...
@@ -297,7 +297,7 @@ class TestFillConstantOpError(unittest.TestCase):
#for ci coverage
#for ci coverage
x1
=
fluid
.
layers
.
data
(
name
=
'x1'
,
shape
=
[
1
],
dtype
=
"int16"
)
x1
=
fluid
.
layers
.
data
(
name
=
'x1'
,
shape
=
[
1
],
dtype
=
"int16"
)
self
.
assertRaises
(
self
.
assertRaises
(
Valu
eError
,
Typ
eError
,
fluid
.
layers
.
fill_constant
,
fluid
.
layers
.
fill_constant
,
shape
=
[
1
],
shape
=
[
1
],
value
=
5
,
value
=
5
,
...
...
python/paddle/fluid/tests/unittests/test_full_op.py
浏览文件 @
2a191d8f
...
@@ -81,7 +81,7 @@ class TestFullOpError(unittest.TestCase):
...
@@ -81,7 +81,7 @@ class TestFullOpError(unittest.TestCase):
with
program_guard
(
Program
(),
Program
()):
with
program_guard
(
Program
(),
Program
()):
#for ci coverage
#for ci coverage
self
.
assertRaises
(
self
.
assertRaises
(
Valu
eError
,
paddle
.
full
,
shape
=
[
1
],
fill_value
=
5
,
dtype
=
'uint4'
)
Typ
eError
,
paddle
.
full
,
shape
=
[
1
],
fill_value
=
5
,
dtype
=
'uint4'
)
# The argument dtype of full must be one of bool, float16,
# The argument dtype of full must be one of bool, float16,
#float32, float64, int32 or int64
#float32, float64, int32 or int64
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录