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

TF frontend: add expm1 op #6783

Merged
merged 4 commits into from
Oct 29, 2020
Merged

TF frontend: add expm1 op #6783

merged 4 commits into from
Oct 29, 2020

Conversation

alter-xp
Copy link
Contributor

@alter-xp alter-xp commented Oct 28, 2020

In order to enrich the support of TF operator and the need of practical work, we add expm1 op in tensorflow frontend.

@FrozenGene @srkreddy1238

@@ -788,6 +788,14 @@ def _impl(inputs, attr, params, mod):
return _impl


def _expm1():
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 add the docstring describing what this operation is doing?

Copy link
Contributor Author

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

Comment on lines 791 to 794
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))
Copy link
Contributor

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?

Copy link
Contributor Author

@alter-xp alter-xp Oct 29, 2020

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).

@giuseros
Copy link
Contributor

LGTM, thanks for addressing my comments!

Copy link
Contributor

@kevinthesun kevinthesun left a comment

Choose a reason for hiding this comment

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

LGTM

@kevinthesun kevinthesun merged commit 36fdae3 into apache:main Oct 29, 2020
@kevinthesun
Copy link
Contributor

Thanks @alter-xp @giuseros

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
* 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 <[email protected]>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
* 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 <[email protected]>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
* 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants