-
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 expm1 op #6783
Conversation
@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod): | |||
return _impl | |||
|
|||
|
|||
def _expm1(): |
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 add the docstring describing what this operation is doing?
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.
Okay, I added TF description address
def _expm1(): | ||
def _impl(inputs, attr, params, mod): | ||
lh = get_relay_op("exp")(inputs[0]) | ||
return get_relay_op("subtract")(lh, tvm.relay.const(1, attr["T"].name)) |
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.
Not entirely sure, but can't you write return lh -1
? Isn't there an overload for the -
operator?
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 operator-
can be used, but cannot be written as lh - 1
. I replaced subtract
with exp_out - tvm.relay.const(1.0)
.
LGTM, thanks for addressing my comments! |
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.
LGTM
* TF frontend: add expm1 op * TF frontend: add description for expm1 * TF frontend: use overload operator - instead of subtract * TF frontend: Limits the range of input data in the Expm1 test Co-authored-by: xup <xp224797@alibaba-inc.com>
* TF frontend: add expm1 op * TF frontend: add description for expm1 * TF frontend: use overload operator - instead of subtract * TF frontend: Limits the range of input data in the Expm1 test Co-authored-by: xup <xp224797@alibaba-inc.com>
* TF frontend: add expm1 op * TF frontend: add description for expm1 * TF frontend: use overload operator - instead of subtract * TF frontend: Limits the range of input data in the Expm1 test Co-authored-by: xup <xp224797@alibaba-inc.com>
In order to enrich the support of TF operator and the need of practical work, we add expm1 op in tensorflow frontend.
@FrozenGene @srkreddy1238