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

remove nets.py in fluid #51717

Merged
merged 35 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
37076c6
remove function sequence_conv_pool
longranger2 Mar 15, 2023
c188174
fix test_glu.py
longranger2 Mar 15, 2023
f4a399b
remove function scaled_dot_product_attention
longranger2 Mar 15, 2023
09950a7
remove function img_conv_group
longranger2 Mar 15, 2023
050f926
remove function simple_img_conv_pool
longranger2 Mar 15, 2023
d461807
delete the nets.py
longranger2 Mar 15, 2023
22a7f00
fix bug
longranger2 Mar 15, 2023
c3ab29a
Merge branch 'PaddlePaddle:develop' into fluid_net
longranger2 Mar 15, 2023
69fa7cc
fix bug
longranger2 Mar 16, 2023
091a1de
fix bug
longranger2 Mar 16, 2023
a70792a
fix bug
longranger2 Mar 17, 2023
b2dc097
fix bug
longranger2 Mar 18, 2023
26ab5a9
Merge branch 'PaddlePaddle:develop' into fluid_net
longranger2 Mar 18, 2023
30f8f0d
fix bug
longranger2 Mar 18, 2023
1845822
Merge branch 'fluid_net' of https://github.com/longranger2/Paddle int…
longranger2 Mar 18, 2023
f6df32a
Merge branch 'PaddlePaddle:develop' into fluid_net
longranger2 Mar 20, 2023
e6242f6
Update test_image_classification.py
longranger2 Mar 21, 2023
64d1490
Update test_recognize_digits.py
longranger2 Mar 21, 2023
a845abb
Update test_recommender_system.py
longranger2 Mar 21, 2023
01c85b4
Update test_image_classification_fp16.py
longranger2 Mar 21, 2023
783000f
Merge branch 'PaddlePaddle:develop' into fluid_net
longranger2 Mar 21, 2023
3c26078
fix bug
longranger2 Apr 5, 2023
847c19e
fix bug
longranger2 Apr 5, 2023
3b90121
fix bug
longranger2 Apr 6, 2023
fad07ef
fix bug
longranger2 Apr 7, 2023
ebcce78
fix conflicts
longranger2 Jun 5, 2023
5f83bea
remove the nets.py in fluid
longranger2 Jun 5, 2023
f784428
Merge branch 'PaddlePaddle:develop' into fluid_net
longranger2 Jun 5, 2023
ce723f5
fix bug
longranger2 Jun 5, 2023
eceae44
fix the codestyle
longranger2 Jun 5, 2023
316f736
Merge branch 'PaddlePaddle:develop' into fluid_net
longranger2 Jun 20, 2023
03f3a31
fix conflict
longranger2 Jun 25, 2023
54be8ec
fix conflict
longranger2 Jun 25, 2023
37c8cd4
fix bug
longranger2 Jun 27, 2023
11daecf
Fix TODO
longranger2 Jun 27, 2023
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
2 changes: 0 additions & 2 deletions python/paddle/fluid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
from . import layers
from . import dygraph
from . import contrib
from . import nets
from . import optimizer
from . import backward
from .backward import gradients
Expand Down Expand Up @@ -124,7 +123,6 @@
'disable_dygraph',
'enable_imperative',
'disable_imperative',
'nets',
'optimizer',
'backward',
'regularizer',
Expand Down
6 changes: 4 additions & 2 deletions python/paddle/fluid/tests/book/notest_understand_sentiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,23 @@
import paddle
import paddle.fluid as fluid

from ..unittests import nets


