{"record":{"id":"d96af39e8f6dc99c","repo":"tensorflow/models","slug":"full-loss-computation-is-not-yet-supported","errorCode":null,"errorMessage":"Full loss computation is not yet supported.","messagePattern":"Full loss computation is not yet supported\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"official/recommendation/uplift/metrics/poisson_metrics.py","lineNumber":159,"sourceCode":"      name: str = \"poisson_log_loss_mean_baseline\",\n      dtype: tf.DType = tf.float32,\n  ):\n    \"\"\"Initializes the instance.\n\n    Args:\n      compute_full_loss: Specifies whether to compute the full poisson log loss\n        for the mean predictor or not. Defaults to `False`.\n      slice_by_treatment: Specifies whether the loss should be sliced by the\n        treatment indicator tensor. If `True`, the metric's result will return\n        the loss values sliced by the treatment group. Note that this can only\n        be set to `True` when `y_pred` is of type `TwoTowerTrainingOutputs`.\n      name: Optional name for the instance.\n      dtype: Optional data type for the instance.\n    \"\"\"\n    super().__init__(name=name, dtype=dtype)\n\n    if compute_full_loss:\n      raise NotImplementedError(\"Full loss computation is not yet supported.\")\n\n    self._compute_full_loss = compute_full_loss\n    self._slice_by_treatment = slice_by_treatment\n\n    if slice_by_treatment:\n      self._mean_label = treatment_sliced_metric.TreatmentSlicedMetric(\n          metric=tf_keras.metrics.Mean(name=name, dtype=dtype)\n      )\n    else:\n      self._mean_label = tf_keras.metrics.Mean(name=name, dtype=dtype)\n\n  def update_state(\n      self,\n      y_true: tf.Tensor,\n      y_pred: types.TwoTowerTrainingOutputs | tf.Tensor | None = None,\n      sample_weight: tf.Tensor | None = None,\n  ):\n    is_treatment = {}","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/uplift/metrics/poisson_metrics.py#L141-L177","documentation":"Error \"Full loss computation is not yet supported.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/uplift/metrics/poisson_metrics.py:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}