def _predict_batch(self, x: "Tensor", y: "Tensor", mask_frequency: "Tensor") -> dict[str, "Tensor"]:
        """Create prediction operation for a batch of padded inputs."""
        import tensorflow.compat.v1 as tf1

        # create decoder inputs
        decoder_inputs = self._create_decoder_input(x, y, mask_frequency)

        # call decoder
        if self._metrics is None:
            with self._cluster, tf1.device(self._cluster.GetPlacer()):  # type: ignore
                self._metrics = self._task.FPropDefaultTheta(decoder_inputs)  # type: ignore
        predictions = self._task.Decode(decoder_inputs)  # type: ignore

        return predictions
Create prediction operation for a batch of padded inputs.
art/estimators/speech_recognition/tensorflow_lingvo.py