Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
wangna11BD committed May 18, 2022
1 parent 6f6f847 commit 72c395b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion python/paddle/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,26 @@ def forward(self, x):
return y, 3


class LeNetListInput(LeNetDygraph):
class LeNetListInput(paddle.nn.Layer):
def __init__(self, num_classes=10):
super(LeNetListInput, self).__init__()
self.num_classes = num_classes
self.cov = Conv2D(1, 6, 3, stride=1, padding=1)
for param in self.cov.parameters():
param.trainable = False
self.features = Sequential(
self.cov,
ReLU(),
paddle.fluid.dygraph.Pool2D(2, 'max', 2),
Conv2D(
6, 16, 5, stride=1, padding=0),
ReLU(),
paddle.fluid.dygraph.Pool2D(2, 'max', 2))

if num_classes > 0:
self.fc = Sequential(
Linear(400, 120), Linear(120, 84), Linear(84, 10))

def forward(self, inputs):
x = inputs[0]
x = self.features(x)
Expand Down

1 comment on commit 72c395b

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.