Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【fluid api clear】Move batch norm1 #47965

Merged
merged 37 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
75ddc3b
modify slice infershape
xiaoguoguo626807 Sep 7, 2022
7ef5686
code style
xiaoguoguo626807 Sep 7, 2022
df0199d
modify slice_unittest
xiaoguoguo626807 Sep 8, 2022
d182134
temp fix
xiaoguoguo626807 Sep 13, 2022
bf7bbf3
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Sep 14, 2022
6454f5e
fix conflict
xiaoguoguo626807 Sep 28, 2022
3cece5a
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
xiaoguoguo626807 Nov 14, 2022
d2b2291
batch_norm api move
xiaoguoguo626807 Nov 14, 2022
5cc48a5
code_style
xiaoguoguo626807 Nov 14, 2022
85c284f
codestyle
xiaoguoguo626807 Nov 15, 2022
b010ded
ci_static
xiaoguoguo626807 Nov 15, 2022
0993658
add __init__
xiaoguoguo626807 Nov 15, 2022
7bdfac2
reset other change
xiaoguoguo626807 Nov 15, 2022
0f1165a
fix lots of conflict
xiaoguoguo626807 Nov 25, 2022
a8a1de9
revert .cc
xiaoguoguo626807 Nov 25, 2022
c0b9b50
add import batchnorm
xiaoguoguo626807 Nov 28, 2022
ccfc6fb
conflict and revert
xiaoguoguo626807 Nov 28, 2022
5e9f4a8
fix conflict
xiaoguoguo626807 Nov 28, 2022
393a443
fix bug
xiaoguoguo626807 Nov 28, 2022
51638d4
fix conflict
xiaoguoguo626807 Nov 29, 2022
a36bd80
fix conflict
xiaoguoguo626807 Nov 29, 2022
089fd37
fix third conflict one day
xiaoguoguo626807 Nov 29, 2022
e65f615
fix third conflict one day
xiaoguoguo626807 Nov 30, 2022
60fa0b0
fix conflict
xiaoguoguo626807 Nov 30, 2022
8ceb5c6
fix conflict bug
xiaoguoguo626807 Dec 1, 2022
ec2ba48
fix conflict bug
xiaoguoguo626807 Dec 1, 2022
c56c512
modify api
xiaoguoguo626807 Dec 1, 2022
0323491
fix conflict
xiaoguoguo626807 Dec 1, 2022
ac0d02a
code_style
xiaoguoguo626807 Dec 2, 2022
b362074
fix conflict ^&^
xiaoguoguo626807 Dec 2, 2022
98cc2b2
fix conflict *&*
xiaoguoguo626807 Dec 2, 2022
907fc01
modify doc
xiaoguoguo626807 Dec 5, 2022
ecc29d3
fix conflict *>*
xiaoguoguo626807 Dec 5, 2022
c2a5e01
add lost doc stable
xiaoguoguo626807 Dec 5, 2022
733ae13
fix conflict bug
xiaoguoguo626807 Dec 5, 2022
f04e4d3
fix confilct ^2^
xiaoguoguo626807 Dec 6, 2022
e6de733
ci lack of gpu
xiaoguoguo626807 Dec 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion python/paddle/fluid/contrib/layers/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1963,8 +1963,11 @@ def fused_bn_add_act(
Examples:
.. code-block:: python

import paddle
import paddle.fluid as fluid

paddle.enable_static()
# required: gpu
def build_program(main_program, startup_program):
with fluid.program_guard(main_program, startup_program):
x = fluid.layers.data(name='x', shape=[1, 28, 28], dtype='float32')
Expand All @@ -1987,7 +1990,7 @@ def build_program(main_program, startup_program):
act=None,
bias_attr=False,
data_format='NHWC')
bn = fluid.layers.batch_norm(
bn = paddle.static.nn.batch_norm(
input=conv1_1,
act=None,
data_layout='NHWC')
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/contrib/slim/tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def conv_block():
pool_stride=2,
act="relu",
)
conv_pool_1 = fluid.layers.batch_norm(conv_pool_1)
conv_pool_1 = paddle.static.nn.batch_norm(conv_pool_1)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def conv_net(img, label):
pool_stride=2,
act="relu",
)
conv_pool_1 = fluid.layers.batch_norm(conv_pool_1)
conv_pool_1 = paddle.static.nn.batch_norm(conv_pool_1)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def conv_bn_layer(
act=None,
bias_attr=bias_attr,
)
return fluid.layers.batch_norm(input=tmp, act=act)
return paddle.static.nn.batch_norm(input=tmp, act=act)

data = fluid.layers.data(
name='image',
Expand Down Expand Up @@ -102,7 +102,7 @@ def conv_net(img, label, quant_skip_pattern):
pool_type='max',
act="relu",
)
conv_pool_1 = fluid.layers.batch_norm(conv_pool_1)
conv_pool_1 = paddle.static.nn.batch_norm(conv_pool_1)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
Expand Down Expand Up @@ -712,7 +712,7 @@ def conv_bn_layer(
act=None,
bias_attr=bias_attr,
)
return fluid.layers.batch_norm(input=tmp, act=act)
return paddle.static.nn.batch_norm(input=tmp, act=act)

data1 = fluid.layers.data(name='image', shape=[1, 32, 32], dtype='float32')
data2 = fluid.layers.data(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def conv_net(img, label):
pool_type='max',
act="relu",
)
conv_pool_1 = fluid.layers.batch_norm(conv_pool_1)
conv_pool_1 = paddle.static.nn.batch_norm(conv_pool_1)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def conv_net(img, label):
pool_type='max',
act="relu",
)
conv_pool_1 = fluid.layers.batch_norm(conv_pool_1)
conv_pool_1 = paddle.static.nn.batch_norm(conv_pool_1)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def conv_bn_layer(
act=None,
bias_attr=bias_attr,
)
return fluid.layers.batch_norm(input=tmp, act=act)
return paddle.static.nn.batch_norm(input=tmp, act=act)

def shortcut(input, ch_in, ch_out, stride):
if ch_in != ch_out:
Expand Down Expand Up @@ -97,7 +97,7 @@ def conv_block(input, num_filter, groups, dropouts):

drop = fluid.layers.dropout(x=conv5, dropout_prob=0.5)
fc1 = fluid.layers.fc(input=drop, size=4096, act=None)
bn = fluid.layers.batch_norm(input=fc1, act='relu')
bn = paddle.static.nn.batch_norm(input=fc1, act='relu')
drop2 = fluid.layers.dropout(x=bn, dropout_prob=0.5)
fc2 = fluid.layers.fc(input=drop2, size=4096, act=None)
return fc2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def conv_bn_layer(
act=None,
bias_attr=bias_attr,
)
return fluid.layers.batch_norm(input=tmp, act=act)
return paddle.static.nn.batch_norm(input=tmp, act=act)

def shortcut(input, ch_in, ch_out, stride):
if ch_in != ch_out:
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/fluid/contrib/tests/test_quantize_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def conv_bn_layer(
act=None,
bias_attr=bias_attr,
)
return fluid.layers.batch_norm(input=tmp, act=act)
return paddle.static.nn.batch_norm(input=tmp, act=act)

data = fluid.layers.data(name='image', shape=[1, 32, 32], dtype='float32')
label = fluid.layers.data(name='label', shape=[1], dtype='int64')
Expand All @@ -72,7 +72,7 @@ def conv_net(img, label):
pool_stride=2,
act="relu",
)
conv_pool_1 = fluid.layers.batch_norm(conv_pool_1)
conv_pool_1 = paddle.static.nn.batch_norm(conv_pool_1)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
Expand Down
Loading