code: def _write_median_gradient(self)->None:
          "Writes the median of the gradients to Tensorboard."
          median_gradient = statistics.median(x.data.median() for x in self.gradients)
          self._add_gradient_scalar('median_gradient', scalar_value=median_gradientf _write_median_gradient(self)->None:
          "Writes the median of the gradients to Tensorboard."
          median_gradient = statistics.median(x.data.median() for x in self.gradients)
          self._add_gradient_scalar('median_gradient', scalar_value=median_gradient)
docs: Writes the median of the gradients to Tensorboard.