mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[PyTorch][easy] Move more strings in torch::class_ (#54547)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/54547 These arguments to `BuiltinOpFunction`'s ctor don't need to be copied. ghstack-source-id: 124690196 Test Plan: CI Reviewed By: SplitInfinity Differential Revision: D27277318 fbshipit-source-id: 68f1f545ca977b2e1cabc91620da31719bf81e1a
This commit is contained in:
parent
51fa25443f
commit
ff537b77ff
|
|
@ -220,7 +220,7 @@ class class_ {
|
|||
detail::BoxedProxy<RetType, Func>()(stack, func);
|
||||
};
|
||||
auto method = std::make_unique<jit::BuiltinOpFunction>(
|
||||
qualMethodName,
|
||||
std::move(qualMethodName),
|
||||
std::move(schema),
|
||||
std::move(wrapped_func),
|
||||
std::move(doc_string));
|
||||
|
|
@ -299,9 +299,8 @@ class class_ {
|
|||
/// This is an unsafe method registration API added for adding custom JIT backend support via custom
|
||||
/// C++ classes. It is not for general purpose use.
|
||||
class_& _def_unboxed(std::string name, std::function<void(jit::Stack&)> func, c10::FunctionSchema schema, std::string doc_string = "") {
|
||||
auto qualMethodName = qualClassName + "." + name;
|
||||
auto method = std::make_unique<jit::BuiltinOpFunction>(
|
||||
qualMethodName, std::move(schema), std::move(func), std::move(doc_string));
|
||||
qualClassName + "." + name, std::move(schema), std::move(func), std::move(doc_string));
|
||||
classTypePtr->addMethod(method.get());
|
||||
registerCustomClassMethod(std::move(method));
|
||||
return *this;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user