-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Labels
Description
cudnn-frontend/include/cudnn_frontend/graph_properties.h
Lines 1002 to 1006 in 0258951
| Layernorm_attributes& | |
| set_epsilon(std::shared_ptr<Tensor_attributes>& value) { | |
| inputs[Layernorm_attributes::input_names::EPSILON] = value; | |
| return *this; | |
| } |
By taking a reference as parameter it would not be possible to pass rvalue, i.e. convenient code like below won't compile:
auto options = fe::graph::Rmsnorm_attributes()
.set_epsilon(create_epsilon_tensor())If the purpose is to avoid copy, the code should take const reference or use move semantics:
Layernorm_attributes&
set_epsilon(std::shared_ptr<Tensor_attributes> value) {
inputs.emplace(Layernorm_attributes::input_names::EPSILON, std::move(value));
return *this;
} There are also other cases need fixes:
https://github.com/search?q=repo%3ANVIDIA%2Fcudnn-frontend+%22%28std%3A%3Ashared_ptr%3CTensor_attributes%3E%26%22+path%3Agraph_properties.h&type=code