Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
a5ce60b8
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看板
未验证
提交
a5ce60b8
编写于
12月 16, 2022
作者:
H
HongyuJia
提交者:
GitHub
12月 16, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean elementwise doc (#49004)
上级
11c43b0b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
15 deletion
+15
-15
python/paddle/distributed/fleet/metrics/metric.py
python/paddle/distributed/fleet/metrics/metric.py
+5
-5
python/paddle/fluid/data_feeder.py
python/paddle/fluid/data_feeder.py
+1
-1
python/paddle/fluid/incubate/fleet/utils/fleet_util.py
python/paddle/fluid/incubate/fleet/utils/fleet_util.py
+3
-3
python/paddle/fluid/io.py
python/paddle/fluid/io.py
+3
-3
python/paddle/fluid/layers/control_flow.py
python/paddle/fluid/layers/control_flow.py
+2
-2
python/paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py
...on/paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py
+1
-1
未找到文件。
python/paddle/distributed/fleet/metrics/metric.py
浏览文件 @
a5ce60b8
...
...
@@ -41,7 +41,7 @@ def sum(input, scope=None, util=None):
input = fluid.layers.cast(some_input, dtype='float32')
cnt = paddle.sum(input)
global_cnt = paddle.static.create_global_var(persistable=True, dtype='float32', shape=[1], value=0)
tmp =
fluid.layers.elementwise_
add(cnt, global_cnt)
tmp =
paddle.
add(cnt, global_cnt)
fluid.layers.assign(tmp, global_cnt)
# in train.py, after train or infer
...
...
@@ -121,7 +121,7 @@ def min(input, scope=None, util=None):
input = fluid.layers.cast(some_input, dtype='float32')
cnt = paddle.sum(input)
global_cnt = paddle.static.create_global_var(persistable=True, dtype='float32', shape=[1], value=0)
tmp =
fluid.layers.elementwise_min
(cnt, global_cnt)
tmp =
paddle.minimum
(cnt, global_cnt)
fluid.layers.assign(tmp, global_cnt)
# in train.py, after train or infer
...
...
@@ -161,7 +161,7 @@ def auc(stat_pos, stat_neg, scope=None, util=None):
# in model.py
similarity_norm = fluid.layers.sigmoid(fluid.layers.clip(output, min=-15.0, max=15.0))
binary_predict = fluid.layers.concat(
input=[
fluid.layers.elementwise_sub
(fluid.layers.ceil(similarity_norm), similarity_norm), similarity_norm], axis=1)
input=[
paddle.subtract
(fluid.layers.ceil(similarity_norm), similarity_norm), similarity_norm], axis=1)
self.auc, batch_auc, [batch_stat_pos, batch_stat_neg, stat_pos, stat_neg] =
paddle.static.auc(input=binary_predict, label=label, curve='ROC', num_thresholds=4096)
...
...
@@ -396,11 +396,11 @@ def acc(correct, total, scope=None, util=None):
acc = fluid.layers.acc(predict, label, k=1, correct=correct, total=total)
global_correct = paddle.static.create_global_var(persistable=True, dtype='float32', shape=[1], value=0)
tmp1 =
fluid.layers.elementwise_min
(correct, global_correct)
tmp1 =
paddle.minimum
(correct, global_correct)
fluid.layers.assign(tmp1, global_correct)
global_total = paddle.static.create_global_var(persistable=True, dtype='float32', shape=[1], value=0)
tmp2 =
fluid.layers.elementwise_min
(total, global_total)
tmp2 =
paddle.minimum
(total, global_total)
fluid.layers.assign(tmp2, global_total)
# in train.py, after train or infer
...
...
python/paddle/fluid/data_feeder.py
浏览文件 @
a5ce60b8
...
...
@@ -485,7 +485,7 @@ class DataFeeder:
x = fluid.data(name='x', shape=[None, 2, 2])
y = fluid.data(name='y', shape=[None, 2, 2], dtype='float32')
z =
fluid.layers.elementwise_
add(x, y)
z =
paddle.
add(x, y)
feeder = fluid.DataFeeder(['x','y'], fluid.CPUPlace())
place_num = 2
...
...
python/paddle/fluid/incubate/fleet/utils/fleet_util.py
浏览文件 @
a5ce60b8
...
...
@@ -188,7 +188,7 @@ class FleetUtil:
similarity_norm = fluid.layers.sigmoid(fluid.layers.clip(\
emb, min=-15.0, max=15.0), name="similarity_norm")\
binary_predict = fluid.layers.concat(input=[\
fluid.layers.elementwise_sub
(\
paddle.subtract
(\
fluid.layers.ceil(similarity_norm), similarity_norm),\
similarity_norm], axis=1)
auc, batch_auc, [batch_stat_pos, batch_stat_neg, stat_pos, \
...
...
@@ -1377,7 +1377,7 @@ class FleetUtil:
similarity_norm = fluid.layers.sigmoid(fluid.layers.clip(\
emb, min=-15.0, max=15.0), name="similarity_norm")\
binary_predict = fluid.layers.concat(input=[\
fluid.layers.elementwise_sub
(\
paddle.subtract
(\
fluid.layers.ceil(similarity_norm), similarity_norm),\
similarity_norm], axis=1)
auc, batch_auc, [batch_stat_pos, batch_stat_neg, stat_pos, \
...
...
@@ -1577,7 +1577,7 @@ class FleetUtil:
similarity_norm = fluid.layers.sigmoid(fluid.layers.clip(\
emb, min=-15.0, max=15.0), name="similarity_norm")\
binary_predict = fluid.layers.concat(input=[\
fluid.layers.elementwise_sub
(\
paddle.subtract
(\
fluid.layers.ceil(similarity_norm), similarity_norm),\
similarity_norm], axis=1)
auc, batch_auc, [batch_stat_pos, batch_stat_neg, stat_pos, \
...
...
python/paddle/fluid/io.py
浏览文件 @
a5ce60b8
...
...
@@ -359,7 +359,7 @@ def save_vars(
w = paddle.create_parameter(shape=[784, 200], dtype='float32', name='fc_w')
b = paddle.create_parameter(shape=[200], dtype='float32', name='fc_b')
hidden_w = paddle.matmul(x=data, y=w)
hidden_b =
fluid.layers.elementwise_
add(hidden_w, b)
hidden_b =
paddle.
add(hidden_w, b)
place = fluid.CPUPlace()
exe = fluid.Executor(place)
exe.run(startup_prog)
...
...
@@ -834,7 +834,7 @@ def load_vars(
w = paddle.create_parameter(shape=[784, 200], dtype='float32', name='fc_w')
b = paddle.create_parameter(shape=[200], dtype='float32', name='fc_b')
hidden_w = paddle.matmul(x=data, y=w)
hidden_b =
fluid.layers.elementwise_
add(hidden_w, b)
hidden_b =
paddle.
add(hidden_w, b)
place = fluid.CPUPlace()
exe = fluid.Executor(place)
exe.run(startup_prog)
...
...
@@ -1602,7 +1602,7 @@ def load_inference_model(
w = paddle.create_parameter(shape=[784, 200], dtype='float32')
b = paddle.create_parameter(shape=[200], dtype='float32')
hidden_w = paddle.matmul(x=data, y=w)
hidden_b =
fluid.layers.elementwise_
add(hidden_w, b)
hidden_b =
paddle.
add(hidden_w, b)
place = fluid.CPUPlace()
exe = fluid.Executor(place)
exe.run(startup_prog)
...
...
python/paddle/fluid/layers/control_flow.py
浏览文件 @
a5ce60b8
...
...
@@ -1088,10 +1088,10 @@ class While:
cond = paddle.less_than(x=i, y=loop_len)
while_op = fluid.layers.While(cond=cond)
with while_op.block():
sums_tensor =
fluid.layers.elementwise_
add(x=data, y=data)
sums_tensor =
paddle.
add(x=data, y=data)
fluid.layers.assign(sums_tensor, sums) # Update the value of sums_tensor defined in While to the sums which defined outside of While through layers.assign
i = paddle.increment(x=i, value=1)
data =
fluid.layers.elementwise_
add(x=data, y=one)
data =
paddle.
add(x=data, y=one)
paddle.assign(paddle.less_than(x=i, y=loop_len), cond)
feed_data = np.ones(1).astype('float32')
...
...
python/paddle/fluid/tests/unittests/xpu/test_assign_op_xpu.py
浏览文件 @
a5ce60b8
...
...
@@ -47,7 +47,7 @@ class TestAssignOpWithLoDTensorArray(unittest.TestCase):
x.stop_gradient = False
y = fluid.layers.fill_constant(
shape=[100, 10], dtype='float32', value=1)
z =
fluid.layers.elementwise_
add(x=x, y=y)
z =
paddle.
add(x=x, y=y)
i = fluid.layers.fill_constant(shape=[1], dtype='int64', value=0)
init_array = paddle.tensor.array_write(x=z, i=i)
array = fluid.layers.assign(init_array)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录