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

[PTen] Add full kernel in pten (incomplete) #36930

Merged
merged 163 commits into from
Nov 8, 2021

Conversation

zyfncg
Copy link
Contributor

@zyfncg zyfncg commented Nov 2, 2021

PR types

Others

PR changes

Others

Describe

Add first fill_constant kernel in PTen

The C++ API is:

Tensor full(const std::vector<int64_t>& shape, const Scalar& value, DataType dtype, Backend backend, DataLayout layout);

@paddle-bot-old
Copy link

paddle-bot-old bot commented Nov 2, 2021

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

@zyfncg zyfncg changed the title Add full kernel in pten【incomplete】 [PTen] Add full kernel in pten (incomplete) Nov 2, 2021
!ctx.OutputVar("Out")->IsType<framework::SelectedRows>()) {
const auto& str_value = ctx.Attr<std::string>("str_value");
std::string value = str_value.empty() ? "value" : "str_value";
return framework::KernelSignature("fill_constant.Scalar", {}, {value},
Copy link
Contributor

Choose a reason for hiding this comment

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

我们统一使用小写的overloaded name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -15,5 +15,6 @@ limitations under the License. */
#pragma once

// See Note: [ How do we organize the kernel directory ]
#include "paddle/pten/infershape/0_nary.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

不建议使用数字命名文件,使用小写字母和下划线,这里是不是直接叫nary.h就可以

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, 已修改为nary

Copy link
Contributor

@MingMingShangTian MingMingShangTian 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
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM

@zyfncg zyfncg merged commit 655f4e3 into PaddlePaddle:develop Nov 8, 2021
@zyfncg zyfncg deleted the full_kernel branch November 8, 2021 12:53
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