3 #include <torch/nn/pimpl.h> 4 #include <torch/optim/optimizer.h> 5 #include <torch/optim/serialize.h> 6 #include <torch/types.h> 23 TORCH_ARG(
double, learning_rate);
24 TORCH_ARG(
double, lr_decay) = 0;
25 TORCH_ARG(
double, weight_decay) = 0;
30 template <
typename ParameterContainer>
32 ParameterContainer&& parameters,
34 :
Optimizer(std::forward<ParameterContainer>(parameters)),
44 std::vector<Tensor> sum_buffers;
45 std::vector<int64_t> step_buffers;
50 template <
typename Self,
typename Archive>
51 static void serialize(Self&
self, Archive& archive) {
52 _TORCH_OPTIM_SERIALIZE(sum_buffers);
53 _TORCH_OPTIM_SERIALIZE(step_buffers);
Optimizer that defines a required step() method that takes no arguments and produces no values...