-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add pool op #4146
Merged
+1,895
−4
Merged
Add pool op #4146
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
9e7c0b5
Add pooling2d(max, ave) and pooling3d(max, ave) functor
chengduoZH a847738
Add pooling2d(max, ave) and pooling3d(max, ave) Op
chengduoZH 33d9999
Add pool2d unit test
chengduoZH 510f008
Add pool3d unit test
chengduoZH 3416f5e
fix function define
chengduoZH 50b8ec0
fix unit test
chengduoZH 84a2512
fix parameter name and function define
chengduoZH 6f61b5d
fix unit test
chengduoZH 0417e4e
fix framework::LoDTensor => Tensor
chengduoZH c2c2d61
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chengduoZH f2ccc11
fix pool doc (pool_op.cc)
chengduoZH b0a47b1
remove CHECK in *.cu
chengduoZH 9b1431b
fix maxpool backward functor and add unit test
chengduoZH b728543
Fix (According to the review)
chengduoZH 8c478b3
fix Atrr check
chengduoZH 905a462
Merge branch 'fix_maxpool_backward_functor_temp' into Add_pool_op_temp
chengduoZH f6e69d7
fix maxpool backward functor
chengduoZH dfc8d3c
Fix (According to the review)
chengduoZH 30a586d
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chengduoZH 4b06d8d
fix globalPooling type (int => bool)
chengduoZH 3c0f079
remove conflict and fix InferShape function
chengduoZH e1e3859
remove custom attr checker and fix code format
chengduoZH df59889
remove conflict
chengduoZH 2d8a5b9
fix unit test
chengduoZH 6abcb74
fix unit test class name
chengduoZH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix unit test
- v3.0.0-rc1
- v3.0.0-rc0
- v3.0.0-beta2
- v3.0.0-beta1
- v3.0.0-beta0
- v2.6.2
- v2.6.1
- v2.6.0
- v2.6.0-bak0
- v2.5.2
- v2.5.1
- v2.5.0
- v2.5.0-rc1
- v2.5.0-rc0
- v2.4.2
- v2.4.1
- v2.4.0
- v2.4.0-rc0
- v2.3.2
- v2.3.1
- v2.3.0
- v2.3.0-rc0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.2.0-rc0
- v2.2.0-bak0
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.1.0-rc0
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-rc1
- v2.0.0-rc0
- v2.0.0-beta0
- v2.0.0-alpha0
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.6.0-rc0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-rc0
- v0.15.0
- v0.15.0-rc0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.1a2
- v0.11.1a1
- v0.11.0
- lite-v0.1
commit 2d8a5b97cc9096a84483b92be458d1388533c84f
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ def avg_pool3D_forward_naive(x, ksize, strides, paddings=[0, 0], global_pool=0): | |
class TestPool3d_Op(OpTest): | ||
def setUp(self): | ||
self.initTestCase() | ||
self.op_type = "pool3d" | ||
input = np.random.random(self.shape).astype("float32") | ||
output = self.pool3D_forward_naive(input, self.ksize, self.strides, | ||
self.paddings, self.global_pool) | ||
|
@@ -79,7 +78,8 @@ def test_check_grad(self): | |
self.check_grad(set(['X']), 'Out', max_relative_error=0.07) | ||
|
||
def initTestCase(self): | ||
self.global_pool = 0 | ||
self.global_pool = True | ||
self.op_type = "pool3d" | ||
self.pool_type = "avg" | ||
self.pool3D_forward_naive = avg_pool3D_forward_naive | ||
self.shape = [2, 3, 5, 5, 5] | ||
|
@@ -90,19 +90,19 @@ def initTestCase(self): | |
|
||
class TestCase1(TestPool3d_Op): | ||
def initTestCase(self): | ||
self.global_pool = 0 | ||
self.global_pool = False | ||
self.op_type = "pool3d" | ||
self.pool_type = "avg" | ||
self.pool3D_forward_naive = avg_pool3D_forward_naive | ||
self.shape = [2, 3, 7, 7, 7] | ||
self.ksize = [3, 3, 3] | ||
self.strides = [1, 1, 1] | ||
self.paddings = [1, 1, 1] | ||
self.paddings = [0, 0, 0] | ||
|
||
|
||
class TestCase2(TestPool3d_Op): | ||
def initTestCase(self): | ||
self.global_pool = 1 | ||
self.global_pool = False | ||
self.op_type = "pool3d" | ||
self.pool_type = "avg" | ||
self.pool3D_forward_naive = avg_pool3D_forward_naive | ||
|
@@ -114,23 +114,35 @@ def initTestCase(self): | |
|
||
class TestCase3(TestPool3d_Op): | ||
def initTestCase(self): | ||
self.global_pool = 0 | ||
self.global_pool = True | ||
self.op_type = "pool3d" | ||
self.pool_type = "max" | ||
self.pool3D_forward_naive = max_pool3D_forward_naive | ||
self.shape = [2, 3, 5, 5, 5] | ||
self.ksize = [3, 3, 3] | ||
self.strides = [1, 1, 1] | ||
self.paddings = [1, 1, 1] | ||
self.paddings = [0, 0, 0] | ||
|
||
|
||
class TestCase4(TestPool3d_Op): | ||
class TestCase3(TestPool3d_Op): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TestCase4? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
def initTestCase(self): | ||
self.global_pool = 1 | ||
self.global_pool = False | ||
self.op_type = "pool3d" | ||
self.pool_type = "max" | ||
self.pool3D_forward_naive = max_pool3D_forward_naive | ||
self.shape = [2, 3, 5, 5, 5] | ||
self.shape = [2, 3, 7, 7, 7] | ||
self.ksize = [3, 3, 3] | ||
self.strides = [1, 1, 1] | ||
self.paddings = [0, 0, 0] | ||
|
||
|
||
class TestCase3(TestPool3d_Op): | ||
def initTestCase(self): | ||
self.global_pool = False | ||
self.op_type = "pool3d" | ||
self.pool_type = "max" | ||
self.pool3D_forward_naive = max_pool3D_forward_naive | ||
self.shape = [2, 3, 7, 7, 7] | ||
self.ksize = [3, 3, 3] | ||
self.strides = [1, 1, 1] | ||
self.paddings = [1, 1, 1] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestCase3 repeated definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done