Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
8a69292b
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
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看板
未验证
提交
8a69292b
编写于
1月 28, 2023
作者:
G
GGBond8488
提交者:
GitHub
1月 28, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【unitest fix】fix xpu unitest error (#50036)
* fix xpu unitest error * fix xpu unitest error
上级
7a0b0dab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
6 deletion
+6
-6
python/paddle/fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py
...dle/fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py
+1
-1
python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py
...paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py
+2
-2
python/paddle/fluid/tests/unittests/xpu/test_index_select_op_xpu.py
...dle/fluid/tests/unittests/xpu/test_index_select_op_xpu.py
+3
-3
未找到文件。
python/paddle/fluid/tests/unittests/xpu/test_expand_as_v2_op_xpu.py
浏览文件 @
8a69292b
...
...
@@ -134,7 +134,7 @@ class TestExpandAsV2API(unittest.TestCase):
def
test_api
(
self
):
input1
=
np
.
random
.
random
([
12
,
14
]).
astype
(
"float32"
)
input2
=
np
.
random
.
random
([
2
,
12
,
14
]).
astype
(
"float32"
)
x
=
paddle
.
static
.
data
(
name
=
'x'
,
shape
=
[
-
1
,
12
,
14
],
dtype
=
"float32"
)
x
=
paddle
.
static
.
data
(
name
=
'x'
,
shape
=
[
12
,
14
],
dtype
=
"float32"
)
y
=
paddle
.
static
.
data
(
name
=
'target_tensor'
,
...
...
python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py
浏览文件 @
8a69292b
...
...
@@ -199,14 +199,14 @@ class TestExpandV2API(unittest.TestCase):
input
=
np
.
random
.
random
([
12
,
14
]).
astype
(
"float32"
)
x
=
paddle
.
static
.
data
(
name
=
'x'
,
shape
=
[
-
1
,
12
,
14
],
shape
=
[
12
,
14
],
dtype
=
"float32"
,
)
positive_2
=
fluid
.
layers
.
fill_constant
([
1
],
"int32"
,
12
)
expand_shape
=
paddle
.
static
.
data
(
name
=
"expand_shape"
,
shape
=
[
-
1
,
2
],
shape
=
[
2
],
dtype
=
"int32"
,
)
...
...
python/paddle/fluid/tests/unittests/xpu/test_index_select_op_xpu.py
浏览文件 @
8a69292b
...
...
@@ -94,7 +94,7 @@ class TestIndexSelectAPI(unittest.TestCase):
[
5.0
,
6.0
,
7.0
,
8.0
],
[
9.0
,
10.0
,
11.0
,
12.0
],
]
)
)
.
astype
(
'float32'
)
self
.
data_index
=
np
.
array
([
0
,
1
,
1
]).
astype
(
'int32'
)
def
test_index_select_api
(
self
):
...
...
@@ -102,7 +102,7 @@ class TestIndexSelectAPI(unittest.TestCase):
# case 1:
with
program_guard
(
Program
(),
Program
()):
x
=
paddle
.
static
.
data
(
name
=
'x'
,
shape
=
[
-
1
,
4
])
x
=
paddle
.
static
.
data
(
name
=
'x'
,
shape
=
[
-
1
,
4
]
,
dtype
=
'float32'
)
index
=
paddle
.
static
.
data
(
name
=
'index'
,
shape
=
[
3
],
dtype
=
'int32'
)
z
=
paddle
.
index_select
(
x
,
index
,
axis
=
1
)
exe
=
fluid
.
Executor
(
fluid
.
XPUPlace
(
0
))
...
...
@@ -118,7 +118,7 @@ class TestIndexSelectAPI(unittest.TestCase):
# case 2:
with
program_guard
(
Program
(),
Program
()):
x
=
paddle
.
static
.
data
(
name
=
'x'
,
shape
=
[
-
1
,
4
])
x
=
paddle
.
static
.
data
(
name
=
'x'
,
shape
=
[
-
1
,
4
]
,
dtype
=
'float32'
)
index
=
paddle
.
static
.
data
(
name
=
'index'
,
shape
=
[
3
],
dtype
=
'int32'
)
z
=
paddle
.
index_select
(
x
,
index
)
exe
=
fluid
.
Executor
(
fluid
.
XPUPlace
(
0
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录