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 30 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 @@ -54,7 +54,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 @@ -112,7 +111,6 @@
'disable_dygraph',
'enable_imperative',
'disable_imperative',
'nets',
'optimizer',
'backward',
'LoDTensor',
Expand Down
7 changes: 5 additions & 2 deletions test/book/notest_understand_sentiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

import numpy as np

sys.path.append("../legacy_test")
import nets

import paddle
from paddle import fluid

Expand All @@ -30,14 +33,14 @@ def convolution_net(
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
5 changes: 4 additions & 1 deletion test/book/test_image_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

import numpy

sys.path.append("../legacy_test")
import nets

import paddle
from paddle import fluid

Expand Down Expand Up @@ -74,7 +77,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
7 changes: 5 additions & 2 deletions test/book/test_recognize_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

import numpy

sys.path.append("../legacy_test")
import nets

import paddle
from paddle import fluid
from paddle.fluid import core
Expand All @@ -45,7 +48,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 +57,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
5 changes: 4 additions & 1 deletion test/book/test_recommender_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@

import numpy as np

sys.path.append("../legacy_test")
import nets

import paddle
from paddle import fluid
from paddle.fluid import framework, layers, nets
from paddle.fluid import framework, layers
from paddle.fluid.executor import Executor
from paddle.fluid.optimizer import SGDOptimizer

Expand Down
5 changes: 3 additions & 2 deletions test/collective/fleet/pipeline_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from functools import reduce

from legacy_test import nets
from legacy_test.test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand All @@ -31,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 @@ -42,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
5 changes: 3 additions & 2 deletions test/collective/fleet/pipeline_mnist_multi_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from functools import reduce

from legacy_test import nets
from legacy_test.test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand All @@ -31,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 @@ -42,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
5 changes: 3 additions & 2 deletions test/collective/fleet/pipeline_mnist_one_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from functools import reduce

from legacy_test import nets
from legacy_test.test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand All @@ -31,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 @@ -42,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
5 changes: 4 additions & 1 deletion test/contrib/test_image_classification_fp16.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

import numpy

sys.path.append("../legacy_test")
import nets

import paddle
from paddle import fluid
from paddle.static.amp import decorate
Expand Down Expand Up @@ -76,7 +79,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
5 changes: 3 additions & 2 deletions test/legacy_test/dist_allreduce_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from functools import reduce

import nets
from test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand All @@ -31,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 @@ -42,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
5 changes: 3 additions & 2 deletions test/legacy_test/dist_fleet_raw_program_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from functools import reduce

import nets
from test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand All @@ -32,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 @@ -43,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 @@ -14,6 +14,7 @@

from functools import reduce

import nets
from test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand All @@ -32,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 @@ -43,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
5 changes: 3 additions & 2 deletions test/legacy_test/dist_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from functools import reduce

import nets
from test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand All @@ -31,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 @@ -42,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
5 changes: 3 additions & 2 deletions test/legacy_test/dist_mnist_dgc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from functools import reduce

import nets
from legacy_test.test_dist_base import (
TestDistRunnerBase,
_insert_comm_op,
Expand All @@ -34,7 +35,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 @@ -45,7 +46,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
3 changes: 2 additions & 1 deletion test/legacy_test/dist_text_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import string
import tarfile

import nets
from test_dist_base import TestDistRunnerBase, runtime_main

import paddle
Expand Down Expand Up @@ -63,7 +64,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