code: def __init__(self, params: List[Tensor], lr: float):
      # if it's None, but being put into an optimizer, set it to True
      for x in params:
          if x.requires_grad is None:
              x.requires_grad = True
  
      self.params: List[Tensor] = dedup(
          [x for x in params if x.requires_grad]
      )
      assert (
          len(self.params) != 0
      ), "optimizer must have at least one param"
      self.device = self.params[0].device
      self.buffers: List[Tensor] = dedup(
          [x for x in params if not x.requires_grad]
      )  # buffers are still realized
      self.lr = (
          lr
          if getenv("CONST_LR")
          else Tensor(
              [lr], requires_grad=False, device=self.device
          ).contiguous()
      )
  
file_path: tinygrad/tinygrad/nn/optim.py
imports: from typing import List
  from tinygrad.helpers import dedup, getenv
  from tinygrad.tensor import Tensor
label_desc: Use image node_id 1 to create a new Optimizer object  with example: obj = Optimizer(params, lr)