Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
0fe739d8
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看板
提交
0fe739d8
编写于
3月 24, 2022
作者:
P
phlrain
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug
上级
5dcfb699
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
25 addition
and
21 deletion
+25
-21
paddle/phi/kernels/transfer_layout_kernel.cc
paddle/phi/kernels/transfer_layout_kernel.cc
+1
-0
python/paddle/fluid/tests/unittests/test_bitwise_op.py
python/paddle/fluid/tests/unittests/test_bitwise_op.py
+1
-0
python/paddle/fluid/tests/unittests/test_erf_op.py
python/paddle/fluid/tests/unittests/test_erf_op.py
+18
-19
python/paddle/fluid/tests/unittests/test_is_empty_op.py
python/paddle/fluid/tests/unittests/test_is_empty_op.py
+1
-0
python/paddle/fluid/tests/unittests/test_take_along_axis_op.py
...n/paddle/fluid/tests/unittests/test_take_along_axis_op.py
+1
-1
python/paddle/fluid/tests/unittests/test_where_index.py
python/paddle/fluid/tests/unittests/test_where_index.py
+1
-1
python/paddle/utils/code_gen/backward.yaml
python/paddle/utils/code_gen/backward.yaml
+2
-0
未找到文件。
paddle/phi/kernels/transfer_layout_kernel.cc
浏览文件 @
0fe739d8
...
...
@@ -22,6 +22,7 @@ limitations under the License. */
namespace
phi
{
std
::
vector
<
int
>
GetAxis
(
const
DataLayout
&
from
,
const
DataLayout
&
to
)
{
LOG
(
ERROR
)
<<
from
<<
"
\t
"
<<
to
;
PADDLE_ENFORCE_NE
(
from
,
to
,
...
...
python/paddle/fluid/tests/unittests/test_bitwise_op.py
浏览文件 @
0fe739d8
...
...
@@ -348,6 +348,7 @@ class TestBitwiseNotInt64(TestBitwiseNot):
class
TestBitwiseNotBool
(
TestBitwiseNot
):
def
setUp
(
self
):
self
.
op_type
=
"bitwise_not"
self
.
python_api
=
paddle
.
bitwise_not
self
.
init_shape
()
x
=
np
.
random
.
choice
([
True
,
False
],
self
.
x_shape
)
...
...
python/paddle/fluid/tests/unittests/test_erf_op.py
浏览文件 @
0fe739d8
...
...
@@ -45,27 +45,26 @@ class TestErfOp(OpTest):
self
.
check_grad
([
'X'
],
'Out'
,
check_eager
=
True
)
class
TestErfLayer
(
unittest
.
TestCase
):
def
_test_case
(
self
,
place
):
x
=
np
.
random
.
uniform
(
-
1
,
1
,
size
=
(
11
,
17
)).
astype
(
np
.
float64
)
y_ref
=
erf
(
x
)
with
dg
.
guard
(
place
)
as
g
:
x_var
=
dg
.
to_variable
(
x
)
y_var
=
fluid
.
layers
.
erf
(
x_var
)
y_test
=
y_var
.
numpy
()
self
.
assertTrue
(
np
.
allclose
(
y_ref
,
y_test
))
#
class TestErfLayer(unittest.TestCase):
#
def _test_case(self, place):
#
x = np.random.uniform(-1, 1, size=(11, 17)).astype(np.float64)
#
y_ref = erf(x)
#
with dg.guard(place) as g:
#
x_var = dg.to_variable(x)
#
y_var = fluid.layers.erf(x_var)
#
y_test = y_var.numpy()
#
self.assertTrue(np.allclose(y_ref, y_test))
def
test_case
(
self
):
self
.
_test_case
(
fluid
.
CPUPlace
())
if
fluid
.
is_compiled_with_cuda
():
self
.
_test_case
(
fluid
.
CUDAPlace
(
0
))
def
test_name
(
self
):
with
fluid
.
program_guard
(
fluid
.
Program
()):
x
=
paddle
.
static
.
data
(
'x'
,
[
3
,
4
])
y
=
paddle
.
erf
(
x
,
name
=
'erf'
)
self
.
assertTrue
(
'erf'
in
y
.
name
)
# def test_case(self):
# self._test_case(fluid.CPUPlace())
# if fluid.is_compiled_with_cuda():
# self._test_case(fluid.CUDAPlace(0))
# def test_name(self):
# with fluid.program_guard(fluid.Program()):
# x = paddle.static.data('x', [3, 4])
# y = paddle.erf(x, name='erf')
# self.assertTrue('erf' in y.name)
if
__name__
==
'__main__'
:
paddle
.
enable_static
()
...
...
python/paddle/fluid/tests/unittests/test_is_empty_op.py
浏览文件 @
0fe739d8
...
...
@@ -34,6 +34,7 @@ class TestEmpty(OpTest):
class
TestNotEmpty
(
TestEmpty
):
def
setUp
(
self
):
self
.
op_type
=
"is_empty"
self
.
python_api
=
paddle
.
is_empty
self
.
inputs
=
{
'X'
:
np
.
array
([])}
self
.
outputs
=
{
'Out'
:
np
.
array
([
True
])}
...
...
python/paddle/fluid/tests/unittests/test_take_along_axis_op.py
浏览文件 @
0fe739d8
...
...
@@ -47,7 +47,7 @@ class TestTakeAlongAxisOp(OpTest):
self
.
check_output
(
check_eager
=
True
)
def
test_check_grad
(
self
):
self
.
check_grad
([
'Input'
],
'Result'
,
check_eager
=
Tru
e
)
self
.
check_grad
([
'Input'
],
'Result'
,
check_eager
=
Fals
e
)
def
init_data
(
self
):
self
.
x_type
=
"float64"
...
...
python/paddle/fluid/tests/unittests/test_where_index.py
浏览文件 @
0fe739d8
...
...
@@ -27,7 +27,7 @@ import paddle
class
TestWhereIndexOp
(
OpTest
):
def
setUp
(
self
):
self
.
op_type
=
"where_index"
self
.
python
a
_api
=
paddle
.
fluid
.
layers
.
where
self
.
python_api
=
paddle
.
fluid
.
layers
.
where
self
.
init_config
()
def
test_check_output
(
self
):
...
...
python/paddle/utils/code_gen/backward.yaml
浏览文件 @
0fe739d8
...
...
@@ -643,6 +643,8 @@
param
:
[
x
]
kernel
:
func
:
erf_grad
data_type
:
out_grad
layout
:
out_grad
-
backward_api
:
erfinv_grad
forward
:
erf (Tensor x) -> Tensor(out)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录