docstr: Construct a Stochastic-Gradient-Descent (SGD) optimizer.
  
  Parameters
  ----------
  lr
      Learning rate, default is ``1e-4``.
  inplace
      Whether to update the variables in-place, or to create new variable handles.
      This is only relevant for frameworks with stateful variables such as
      PyTorch.
      Default is ``True``, provided the backend framework supports it.
  stop_gradients
      Whether to stop the gradients of the variables after each gradient step.
      Default is ``True``.
  trace_on_next_step
      Whether to trace the optimizer on the next step. Default is ``False``.
docstr_tok: ["Construct","a","Stochastic-Gradient-Descent","(","SGD",")","optimizer",".","Parameters","--","--","--","--","--","lr","Learning","rate",",","default","is","``","1e-4","``",".","inplace","Whether","to","update","the","variables","in-place",",","or","to","create","new","variable","handles",".","This","is","only","relevant","for","frameworks","with","stateful","variables","such","as","PyTorch",".","Default","is","``","True","``",",","provided","the","backend","framework","supports","it",".","stop_gradients","Whether","to","stop","the","gradients","of","the","variables","after","each","gradient","step",".","Default","is","``","True","``",".","trace_on_next_step","Whether","to","trace","the","optimizer","on","the","next","step",".","Default","is","``","False","``","."]
code: def __init__(
      self,
      lr: float = 1e-4,
      inplace: bool = True,
      stop_gradients: bool = True,
      trace_on_next_step: bool = False,
  ):
      """Construct a Stochastic-Gradient-Descent (SGD) optimizer.
  
      Parameters
      ----------
      lr
          Learning rate, default is ``1e-4``.
      inplace
          Whether to update the variables in-place, or to create new variable handles.
          This is only relevant for frameworks with stateful variables such as
          PyTorch.
          Default is ``True``, provided the backend framework supports it.
      stop_gradients
          Whether to stop the gradients of the variables after each gradient step.
          Default is ``True``.
      trace_on_next_step
          Whether to trace the optimizer on the next step. Default is ``False``.
      """
      Optimizer.__init__(
          self,
          lr,
          inplace,
          stop_gradients,
          trace_on_next_step=trace_on_next_step,
      )
  
imports: import abc
  from typing import Union, Optional, Callable
  import ivy
label_desc: Use image node_id 1 to create a new SGD object from inherited base classes: Optimizer with example: obj = SGD(lr, inplace, stop_gradients, trace_on_next_step)