-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
revise tan op #6567
Conversation
@@ -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: |
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.
please clarify input is in radians or degrees.
What value will be returned in case inf floating values?
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, update the document
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.
@rkazants could you help to review, thanks
fff9d33
to
e8f3365
Compare
ngraph/test/backend/tan.in.cpp
Outdated
@@ -62,3 +62,24 @@ NGRAPH_TEST(${BACKEND_NAME}, tan) | |||
-1.15782128f}, | |||
read_vector<float>(result))); | |||
} | |||
|
|||
|
|||
NGRAPH_TEST(${BACKEND_NAME}, tan_int32) |
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.
Could you use template reference tests instead of backend tests?
e8f3365
to
65cd9c3
Compare
ngraph/test/backend/tan.in.cpp
Outdated
@@ -34,7 +34,7 @@ using namespace ngraph; | |||
|
|||
static string s_manifest = "${MANIFEST}"; | |||
|
|||
NGRAPH_TEST(${BACKEND_NAME}, tan) | |||
NGRAPH_TEST(${BACKEND_NAME}, tan_float) |
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.
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), |
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.
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}, |
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.
@ilyachur I don't know if need to support u32 u64, it's very strange to transform int to uint here
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.
@ilyachur for example -2 to 0xFFFFFFFFFFFFFFFF - 1
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.
Why do you need negative numbers for uint data types?
Can you just change reference values?
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.
tan(2)=-2, but the output type is uint
docs/ops/arithmetic/Tan_1.md
Outdated
|
||
**Types** | ||
|
||
* *T*: any numeric type. | ||
* *T*: int32,int64,uint32,uint64,float16,float32 |
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.
We do not specify types like this. As plugins may support different types. Please change this to -> *T*: any supported numeric type.
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.
Update the document. Are the test case about uint ok ?
Please fix CI |
dcfd68c
to
5c1835f
Compare
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]>
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]>
Signed-off-by: Hu, Yuan2 <[email protected]>
@ilyachur ci is fixed |
* 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]>
* 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]>
* 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]>
* 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]>
Signed-off-by: Hu, Yuan2 [email protected]
Details:
Tickets: