class_docstr: Optimizer information to be used in testing.
class_docstr_tok: ["Optimizer","information","to","be","used","in","testing","."]
code: def __init__(
      self,
      optim_cls: Optimizer,  # Class object for the Optimizer under test
      *,
      # Function to generate optimizer inputs EXCLUDING params. We delegate params responsibility
      # to the test using the OptimizerInfo. OptimizerInput.params is likely None.
      # Can optionally take in device to filter out certain unsupported configs
      optim_inputs_func,
      # A subset of the global-cliquey flags (fused, foreach, differentiable) the optimizer
      # supports. See NOTE: [optimizer kwarg categories] for what global-cliquey means.
      supported_impls: Tuple[str] = ("foreach", "differentiable"),
      # the devices on which the optim supports sparse tensors for params and grads, see SGD
      supports_sparse_on: Tuple[str] = (),
      # the optim only supports one config: sparse grads w/ dense params, see SparseAdam
      only_supports_sparse_grads: bool = False,
      # whether the optimizer.step() function requires a closure to be passed
      step_requires_closure: bool = False,
      # whether the optimizer supports per-param options with parameter groups
      supports_param_groups: bool = True,
      # whether the optimizer supports parameters on multiple devices
      supports_multiple_devices: bool = True,
      skips=(),  # Indicates which tests to skip
      decorators=None,  # Additional decorators to apply to generated tests
      optim_error_inputs_func=None,  # Function to generate optim inputs that error
  ):
      self.optim_cls = optim_cls
      self.optim_inputs_func = optim_inputs_func
      self.supported_impls = supported_impls
      self.supports_sparse_on = supports_sparse_on
      self.only_supports_sparse_grads = only_supports_sparse_grads
      self.step_requires_closure = step_requires_closure
      self.supports_param_groups = supports_param_groups
      self.supports_multiple_devices = supports_multiple_devices
      self.decorators = (
          *(decorators if decorators else []),
          *(skips if skips else []),
      )
      self.optim_error_inputs_func = optim_error_inputs_func
  
imports: import functools
  import itertools
  import math
  import unittest
  from copy import deepcopy
  from enum import Enum
  from typing import Any, Dict, List, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn import Parameter
  from torch.optim import Adadelta, Adagrad, Adam, Adamax, AdamW, ASGD, LBFGS, NAdam, Optimizer, RAdam, RMSprop, Rprop, SGD, SparseAdam
  from torch.testing._internal.common_device_type import tol, toleranceOverride
  from torch.testing._internal.common_methods_invocations import DecorateInfo
  from torch.testing._internal.common_utils import _TestParametrizer, set_single_threaded_if_parallel_tbb, skipIfMps, skipIfTorchDynamo, TEST_WITH_TORCHDYNAMO
  from torch.utils._foreach_utils import _get_foreach_kernels_supported_devices, _get_fused_kernels_supported_devices
label_desc: Use image node_id 1 to create a new OptimizerInfo object  with example: obj = OptimizerInfo(optim_cls)