-
Notifications
You must be signed in to change notification settings - Fork 539
Add floatValue to ExecuTorch value #10823
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10823
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ⏳ No Failures, 4 PendingAs of commit 4120a69 with merge base e7ec913 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D74603334 |
@pytorchbot label "module: user experience" |
f31e8ed
to
8b5d2b0
Compare
Summary: I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
This pull request was exported from Phabricator. Differential Revision: D74603334 |
@@ -40,6 +40,8 @@ typedef NSInteger ExecuTorchIntegerValue | |||
NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(IntegerValue); | |||
typedef double ExecuTorchDoubleValue | |||
NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(DoubleValue); | |||
typedef double ExecuTorchFloatValue |
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.
typedef double ExecuTorchFloatValue | |
typedef float ExecuTorchFloatValue |
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.
Should this be float?
/** | ||
* Returns YES if the value is a float. | ||
* | ||
* @return A BOOL indicating whether the value is a double. |
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.
* @return A BOOL indicating whether the value is a double. | |
* @return A BOOL indicating whether the value is a float. |
* The integer value if the tag is ExecuTorchValueTagFloat. | ||
* | ||
* @return An NSInteger representing the float value. |
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.
* The integer value if the tag is ExecuTorchValueTagFloat. | |
* | |
* @return An NSInteger representing the float value. | |
* The float value if the tag is ExecuTorchValueTagDouble. | |
* | |
* @return A float representing the float value. |
8b5d2b0
to
6bcb611
Compare
Summary: I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
Summary: I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
6bcb611
to
0a46aaa
Compare
This pull request was exported from Phabricator. Differential Revision: D74603334 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D74603334 |
Summary: Pull Request resolved: pytorch#10823 I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
1e80fec
to
3d0b1af
Compare
Summary: I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
This pull request was exported from Phabricator. Differential Revision: D74603334 |
@@ -40,6 +40,8 @@ typedef NSInteger ExecuTorchIntegerValue | |||
NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(IntegerValue); | |||
typedef double ExecuTorchDoubleValue | |||
NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME(DoubleValue); | |||
typedef float ExecuTorchFloatValue |
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: fix indentation?
@@ -88,6 +88,12 @@ - (ExecuTorchDoubleValue)doubleValue { | |||
return [(ExecuTorchScalarValue)_value doubleValue]; | |||
} | |||
|
|||
- (ExecuTorchFloatValue)floatValue { | |||
ET_CHECK(self.isFloat); | |||
// EValue does not have a separate tag for 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.
This comment belongs to isFloat implementation?
Summary: I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
3d0b1af
to
2405f6f
Compare
This pull request was exported from Phabricator. Differential Revision: D74603334 |
Summary: Pull Request resolved: pytorch#10823 I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
2405f6f
to
e33b392
Compare
@pytorchbot label "release notes: api" |
Summary: I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
e33b392
to
2adfa17
Compare
This pull request was exported from Phabricator. Differential Revision: D74603334 |
Summary: Pull Request resolved: pytorch#10823 I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
2adfa17
to
1f167ca
Compare
Summary: I think we can have an utility to return floats back. I would not create a new tag, but just use the double value and return it as float if the user needs float Reviewed By: shoumikhin Differential Revision: D74603334
1f167ca
to
4120a69
Compare
This pull request was exported from Phabricator. Differential Revision: D74603334 |
Summary:
I think we can have an utility to return floats back.
I would not create a new tag, but just use the double value and return it as float if the user needs float
Differential Revision: D74603334
cc @mergennachin @byjlw