[3/N] Fix clang-tidy warnings in torch/csrc/autograd (#133389)

Follows #133295
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133389
Approved by: https://github.com/Skylion007
This commit is contained in:
cyy
2024-08-16 00:57:51 +00:00
committed by PyTorch MergeBot
parent c22f51ce7c
commit 929d2f8253
13 changed files with 57 additions and 106 deletions

View File

@ -1,10 +1,9 @@
#pragma once
#include <torch/csrc/autograd/function_hook.h>
#include <torch/csrc/dynamo/compiled_autograd.h>
namespace torch {
namespace autograd {
namespace utils {
namespace torch::autograd::utils {
// Turns lambda into a torch::autograd::FunctionPostHook.
class LambdaPostHook : public torch::autograd::FunctionPostHook {
@ -32,9 +31,7 @@ class LambdaPostHook : public torch::autograd::FunctionPostHook {
protected:
std::function<variable_list(const variable_list&, const variable_list&)> fn_;
compiled_fn_type compiled_fn_;
compiled_fn_type compiled_fn_{};
};
} // namespace utils
} // namespace autograd
} // namespace torch
} // namespace torch::autograd::utils