-
Notifications
You must be signed in to change notification settings - Fork 110
Fill(cpp wrapper) #800
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
Fill(cpp wrapper) #800
Conversation
src/flag_gems/csrc/cstub.cpp
Outdated
m.def("fill_scalar(Tensor input, const Scalar& value) -> Tensor"); | ||
m.def("fill_tensor(Tensor input, const Tensor& value) -> Tensor"); | ||
m.def("fill_scalar_(Tensor! input, const Scalar& value) -> Tensor!"); | ||
m.def("fill_tensor_(Tensor! input, const Tensor& value) -> Tensor!"); |
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 schemas here do not need to include const Scalar&, just Scalar is fine. but the function signatures do.
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.
Thanks for the review,I've applied the suggested changes
lib/fill.cpp
Outdated
namespace flag_gems { | ||
using namespace triton_jit; | ||
|
||
at::Tensor fill_scalar(const at::Tensor& input, const c10::Scalar value) { |
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.
Use const c10::Scalar&.
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.
Thanks for the review,I've applied the suggested changes
include/flag_gems/operators.h
Outdated
|
||
at::Tensor fill_tensor(const at::Tensor &input, const at::Tensor &value); | ||
|
||
void fill_scalar_(at::Tensor &input, const c10::Scalar value); |
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.
Use const c10::Scalar&
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.
Thanks for the review,I've applied the suggested changes
lib/fill.cpp
Outdated
return out; | ||
} | ||
|
||
void fill_scalar_(at::Tensor& input, const c10::Scalar value) { |
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.
Use const c10::Scalar&
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.
Thanks for the review,I've applied the suggested changes
PR Category
Operator
Type of Change
New Feature
Description
CPP wrapper packaging for fill op.
Issue
Progress
Performance