class_docstr: Helper handler to log model's gradients as scalars.
  Handler iterates over the gradients of named parameters of the model, applies reduction function to each parameter
  produce a scalar and then logs the scalar.
  
  Args:
      model: model to log weights
      reduction: function to reduce parameters into scalar
      tag: common title for all produced plots. For example, "generator"
      show_legend: flag to show legend in the window
  
  Examples:
      .. code-block:: python
  
          from ignite.contrib.handlers.visdom_logger import *
  
          # Create a logger
          vd_logger = VisdomLogger()
  
          # Attach the logger to the trainer to log model's weights norm after each iteration
          vd_logger.attach(
              trainer,
              event_name=Events.ITERATION_COMPLETED,
              log_handler=GradsScalarHandler(model, reduction=torch.norm)
          )
code: def __init__(
      self,
      model: nn.Module,
      reduction: Callable = torch.norm,
      tag: Optional[str] = None,
      show_legend: bool = False,
  ):
      super(GradsScalarHandler, self).__init__(model, reduction, tag)
      _BaseVisDrawer.__init__(self, show_legend=show_legend)
  
imports: import os
  from typing import Any, Callable, cast, Dict, List, Optional, Union
  import torch
  import torch.nn
  from torch.optim import Optimizer
  from ignite.contrib.handlers.base_logger import BaseLogger, BaseOptimizerParamsHandler, BaseOutputHandler, BaseWeightsScalarHandler
  from ignite.engine import Engine, Events
  from ignite.handlers import global_step_from_engine
label_desc: Use image node_id 1 to create a new GradsScalarHandler object from inherited base classes: BaseWeightsScalarHandler, _BaseVisDrawer with example: obj = GradsScalarHandler(model, reduction, tag, show_legend)