def convolution_net(
data, label, input_dim, class_dim=2, emb_dim=32, hid_dim=32
):
emb = fluid.layers.embedding(
input=data, size=[input_dim, emb_dim], is_sparse=True
)
conv_3 = fluid.nets.sequence_conv_pool(
conv_3 = nets.sequence_conv_pool(
input=emb,
num_filters=hid_dim,
filter_size=3,
act="tanh",
pool_type="sqrt",
)
conv_4 = fluid.nets.sequence_conv_pool(
conv_4 = nets.sequence_conv_pool(
input=emb,
num_filters=hid_dim,
filter_size=4,
Expand Down
4 changes: 3 additions & 1 deletion python/paddle/fluid/tests/book/test_image_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import paddle
import paddle.fluid as fluid

from ..unittests import nets

paddle.enable_static()


Expand Down Expand Up @@ -74,7 +76,7 @@ def layer_warp(block_func, input, ch_in, ch_out, count, stride):

def vgg16_bn_drop(input):
def conv_block(input, num_filter, groups, dropouts):
return fluid.nets.img_conv_group(
return nets.img_conv_group(
input=input,
pool_size=2,
pool_stride=2,
Expand Down
6 changes: 4 additions & 2 deletions python/paddle/fluid/tests/book/test_recognize_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import paddle.fluid as fluid
import paddle.fluid.core as core

from ..unittests import nets

paddle.enable_static()

BATCH_SIZE = 64
Expand All @@ -45,7 +47,7 @@ def mlp(img, label):


def conv_net(img, label):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
conv_pool_1 = nets.simple_img_conv_pool(
input=img,
filter_size=5,
num_filters=20,
Expand All @@ -54,7 +56,7 @@ def conv_net(img, label):
act="relu",
)
conv_pool_1 = paddle.static.nn.batch_norm(conv_pool_1)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
conv_pool_2 = nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
num_filters=50,
Expand Down
3 changes: 2 additions & 1 deletion python/paddle/fluid/tests/book/test_recommender_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
import paddle.fluid as fluid
import paddle.fluid.framework as framework
import paddle.fluid.layers as layers
import paddle.fluid.nets as nets
from paddle.fluid.executor import Executor
from paddle.fluid.optimizer import SGDOptimizer

from ..unittests import nets

paddle.enable_static()

IS_SPARSE = True
Expand Down
6 changes: 4 additions & 2 deletions python/paddle/fluid/tests/unittests/dist_allreduce_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import paddle.distributed.fleet as fleet
import paddle.fluid as fluid

from . import nets

paddle.enable_static()

DTYPE = "float32"
Expand All @@ -31,7 +33,7 @@


def cnn_model(data):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
conv_pool_1 = nets.simple_img_conv_pool(
input=data,
filter_size=5,
num_filters=20,
Expand All @@ -42,7 +44,7 @@ def cnn_model(data):
initializer=paddle.nn.initializer.Constant(value=0.01)
),
)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
conv_pool_2 = nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
num_filters=50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import paddle.distributed.fleet.base.role_maker as role_maker
import paddle.fluid as fluid

from . import nets

paddle.enable_static()

DTYPE = "float32"
Expand All @@ -32,7 +34,7 @@


def cnn_model(data):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
conv_pool_1 = nets.simple_img_conv_pool(
input=data,
filter_size=5,
num_filters=20,
Expand All @@ -43,7 +45,7 @@ def cnn_model(data):
initializer=paddle.nn.initializer.Constant(value=0.01)
),
)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
conv_pool_2 = nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
num_filters=50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import paddle.distributed.fleet.base.role_maker as role_maker
import paddle.fluid as fluid

from . import nets

paddle.enable_static()

DTYPE = "float32"
Expand All @@ -32,7 +34,7 @@


def cnn_model(data):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
conv_pool_1 = nets.simple_img_conv_pool(
input=data,
filter_size=5,
num_filters=20,
Expand All @@ -43,7 +45,7 @@ def cnn_model(data):
initializer=paddle.nn.initializer.Constant(value=0.01)
),
)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
conv_pool_2 = nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
num_filters=50,
Expand Down
6 changes: 4 additions & 2 deletions python/paddle/fluid/tests/unittests/dist_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import paddle.fluid as fluid
from paddle.incubate.distributed.fleet.collective import fleet

from . import nets

paddle.enable_static()

DTYPE = "float32"
Expand All @@ -31,7 +33,7 @@


def cnn_model(data):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
conv_pool_1 = nets.simple_img_conv_pool(
input=data,
filter_size=5,
num_filters=20,
Expand All @@ -42,7 +44,7 @@ def cnn_model(data):
initializer=paddle.nn.initializer.Constant(value=0.01)
),
)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
conv_pool_2 = nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
num_filters=50,
Expand Down
6 changes: 4 additions & 2 deletions python/paddle/fluid/tests/unittests/dist_mnist_dgc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import paddle
import paddle.fluid as fluid

from . import nets

paddle.enable_static()

DTYPE = "float32"
Expand All @@ -30,7 +32,7 @@


def cnn_model(data):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
conv_pool_1 = nets.simple_img_conv_pool(
input=data,
filter_size=5,
num_filters=20,
Expand All @@ -41,7 +43,7 @@ def cnn_model(data):
initializer=paddle.nn.initializer.Constant(value=0.01)
),
)
conv_pool_2 = fluid.nets.simple_img_conv_pool(
conv_pool_2 = nets.simple_img_conv_pool(
input=conv_pool_1,
filter_size=5,
num_filters=50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import paddle
import paddle.fluid as fluid

from . import nets

DTYPE = "float32"
VOCAB_URL = 'http://paddle-dist-ce-data.bj.bcebos.com/imdb.vocab'
VOCAB_MD5 = '23c86a0533c0151b6f12fa52b106dcc2'
Expand Down Expand Up @@ -63,7 +65,7 @@ def conv_net(
),
)

conv_3 = fluid.nets.sequence_conv_pool(
conv_3 = nets.sequence_conv_pool(
input=emb,
num_filters=num_filters,
filter_size=window_size,
Expand Down
Loading