code: def register(self, numerics_alert):
      
      key = (numerics_alert.device_name, numerics_alert.tensor_name)
      if key in self._data:
        self._data[key].add(numerics_alert)
      else:
        if len(self._data) < self._capacity:
          history = NumericsAlertHistory()
          history.add(numerics_alert)
          self._data[key] = history
docs: Register an alerting numeric event.
  
      Args:
        numerics_alert: An instance of `NumericsAlert`.