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

Add Identity OP #34420

Merged
merged 10 commits into from
Aug 2, 2021
Merged

Add Identity OP #34420

merged 10 commits into from
Aug 2, 2021

Conversation

shiyutang
Copy link
Contributor

@shiyutang shiyutang commented Jul 27, 2021

PR types

New features

PR changes

OPs

Describe

Add Identity op which have the same functionality as torch.nn.Identity, if we define the "m" as the identity layer, it creates following results.
Ineut-tensor - poddle to-tensorCmrpy rondon rondnC1z, 20))

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@CLAassistant
Copy link

CLAassistant commented Jul 27, 2021

CLA assistant check
All committers have signed the CLA.

python/paddle/fluid/tests/unittests/test_identity_op.py Outdated Show resolved Hide resolved
python/paddle/nn/layer/common.py Outdated Show resolved Hide resolved
python/paddle/nn/layer/common.py Outdated Show resolved Hide resolved
@shiyutang shiyutang requested a review from ZHUI July 28, 2021 08:00
python/paddle/nn/layer/common.py Outdated Show resolved Hide resolved
python/paddle/nn/layer/common.py Outdated Show resolved Hide resolved
python/paddle/nn/layer/common.py Outdated Show resolved Hide resolved
@shiyutang shiyutang changed the title Identity OP Add Identity OP Jul 28, 2021
michaelowenliu
michaelowenliu previously approved these changes Jul 28, 2021
Copy link

@michaelowenliu michaelowenliu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

class Identity(Layer):
r"""

A placeholder identity operator that is argument-insensitive. For each input :math:`X` ,
Copy link
Contributor

Choose a reason for hiding this comment

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

只支持一个输入,一个输出吧。
这里用for each,感觉是支持多个输入的。

@jzhang533 jzhang533 merged commit 80f7f7e into PaddlePaddle:develop Aug 2, 2021
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.

5 participants