This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Fix deconvolution / PR 13421 #13433
Merged
Merged
Fix deconvolution / PR 13421 #13433
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b713021
add test case
azai91 c742913
revert refactor
azai91 6eb5b06
use with seed decorator
azai91 1f32ac1
retrigger
azai91 0d4160c
remove seed
azai91 34c8ef7
remove iteration
azai91 e310258
remove old test
azai91 d0c6d13
update deconvolution test to have filter length that triggers mkldnn …
azai91 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -398,6 +398,23 @@ def softmax_forward(input_data, true_output): | |
softmax_forward(mx.nd.array([[[[-3.4e38,-3.4e38]]]]), np.array([1.0,1.0])) | ||
softmax_forward(mx.nd.array([[[[3.4e38,3.4e38]]]]), np.array([1.0,1.0])) | ||
|
||
def test_deconvolution_inference(): | ||
num_filter = 256 | ||
num_group = 1 | ||
kernel = (3, 3) | ||
pad = (1, 1) | ||
shape = (1, 256, 200, 233) | ||
x = mx.sym.Variable('x') | ||
w = mx.sym.Variable('w') | ||
y = mx.sym.Deconvolution(data=x, weight=w, num_filter=num_filter, num_group=num_group, kernel=kernel, no_bias=True, pad=pad) | ||
exe = y.simple_bind(ctx=mx.cpu(), x=shape, grad_req='null') | ||
exe.arg_arrays[0][:] = np.random.normal(size=exe.arg_arrays[0].shape) | ||
exe.arg_arrays[1][:] = np.random.normal(size=exe.arg_arrays[1].shape) | ||
for i in range(10): | ||
exe.forward(is_train=False) | ||
o = exe.outputs[0] | ||
t = o.asnumpy() | ||
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. can we just do exe.outputs[0].wait_to_read() 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. you're right. this is only dependent on the shape and not values. |
||
|
||
@with_seed() | ||
def test_non_mkldnn_fcomputeex(): | ||
# test special case where MKLDNN formatted NDArray feeds into non-mkldnn fcomputeex operator | ||
|
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.
nit: do we need this 10 times.