class_docstr: Helper handler to log model's weights as histograms.
  
  Args:
      model: model to log weights
      tag: common title for all produced plots. For example, 'generator'
      whitelist: specific weights to log. Should be list of model's submodules
          or parameters names, or a callable which gets weight along with its name
          and determines if it should be logged. Names should be fully-qualified.
          For more information please refer to `PyTorch docs
          <https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.get_submodule>`_.
          If not given, all of model's weights are logged.
  
  Examples:
      .. code-block:: python
  
          from ignite.contrib.handlers.clearml_logger import *
  
          # Create a logger
  
          clearml_logger = ClearMLLogger(
              project_name="pytorch-ignite-integration",
              task_name="cnn-mnist"
          )
  
          # Attach the logger to the trainer to log model's weights norm after each iteration
          clearml_logger.attach(
              trainer,
              event_name=Events.ITERATION_COMPLETED,
              log_handler=WeightsHistHandler(model)
          )
  
      .. code-block:: python
  
          from ignite.contrib.handlers.clearml_logger import *
  
          clearml_logger = ClearMLLogger(
              project_name="pytorch-ignite-integration",
              task_name="cnn-mnist"
          )
  
          # Log weights of `fc` layer
          weights = ['fc']
  
          # Attach the logger to the trainer to log weights norm after each iteration
          clearml_logger.attach(
              trainer,
              event_name=Events.ITERATION_COMPLETED,
              log_handler=WeightsHistHandler(model, whitelist=weights)
          )
  
      .. code-block:: python
  
          from ignite.contrib.handlers.clearml_logger import *
  
          clearml_logger = ClearMLLogger(
              project_name="pytorch-ignite-integration",
              task_name="cnn-mnist"
          )
  
          # Log weights which name include 'conv'.
          weight_selector = lambda name, p: 'conv' in name
  
          # Attach the logger to the trainer to log weights norm after each iteration
          clearml_logger.attach(
              trainer,
              event_name=Events.ITERATION_COMPLETED,
              log_handler=WeightsHistHandler(model, whitelist=weight_selector)
          )
  
  ..  versionchanged:: 0.4.9
      optional argument `whitelist` added.
class_docstr_tok: ["Helper","handler","to","log","model","'s","weights","as","histograms",".","Args",":","model",":","model","to","log","weights","tag",":","common","title","for","all","produced","plots",".","For","example",",","'generator'","whitelist",":","specific","weights","to","log",".","Should","be","list","of","model","'s","submodules","or","parameters","names",",","or","a","callable","which","gets","weight","along","with","its","name","and","determines","if","it","should","be","logged",".","Names","should","be","fully-qualified",".","For","more","information","please","refer","to","`","PyTorch","docs","<","https",":","\/\/pytorch.org\/docs\/stable\/generated\/torch.nn.Module.html","#","torch.nn.Module.get_submodule",">","`","_",".","If","not","given",",","all","of","model","'s","weights","are","logged",".","Examples",":","..","code-block",":",":","python","from","ignite.contrib.handlers.clearml_logger","import","*","#","Create","a","logger","clearml_logger","=","ClearMLLogger","(","project_name=","''","pytorch-ignite-integration","''",",","task_name=","''","cnn-mnist","''",")","#","Attach","the","logger","to","the","trainer","to","log","model","'s","weights","norm","after","each","iteration","clearml_logger.attach","(","trainer",",","event_name=Events.ITERATION_COMPLETED",",","log_handler=WeightsHistHandler","(","model",")",")","..","code-block",":",":","python","from","ignite.contrib.handlers.clearml_logger","import","*","clearml_logger","=","ClearMLLogger","(","project_name=","''","pytorch-ignite-integration","''",",","task_name=","''","cnn-mnist","''",")","#","Log","weights","of","`","fc","`","layer","weights","=","[","'fc","'","]","#","Attach","the","logger","to","the","trainer","to","log","weights","norm","after","each","iteration","clearml_logger.attach","(","trainer",",","event_name=Events.ITERATION_COMPLETED",",","log_handler=WeightsHistHandler","(","model",",","whitelist=weights",")",")","..","code-block",":",":","python","from","ignite.contrib.handlers.clearml_logger","import","*","clearml_logger","=","ClearMLLogger","(","project_name=","''","pytorch-ignite-integration","''",",","task_name=","''","cnn-mnist","''",")","#","Log","weights","which","name","include","'conv","'",".","weight_selector","=","lambda","name",",","p",":","'conv","'","in","name","#","Attach","the","logger","to","the","trainer","to","log","weights","norm","after","each","iteration","clearml_logger.attach","(","trainer",",","event_name=Events.ITERATION_COMPLETED",",","log_handler=WeightsHistHandler","(","model",",","whitelist=weight_selector",")",")","..","versionchanged",":",":","0.4.9","optional","argument","`","whitelist","`","added","."]
code: def __call__(
      self,
      engine: Engine,
      logger: ClearMLLogger,
      event_name: Union[str, Events],
  ) -> None:
      if not isinstance(logger, ClearMLLogger):
          raise RuntimeError(
              "Handler 'WeightsHistHandler' works only with ClearMLLogger"
          )
  
      global_step = engine.state.get_event_attrib_value(event_name)
      tag_prefix = f"{self.tag}/" if self.tag else ""
      for name, p in self.weights:
          title_name, _, series_name = name.partition(".")
  
          logger.grad_helper.add_histogram(
              title=f"{tag_prefix}weights_{title_name}",
              series=series_name,
              step=global_step,
              hist_data=p.data.cpu().numpy(),
          )
  
imports: import os
  import tempfile
  import warnings
  from collections import defaultdict
  from datetime import datetime
  from enum import Enum
  from typing import Any, Callable, DefaultDict, List, Mapping, Optional, Tuple, Type, Union
  from torch.optim import Optimizer
  import ignite.distributed
  from ignite.contrib.handlers.base_logger import BaseLogger, BaseOptimizerParamsHandler, BaseOutputHandler, BaseWeightsHandler, BaseWeightsScalarHandler
  from ignite.engine import Engine, Events
  from ignite.handlers import global_step_from_engine
  from ignite.handlers.checkpoint import DiskSaver
label_desc: Use image node_id 1 for calling the WeightsHistHandler obj's underlying member method code with example usage: obj.__call__(engine, logger, event_name) without return types