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

revise tan op #6567

Merged
merged 6 commits into from
Aug 5, 2021
Merged

Conversation

tiger100256-hu
Copy link
Contributor

Signed-off-by: Hu, Yuan2 [email protected]

Details:

  • Add detailed description to Tan Spec
  • Change to use RTTI decl/define for Tan OP
  • Add type prop , visitor (attributes) tests for Tan OP

Tickets:

  • 37486

@tiger100256-hu tiger100256-hu requested a review from a team as a code owner July 8, 2021 08:50
@tiger100256-hu tiger100256-hu requested review from a team July 8, 2021 08:50
@ilyachur ilyachur added this to the 2022.1 milestone Jul 9, 2021
@ilyachur ilyachur added the category: Core OpenVINO Core (aka ngraph) label Jul 9, 2021
@pelszkow pelszkow requested review from lazarevevgeny and ilyachur and removed request for pelszkow July 9, 2021 07:19
@@ -6,32 +6,29 @@

**Short description**: *Tan* performs element-wise tangent operation with given tensor.

**Attributes**:
**Detailed description**: Operation takes one input tensor and performs the element-wise tangent function on a given input tensor, based on the following mathematical formula:
Copy link
Contributor

@rkazants rkazants Jul 12, 2021

Choose a reason for hiding this comment

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

please clarify input is in radians or degrees.
What value will be returned in case inf floating values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, update the document

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rkazants could you help to review, thanks

@jdanieck jdanieck requested review from sdurawa and removed request for jdanieck July 14, 2021 13:51
@@ -62,3 +62,24 @@ NGRAPH_TEST(${BACKEND_NAME}, tan)
-1.15782128f},
read_vector<float>(result)));
}


NGRAPH_TEST(${BACKEND_NAME}, tan_int32)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use template reference tests instead of backend tests?

@@ -34,7 +34,7 @@ using namespace ngraph;

static string s_manifest = "${MANIFEST}";

NGRAPH_TEST(${BACKEND_NAME}, tan)
NGRAPH_TEST(${BACKEND_NAME}, tan_float)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you remove tan backend test? And use only template reference tests instead?

}

std::vector<TanParams> generateTanCombinedParams() {
const std::vector<std::vector<TanParams>> tanTypeParams {generateTanParamsInt<element::Type_t::i32>(ngraph::element::i32),
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you cover all supported types?

std::vector<int32_t> {2, -2, 0, 2, -2}),
TanParams(ngraph::PartialShape {5}, ngraph::element::i64, std::vector<int64_t> {-2, -1, 0, 1, 2},
std::vector<int64_t> {2, -2, 0, 2, -2}),
TanParams(ngraph::PartialShape {5}, ngraph::element::u32, std::vector<uint32_t> {1, 2, 3, 4, 5},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ilyachur I don't know if need to support u32 u64, it's very strange to transform int to uint here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ilyachur for example -2 to 0xFFFFFFFFFFFFFFFF - 1

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need negative numbers for uint data types?
Can you just change reference values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tan(2)=-2, but the output type is uint


**Types**

* *T*: any numeric type.
* *T*: int32,int64,uint32,uint64,float16,float32

Choose a reason for hiding this comment

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

We do not specify types like this. As plugins may support different types. Please change this to -> *T*: any supported numeric type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update the document. Are the test case about uint ok ?

@ilyachur
Copy link
Contributor

ilyachur commented Aug 3, 2021

Please fix CI

Signed-off-by: Hu, Yuan2 <[email protected]>
add examples in desciption
add the unit of measure
clear input type

Signed-off-by: Hu, Yuan2 <[email protected]>
remove the float test in backend

Signed-off-by: Hu, Yuan2 <[email protected]>
change type to any supported numeric type

Signed-off-by: Hu, Yuan2 <[email protected]>
@tiger100256-hu
Copy link
Contributor Author

@ilyachur ci is fixed

@ilyachur ilyachur merged commit a913950 into openvinotoolkit:master Aug 5, 2021
v-Golubev pushed a commit to v-Golubev/openvino that referenced this pull request Aug 12, 2021
* revise tan op

Signed-off-by: Hu, Yuan2 <[email protected]>

* update doc

add examples in desciption
add the unit of measure
clear input type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for int type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for uint and float

remove the float test in backend

Signed-off-by: Hu, Yuan2 <[email protected]>

* modify document

change type to any supported numeric type

Signed-off-by: Hu, Yuan2 <[email protected]>

* fix compile error in openvino-lin

Signed-off-by: Hu, Yuan2 <[email protected]>
rnugmanx pushed a commit to rnugmanx/openvino that referenced this pull request Aug 26, 2021
* revise tan op

Signed-off-by: Hu, Yuan2 <[email protected]>

* update doc

add examples in desciption
add the unit of measure
clear input type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for int type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for uint and float

remove the float test in backend

Signed-off-by: Hu, Yuan2 <[email protected]>

* modify document

change type to any supported numeric type

Signed-off-by: Hu, Yuan2 <[email protected]>

* fix compile error in openvino-lin

Signed-off-by: Hu, Yuan2 <[email protected]>
andrei-cv pushed a commit to andrei-cv/openvino that referenced this pull request Aug 30, 2021
* revise tan op

Signed-off-by: Hu, Yuan2 <[email protected]>

* update doc

add examples in desciption
add the unit of measure
clear input type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for int type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for uint and float

remove the float test in backend

Signed-off-by: Hu, Yuan2 <[email protected]>

* modify document

change type to any supported numeric type

Signed-off-by: Hu, Yuan2 <[email protected]>

* fix compile error in openvino-lin

Signed-off-by: Hu, Yuan2 <[email protected]>
akuporos pushed a commit to akuporos/openvino that referenced this pull request Sep 29, 2021
* revise tan op

Signed-off-by: Hu, Yuan2 <[email protected]>

* update doc

add examples in desciption
add the unit of measure
clear input type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for int type

Signed-off-by: Hu, Yuan2 <[email protected]>

* add template plugin test case for uint and float

remove the float test in backend

Signed-off-by: Hu, Yuan2 <[email protected]>

* modify document

change type to any supported numeric type

Signed-off-by: Hu, Yuan2 <[email protected]>

* fix compile error in openvino-lin

Signed-off-by: Hu, Yuan2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants