class_docstr: Base class of optimizers that make use of higher-order derivatives.
  
  Higher-order optimizers generally use :func:`torch.autograd.grad` rather
  than :meth:`torch.Tensor.backward`, and therefore require a different
  interface from usual Pyro and PyTorch optimizers. In this interface,
  the :meth:`step` method inputs a ``loss`` tensor to be differentiated,
  and backpropagation is triggered one or more times inside the optimizer.
  
  Derived classes must implement :meth:`step` to compute derivatives and
  update parameters in-place.
  
  Example::
  
      tr = poutine.trace(model).get_trace(*args, **kwargs)
      loss = -tr.log_prob_sum()
      params = {name: site['value'].unconstrained()
                for name, site in tr.nodes.items()
                if site['type'] == 'param'}
      optim.step(loss, params)
docstr: Performs an in-place optimization step on parameters given a
  differentiable ``loss`` tensor.
  
  Note that this detaches the updated tensors.
  
  :param torch.Tensor loss: A differentiable tensor to be minimized.
      Some optimizers require this to be differentiable multiple times.
  :param dict params: A dictionary mapping param name to unconstrained
      value as stored in the param store.
docstr_tok: ["Performs","an","in-place","optimization","step","on","parameters","given","a","differentiable","``","loss","``","tensor",".","Note","that","this","detaches","the","updated","tensors",".",":","param","torch.Tensor","loss",":","A","differentiable","tensor","to","be","minimized",".","Some","optimizers","require","this","to","be","differentiable","multiple","times",".",":","param","dict","params",":","A","dictionary","mapping","param","name","to","unconstrained","value","as","stored","in","the","param","store","."]
code: def step(self, loss: torch.Tensor, params: Dict) -> None:
      """
      Performs an in-place optimization step on parameters given a
      differentiable ``loss`` tensor.
  
      Note that this detaches the updated tensors.
  
      :param torch.Tensor loss: A differentiable tensor to be minimized.
          Some optimizers require this to be differentiable multiple times.
      :param dict params: A dictionary mapping param name to unconstrained
          value as stored in the param store.
      """
      updated_values = self.get_step(loss, params)
      for name, value in params.items():
          with torch.no_grad():
              # we need to detach because updated_value may depend on value
              value.copy_(updated_values[name].detach())
  
imports: from typing import Dict, List
  import torch
  from pyro.ops.newton import newton_step
  from pyro.optim.optim import PyroOptim
label_desc: Use image node_id 1 for calling the MultiOptimizer obj's underlying member method code with example usage: obj.step(loss, params) without return types