Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
c3974d96
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c3974d96
编写于
7月 30, 2021
作者:
L
lelelelelez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix function-redefined
上级
44e4d57b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
11 deletion
+5
-11
python/paddle/fluid/tests/unittests/test_bicubic_interp_v2_op.py
...paddle/fluid/tests/unittests/test_bicubic_interp_v2_op.py
+2
-2
python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py
...n/paddle/fluid/tests/unittests/test_cross_entropy_loss.py
+0
-6
python/paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py
.../paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py
+1
-1
python/paddle/fluid/tests/unittests/test_linspace.py
python/paddle/fluid/tests/unittests/test_linspace.py
+2
-2
未找到文件。
python/paddle/fluid/tests/unittests/test_bicubic_interp_v2_op.py
浏览文件 @
c3974d96
...
@@ -517,7 +517,7 @@ class TestBicubicOpError(unittest.TestCase):
...
@@ -517,7 +517,7 @@ class TestBicubicOpError(unittest.TestCase):
out
=
interpolate
(
out
=
interpolate
(
x
,
size
=
{
2
,
2
},
mode
=
'bicubic'
,
align_corners
=
False
)
x
,
size
=
{
2
,
2
},
mode
=
'bicubic'
,
align_corners
=
False
)
def
test_input_shape
():
def
test_input_shape
_1
():
x
=
fluid
.
data
(
name
=
"x"
,
shape
=
[
2
,
1
,
0
,
0
],
dtype
=
"float32"
)
x
=
fluid
.
data
(
name
=
"x"
,
shape
=
[
2
,
1
,
0
,
0
],
dtype
=
"float32"
)
out
=
interpolate
(
out
=
interpolate
(
x
,
size
=
[
3
,
3
],
mode
=
"bicubic"
,
align_corners
=
False
)
x
,
size
=
[
3
,
3
],
mode
=
"bicubic"
,
align_corners
=
False
)
...
@@ -539,7 +539,7 @@ class TestBicubicOpError(unittest.TestCase):
...
@@ -539,7 +539,7 @@ class TestBicubicOpError(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
test_size_and_scale
)
self
.
assertRaises
(
ValueError
,
test_size_and_scale
)
self
.
assertRaises
(
ValueError
,
test_size_and_scale2
)
self
.
assertRaises
(
ValueError
,
test_size_and_scale2
)
self
.
assertRaises
(
TypeError
,
test_size_type
)
self
.
assertRaises
(
TypeError
,
test_size_type
)
self
.
assertRaises
(
ValueError
,
test_input_shape
)
self
.
assertRaises
(
ValueError
,
test_input_shape
_1
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
python/paddle/fluid/tests/unittests/test_cross_entropy_loss.py
浏览文件 @
c3974d96
...
@@ -23,12 +23,6 @@ from test_softmax_with_cross_entropy_op import cross_entropy
...
@@ -23,12 +23,6 @@ from test_softmax_with_cross_entropy_op import cross_entropy
from
paddle.fluid
import
Program
,
program_guard
from
paddle.fluid
import
Program
,
program_guard
def
stable_softmax
(
x
):
shiftx
=
(
x
-
np
.
max
(
x
)).
clip
(
-
64.
)
exps
=
np
.
exp
(
shiftx
)
return
exps
/
np
.
sum
(
exps
)
def
log_softmax
(
x
,
axis
=-
1
):
def
log_softmax
(
x
,
axis
=-
1
):
softmax_out
=
np
.
apply_along_axis
(
stable_softmax
,
axis
,
x
)
softmax_out
=
np
.
apply_along_axis
(
stable_softmax
,
axis
,
x
)
return
np
.
log
(
softmax_out
)
return
np
.
log
(
softmax_out
)
...
...
python/paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py
浏览文件 @
c3974d96
...
@@ -418,7 +418,7 @@ class TestGlooWithCloudRoleMaker(unittest.TestCase):
...
@@ -418,7 +418,7 @@ class TestGlooWithCloudRoleMaker(unittest.TestCase):
self
.
clean
(
tmp
)
self
.
clean
(
tmp
)
class
TestGlooWithCloudRoleMaker
(
unittest
.
TestCase
):
class
TestGlooWithCloudRoleMaker
1
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"1"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"1"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
...
...
python/paddle/fluid/tests/unittests/test_linspace.py
浏览文件 @
c3974d96
...
@@ -133,10 +133,10 @@ class TestLinspaceOpError(unittest.TestCase):
...
@@ -133,10 +133,10 @@ class TestLinspaceOpError(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
test_dtype
)
self
.
assertRaises
(
TypeError
,
test_dtype
)
def
test_dtype
():
def
test_dtype
1
():
fluid
.
layers
.
linspace
(
0
,
10
,
1.33
,
dtype
=
"int32"
)
fluid
.
layers
.
linspace
(
0
,
10
,
1.33
,
dtype
=
"int32"
)
self
.
assertRaises
(
TypeError
,
test_dtype
)
self
.
assertRaises
(
TypeError
,
test_dtype
1
)
def
test_start_type
():
def
test_start_type
():
fluid
.
layers
.
linspace
([
0
],
10
,
1
,
dtype
=
"float32"
)
fluid
.
layers
.
linspace
([
0
],
10
,
1
,
dtype
=
"float32"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录