Skip to content

Implement Shrink operator#485

Merged
hariharans29 merged 22 commits intomasterfrom
shrinkOp
Mar 1, 2019
Merged

Implement Shrink operator#485
hariharans29 merged 22 commits intomasterfrom
shrinkOp

Conversation

@hariharans29
Copy link
Member

No description provided.

@hariharans29 hariharans29 requested a review from a team as a code owner February 16, 2019 03:04
@pranavsharma
Copy link
Contributor

Is this PR ready for review? If yes, you may remove the WIP from the title. Thx.

@hariharans29
Copy link
Member Author

Is this PR ready for review? If yes, you may remove the WIP from the title. Thx.

It is not ready yet. That's why I did not remove the WIP from the title. It needs some test case additions. Thanks.

@snnn
Copy link
Contributor

snnn commented Feb 19, 2019

Talked with Hari offline. It's very likely the test data is wrong. He is verifying it.

We have two ONNX test programs, one is in C++, another is in Python.
The Python one doesn't check the output tensor's shape. The C++ one(onnx_test_runner) checks it. That's why the python test passed, but the C++ test failed.

Another question is: did we check the input shape? I suspect we didn't.

@@ -312,8 +312,6 @@ int real_main(int argc, char* argv[]) {
{"scatter_without_axis", "opset 9 not supported yet"},
{"scan_sum", "opset 9 not supported yet"},
{"shrink", "opset 9 not supported yet"},
Copy link
Member Author

Choose a reason for hiding this comment

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

Keeping "shrink" test excluded because of bug in test input - onnx/onnx#1823

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you create a task to fix this when #499 gets checked in to update the ONNX version?


In reply to: 258262246 [](ancestors = 258262246)

@hariharans29 hariharans29 changed the title WIP - Implement Shrink operator Implement Shrink operator Feb 19, 2019
@pranavsharma
Copy link
Contributor

The Python one doesn't check the output tensor's shape.
Is this just a bug in our implementation?

pranavsharma
pranavsharma previously approved these changes Feb 20, 2019
auto input = p_op_kernel_context->Input<Tensor>(0);
auto output = p_op_kernel_context->Output(0, input->Shape());

auto dtype = input->DataType();
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer explicitly using 'const' and * or & with 'auto' when applicable so it's clearer what it represents.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. Fixed.

template <>
Status ShrinkImpl<bool>(const Tensor* /*input*/, Tensor* /*output*/, float /*bias*/, float /*lambd*/) {
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT, "Input types for the Shrink operator are constrained to all numeric types only. Got bool type here.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: limit line length to 120

https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelines is very helpful to show a vertical guideline at 120

skottmckay
skottmckay previously approved these changes Mar 1, 2019
Copy link
Contributor

@skottmckay skottmckay left a comment

Choose a reason for hiding this comment

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

:shipit:

skottmckay
skottmckay previously approved these changes Mar 1, 2019
Copy link
Contributor

@skottmckay skottmckay left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@skottmckay skottmckay left a comment

Choose a reason for hiding this comment

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

:shipit:

@hariharans29 hariharans29 merged commit a697e0b into master Mar 1, 2019
@raymondxyang raymondxyang deleted the shrinkOp branch March 6, 2019 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants