Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0b96793e
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2305
Star
20932
Fork
5423
代码
文件
提交
分支
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看板
未验证
提交
0b96793e
编写于
4月 06, 2022
作者:
X
xiongkun
提交者:
GitHub
4月 06, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Dygraph TestsFix] Test some tests in new dygraph final_state mode. (#41363)
* fix less than * fix some tests * fix additional 3 unittest case
上级
e0d12b8d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
10 deletion
+22
-10
paddle/phi/kernels/gpu/full_kernel.cu
paddle/phi/kernels/gpu/full_kernel.cu
+1
-0
python/paddle/distributed/spawn.py
python/paddle/distributed/spawn.py
+3
-2
python/paddle/tensor/logic.py
python/paddle/tensor/logic.py
+6
-6
python/paddle/tensor/math.py
python/paddle/tensor/math.py
+1
-0
python/paddle/utils/code_gen/api.yaml
python/paddle/utils/code_gen/api.yaml
+2
-2
python/paddle/utils/code_gen/backward.yaml
python/paddle/utils/code_gen/backward.yaml
+9
-0
未找到文件。
paddle/phi/kernels/gpu/full_kernel.cu
浏览文件 @
0b96793e
...
...
@@ -132,6 +132,7 @@ PD_REGISTER_KERNEL(full_like,
phi
::
FullLikeKernel
,
float
,
double
,
uint8_t
,
int16_t
,
int
,
int64_t
,
...
...
python/paddle/distributed/spawn.py
浏览文件 @
0b96793e
...
...
@@ -452,11 +452,12 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options):
def train(print_result=False):
# 1. initialize parallel environment
dist.init_parallel_env()
group = dist.init_parallel_env()
process_group = group.process_group if group else None
# 2. create data parallel layer & optimizer
layer = LinearNet()
dp_layer = paddle.DataParallel(layer)
dp_layer = paddle.DataParallel(layer
, process_group=process_group
)
loss_fn = nn.MSELoss()
adam = opt.Adam(
...
...
python/paddle/tensor/logic.py
浏览文件 @
0b96793e
...
...
@@ -182,8 +182,8 @@ def equal(x, y, name=None):
y
=
full
(
shape
=
[
1
],
dtype
=
x
.
dtype
,
fill_value
=
y
)
if
in_dygraph_mode
():
axis
=
-
1
return
_C_ops
.
final_state_equal
(
x
,
y
,
axis
)
default_
axis
=
-
1
return
_C_ops
.
final_state_equal
(
x
,
y
,
default_
axis
)
else
:
if
_in_legacy_dygraph
():
return
_C_ops
.
equal
(
x
,
y
)
...
...
@@ -232,8 +232,8 @@ def greater_equal(x, y, name=None):
print(result1) # result1 = [True False True]
"""
if
in_dygraph_mode
():
axis
=
-
1
return
_C_ops
.
final_state_greater_equal
(
x
,
y
,
axis
)
default_
axis
=
-
1
return
_C_ops
.
final_state_greater_equal
(
x
,
y
,
default_
axis
)
else
:
if
_in_legacy_dygraph
():
return
_C_ops
.
greater_equal
(
x
,
y
)
...
...
@@ -383,8 +383,8 @@ def less_than(x, y, name=None):
print(result1) # result1 = [False True False]
"""
if
in_dygraph_mode
():
axis
=
-
1
return
_C_ops
.
final_state_less_than
(
x
,
y
,
axis
)
default_
axis
=
-
1
return
_C_ops
.
final_state_less_than
(
x
,
y
,
default_
axis
)
else
:
if
_in_legacy_dygraph
():
return
_C_ops
.
less_than
(
x
,
y
)
...
...
python/paddle/tensor/math.py
浏览文件 @
0b96793e
...
...
@@ -2668,6 +2668,7 @@ def cumsum(x, axis=None, dtype=None, name=None):
x
=
cast
(
x
,
dtype
)
if
in_dygraph_mode
():
if
axis
is
None
:
axis
=
-
1
return
_C_ops
.
final_state_cumsum
(
x
,
axis
,
flatten
,
False
,
False
)
if
_in_legacy_dygraph
():
if
axis
is
None
:
...
...
python/paddle/utils/code_gen/api.yaml
浏览文件 @
0b96793e
...
...
@@ -419,14 +419,14 @@
func
:
cumprod
backward
:
cumprod_grad
# cumsum
-
api
:
cumsum
args
:
(Tensor x, int axis, bool flatten, bool exclusive, bool reverse)
output
:
Tensor
output
:
Tensor
(out)
infer_meta
:
func
:
CumsumInferMeta
kernel
:
func
:
cumsum
backward
:
cumsum_grad
-
api
:
depthwise_conv2d_transpose
args
:
(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
...
...
python/paddle/utils/code_gen/backward.yaml
浏览文件 @
0b96793e
...
...
@@ -286,6 +286,15 @@
kernel
:
func
:
cumprod_grad
-
backward_api
:
cumsum_grad
forward
:
cumsum(Tensor x, int axis, bool flatten, bool exclusive, bool reverse) -> Tensor(out)
infer_meta
:
func
:
UnchangedInferMeta
param
:
[
x
]
args
:
(Tensor out_grad, int axis, bool flatten, bool exclusive, bool reverse)
output
:
Tensor(x_grad)
invoke
:
cumsum(out_grad, axis, flatten, exclusive, !reverse)
-
backward_api
:
depthwise_conv2d_transpose_grad
forward
:
depthwise_conv2d_transpose(Tensor x, Tensor filter, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format) -> Tensor(out)
args
:
(Tensor x, Tensor filter, Tensor out_grad, int[] strides, int[] paddings, int[] output_padding, int[] output_size, str padding_algorithm, int groups, int[] dilations, str data_format)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录