Class Adam

Inheritance Relationships

Base Type

Class Documentation

class torch::optim::Adam : public torch::optim::Optimizer

Public Functions

Adam(std::vector<OptimizerParamGroup> param_groups, AdamOptions defaults = {})
Adam(std::vector<Tensor> params, AdamOptions defaults = {})
torch::Tensor step(LossClosure closure = nullptr) override

A loss function closure, which is expected to return the loss value.

void save(serialize::OutputArchive &archive) const override

Serializes the optimizer state into the given archive.

void load(serialize::InputArchive &archive) override

Deserializes the optimizer state from the given archive.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources