You can use adam in the c++ pytorch api
Some links that might be usefull:

  

      github.com
  

  
    pytorch/pytorch/blob/master/torch/csrc/api/src/optim/adam.cpp 19


    #include <torch/optim/adam.h>

#include <torch/csrc/autograd/variable.h>
#include <torch/nn/module.h>
#include <torch/serialize/archive.h>
#include <torch/utils.h>

#include <ATen/ATen.h>
#include <c10/util/irange.h>

#include <cmath>
#include <functional>

namespace torch {
namespace optim {

AdamOptions::AdamOptions(double lr) : lr_(lr) {}

bool operator==(const AdamOptions& lhs, const AdamOptions& rhs) {
  return (lhs.lr() == rhs.lr()) &&



  This file has been truncated. show original

  

  
    
    
  

  

https://caffe2.ai/doxygen-c/html/classtorch_1_1optim_1_1_adam.html 1