def fill_entry(
        self,
        name: str,
        prediction: torch.Tensor,
        uncertainty: Optional[torch.Tensor] = None,
        target_properties: Optional[Dict[str, Any]] = None,
    ) -> None:
        """Fill a single entry with prediction data.

        Args:
            name: Name of the entry to fill
            prediction: Tensor containing the prediction for this entry
            uncertainty: Optional tensor containing uncertainty values
            target_properties: Properties of the predicted targets
        """
        if name not in self._entry_map:
            raise KeyError(f"Unknown entry name: {name}")
        if name in self._filled_entries:
            raise RuntimeError(f"Entry {name} already filled")

        entry = self._entry_map[name]

        # Process prediction
        array = prediction.squeeze().cpu().numpy()
        img_array = array

        # Prepare image visualization
        prediction_space = target_properties[name].get("prediction_space", "srgb")
        if prediction_space == "stack":
            pass
        elif prediction_space == "linear":
            up_to_scale = target_properties[name].get("up_to_scale", False)
            if up_to_scale:
                img_array = img_array / max(img_array.max(), 1e-6)
            img_array = img_array ** (1 / 2.2)
        elif prediction_space == "srgb":
            pass

        # Create image
        img_array = (img_array * 255).astype(np.uint8)
        img_array = chw2hwc(img_array)  # Convert from CHW to HWC format
        image = Image.fromarray(img_array)

        # Process uncertainty if available
        uncert_array = (
            uncertainty.squeeze().cpu().numpy() if uncertainty is not None else None
        )

        # Update entry
        entry.array = array
        entry.image = image
        entry.uncertainty = uncert_array

        self._filled_entries.add(name)
Fill a single entry with prediction data.

        Args:
            name: Name of the entry to fill
            prediction: Tensor containing the prediction for this entry
            uncertainty: Optional tensor containing uncertainty values
            target_properties: Properties of the predicted targets
        
marigold/marigold_iid_pipeline.py