docs: def set_monitoring(module):
      """ Defines the monitoring method on the module. """
      def monitoring(is_monitoring,
                     track_data=None,
                     track_grad=None,
                     track_update=None,
                     track_update_ratio=None):
          """
          Turn monitoring on or off. If any of the keyword arguments
          are not None, they will be overwritten.
          """
          module.is_monitoring = is_monitoring
          module.track_data = track_data if track_data is not None else module.track_data
          module.track_grad = track_grad if track_grad is not None else module.track_grad
          module.track_update = track_update if track_update is not None else module.track_update
          module.track_update_ratio = track_update_ratio if track_update_ratio is not None else module.track_update_ratio
      module.monitoring = monitoring