Skip to content

TF frontend: add expm1 op#6783

Merged
kevinthesun merged 4 commits intoapache:mainfrom
c-sky:main
Oct 29, 2020
Merged

TF frontend: add expm1 op#6783
kevinthesun merged 4 commits intoapache:mainfrom
c-sky:main

Conversation

@alter-xp
Copy link
Copy Markdown
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

return _impl


def _expm1():
Copy link
Copy Markdown
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
Copy Markdown
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 thread python/tvm/relay/frontend/tensorflow.py Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

LGTM, thanks for addressing my comments!

Copy link
Copy Markdown
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
Copy Markdown
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 <xp224797@alibaba-inc.com>
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 <xp224797@alibaba-inc.com>
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 <xp224797@alibaba-inc.com>
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