Remove some pre-cpp17 stuff (#138410)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/138410
Approved by: https://github.com/Skylion007
This commit is contained in:
Richard Barnes
2024-10-23 00:38:00 +00:00
committed by PyTorch MergeBot
parent f4b3813989
commit d428d81c7f
10 changed files with 36 additions and 72 deletions

View File

@ -12,6 +12,8 @@
#include <c10/util/TypeTraits.h>
#include <torch/custom_class_detail.h>
#include <torch/library.h>
#include <functional>
#include <sstream>
namespace torch {
@ -117,7 +119,7 @@ class class_ : public ::torch::detail::class_base {
c10::tagged_capsule<CurClass> self,
ParameterTypes... arg) {
c10::intrusive_ptr<CurClass> classObj =
at::guts::invoke(func, std::forward<ParameterTypes>(arg)...);
std::invoke(func, std::forward<ParameterTypes>(arg)...);
auto object = self.ivalue.toObject();
object->setSlot(0, c10::IValue::make_capsule(classObj));
};
@ -325,7 +327,7 @@ class class_ : public ::torch::detail::class_base {
c10::tagged_capsule<CurClass> self,
SetStateArg arg) {
c10::intrusive_ptr<CurClass> classObj =
at::guts::invoke(set_state, std::move(arg));
std::invoke(set_state, std::move(arg));
auto object = self.ivalue.toObject();
object->setSlot(0, c10::IValue::make_capsule(classObj));
};