-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
TF frontend: add rint op #6818
TF frontend: add rint op #6818
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3520,6 +3520,23 @@ def _test_forward_softsign(shape): | |
_test_forward_softsign([2, 5, 2, 5]) | ||
|
||
|
||
def test_forward_rint(): | ||
"""test operator rint """ | ||
|
||
def _test_forward_rint(shape): | ||
tf.disable_eager_execution() | ||
np_data = np.random.uniform(1, 100, size=shape).astype(np.float32) | ||
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. include -ve floats also for testing. 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. Thank you for your comments, but I don't get your point. 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. use 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. thanks! |
||
tf.reset_default_graph() | ||
in_data = tf.placeholder(tf.float32, shape, name="in_data") | ||
tf.math.rint(in_data, name="rint") | ||
compare_tf_with_tvm([np_data], ["in_data:0"], "rint:0") | ||
|
||
_test_forward_rint([100]) | ||
_test_forward_rint([1, 100]) | ||
_test_forward_rint([1, 10, 10]) | ||
_test_forward_rint([2, 5, 2, 5]) | ||
|
||
|
||
def test_forward_negative(): | ||
"""test tf operator Neg """ | ||
np_data = np.random.uniform(-100, 255, size=(224, 224, 3)).astype(np.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.
preserve the alphabetical order. keep Rint above Round.
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.
🆗