§
    “©ºj%I  ã                   óV  — d dl mZ d dlmZ d dlmZmZmZ d dlZd dl	m
Z
 d dlZd dlmZ d dlmZ d dlmZmZ d d	lmZ d d
lmZ d dlmZmZmZ d dlmZ d dlmZ d dl m!Z! d dl"m#Z#m$Z$m%Z%m&Z&m'Z' d dl(m)Z)m*Z* d dl+m,Z, d dl-m.Z. d dl/m0Z0 d dl1m2Z2 d dl3m4Z4 d dl5m6Z6  G d„ de¦  «        Z7dS )é    ©ÚOrderedDict)ÚIterator)ÚAnyÚOptionalÚUnionN)ÚWarningCache)Úmove_data_to_device)ÚBasePredictionWriter)Ú_DataFetcherÚ_DataLoaderIterDataFetcher)Ú_Loop)Ú	_Progress)Ú_no_grad_contextÚ_select_data_fetcherÚ"_verify_dataloader_idx_requirement)Ú_IndexBatchSamplerWrapper)Ú_MultiProcessingLauncher)Úcall)Ú_check_dataloader_iterableÚ_DataLoaderSourceÚ_parse_num_batchesÚ_process_dataloaderÚ_request_dataloader)ÚRunningStageÚ	TrainerFn)ÚCombinedLoader)Úhas_len_all_ranks)ÚMisconfigurationException)Ú_ModuleMode)Úis_param_in_hook_signature)Ú_PREDICT_OUTPUTc            
       ó:  ‡ — e Zd ZdZd*dddeddfˆ fd„Zedefd	„¦   «         Zej        d+d
e	e         ddfd„¦   «         Zede
e         fd„¦   «         Zedefd„¦   «         Zedefd„¦   «         Zede	e         fd„¦   «         Zd,d„Zd,d„Zd,d„Zde	e         fd„Zd,d„Zdededede	e         ddf
d„Zdedede	e         defd„Zdededefd„Zdede
e
e                  fd„Z dededefd „Z!d,d!„Z"d,d"„Z#d,d#„Z$d,d$„Z%d,d%„Z&d,d&„Z'de	e         fd'„Z(d,d(„Z)d,d)„Z*ˆ xZ+S )-Ú_PredictionLoopz'Top-level loop where prediction starts.TÚtrainerz
pl.TrainerÚinference_modeÚreturnNc                 ód  •— t          ¦   «                              |¦  «         || _        g | _        g | _        t          ¦   «         | _        g | _        t          ¦   «         | _	        t          d d¦  «        | _        d | _        d | _        d | _        g | _        d| _        t#          ¦   «         | _        d S )NÚpredict_dataloaderF)ÚsuperÚ__init__r&   Úepoch_batch_indicesÚcurrent_batch_indicesr   Úbatch_progressÚmax_batchesr	   Ú_warning_cacher   Ú_data_sourceÚ_combined_loaderÚ_data_fetcherÚ_resultsÚ_predictionsÚ_return_predictionsr    Ú_module_mode)Úselfr%   r&   Ú	__class__s      €úw/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/pytorch_lightning/loops/prediction_loop.pyr+   z_PredictionLoop.__init__2   sŸ   ø€ Ý‰Œ×Ò˜Ñ!Ô!Ð!Ø,ˆÔà:<ˆÔ Ø02ˆÔ"Ý'™kœkˆÔØ46ˆÔå*™nœnˆÔÝ-¨dÐ4HÑIÔIˆÔØ:>ˆÔØ59ˆÔØˆŒØ-/ˆÔØ#(ˆÔ Ý'™MœMˆÔÐÐó    c                 ó   — | j         S )z)Whether to return the predictions or not.)r6   ©r8   s    r:   Úreturn_predictionsz"_PredictionLoop.return_predictionsD   s   € ð Ô'Ð'r;   r>   c                 óÈ   — t          | j        j        j        t          ¦  «         }|r/|s-t          d|› dt          | j        j        ¦  «        › d�¦  «        ‚|€|n|| _        d S )Nzb`return_predictions` should be set to `False` when using the strategies that spawn or fork. Found z with strategy ú.)Ú
isinstancer%   ÚstrategyÚlauncherr   r   Útyper6   )r8   r>   Úreturn_supporteds      r:   r>   z"_PredictionLoop.return_predictionsI   s–   € õ  *¨$¬,Ô*?Ô*HÕJbÑcÔcÐcÐØð 	Ð&6ð 	Ý+ð\Ø,ð\ð \Ý=AÀ$Ä,ÔBWÑ=XÔ=Xð\ð \ð \ñô ð ð
 8JÐ7QÐ#3Ð#3ÐWiˆÔ Ð Ð r;   c                 ód   — | j         g k    r| j         S | j        dk    r| j         d         n| j         S )zThe cached predictions.é   r   )r5   Únum_dataloadersr=   s    r:   Úpredictionsz_PredictionLoop.predictionsU   s>   € ð Ô Ò"Ð"ØÔ$Ð$Ø'+Ô';¸qÒ'@Ð'@ˆtÔ  Ô#Ð#ÀdÔFWÐWr;   c                 ó@   — | j         }|€J ‚t          |j        ¦  «        S )z-Returns the number of prediction dataloaders.)r2   ÚlenÚ	flattened)r8   Úcombined_loaders     r:   rH   z_PredictionLoop.num_dataloaders\   s)   € ð Ô/ˆØÐ*Ð*Ð*Ý�?Ô,Ñ-Ô-Ð-r;   c                 ó2   — t          | j        ¦  «        dk    S )Nr   )Úsumr/   r=   s    r:   Úskipz_PredictionLoop.skipc   s   € å�4Ô#Ñ$Ô$¨Ò)Ð)r;   c                 ó  — |                       ¦   «          | j        rd S |                      ¦   «          |                      ¦   «          | j        }|€J ‚	 	 t          |t          ¦  «        r%t          |¦  «        }|j        }|j	        }|j
        }nd }t          |¦  «        \  }}}|j        | j        _        |                      ||||¦  «         n# t          $ r
 Y d| _        nw xY w	 d| _        n# d| _        w xY wŒ§|                      ¦   «         S )NTF)Ú
setup_datarP   ÚresetÚon_run_startr3   rA   r   ÚnextÚ_batchÚ
_batch_idxÚ_dataloader_idxÚdoner.   Úis_last_batchÚ_predict_stepÚStopIterationÚ_restartingÚ
on_run_end)r8   Údata_fetcherÚdataloader_iterÚbatchÚ	batch_idxÚdataloader_idxs         r:   Úrunz_PredictionLoop.rung   sD  € à�ŠÑÔÐØŒ9ð 	Ø�4Ø�
Š
‰ŒˆØ×ÒÑÔÐØÔ)ˆØÐ'Ð'Ð'ð	)ð)Ý˜lÕ,FÑGÔGð JÝ&*¨<Ñ&8Ô&8�Oà(Ô/�EØ ,Ô 7�IØ%1Ô%A�N�Nà&*�OÝ7;¸LÑ7IÔ7IÑ4�E˜9 nØ4@Ô4E�Ô#Ô1à×"Ò" 5¨)°^À_ÑUÔUÐUÐUøÝ ð ð ð àà#(�Ô Ð ð	øøøð Vð
 $)�Ô Ð ø 5�Ô Ð(Ð(Ð(Ð(ð%	)ð& �ŠÑ Ô Ð s+   ÁA8C ÃC, Ã
C ÃC, ÃC Ã C, Ã,	C5c                 óÌ  — | j         }|j        dk    rd S | j        }t          |¦  «        }|j                             d¦  «         t          |t          ¦  «        st          |d¦  «        }n|}|j        j	        }|j
        �||j
        j	        z  }t          j        }t          j        }g }g | _        |j        D ]ž}t!          |||¦  «         t#          ||||¦  «        }|                     |¦  «         t'          ||j        |¦  «        rt)          |¦  «        nt+          d¦  «        }	t-          ||	|j        ¦  «        }
| j                             |
¦  «         ŒŸ||_        || _        d S )Nr   zpredict_dataloader()Ú
sequentialÚinf)r%   Úlimit_predict_batchesr1   r   rB   ÚbarrierrA   r   Úlightning_moduleÚ2allow_zero_length_dataloader_with_multiple_devicesÚ
datamoduler   Ú
PREDICTINGr   r/   rL   r   r   Úappendr   rK   Úfloatr   r2   )r8   r%   ÚsourceÚdataloadersrM   Úallow_zero_lengthÚ
trainer_fnÚstageÚdlÚlengthÚnum_batchess              r:   rR   z_PredictionLoop.setup_data…   ss  € Ø”,ˆàÔ(¨AÒ-Ð-ØˆFàÔ"ˆÝ)¨&Ñ1Ô1ˆØÔ× Ò Ð!7Ñ8Ô8Ð8å˜+¥~Ñ6Ô6ð 	*Ý,¨[¸,ÑGÔGˆOˆOà)ˆOà#Ô4ÔgÐØÔÐ)Ø Ô!3Ô!fÑfÐåÔ)ˆ
ÝÔ'ˆØˆØˆÔØ!Ô+ð 	1ð 	1ˆBÝ& r¨6°:Ñ>Ô>Ð>Ý$ W¨j¸%ÀÑDÔDˆBØ×Ò˜rÑ"Ô"Ð"õ !2°"°gÔ6FÐHYÑ ZÔ ZÐl•S˜‘W”W�WÕ`eÐfkÑ`lÔ`lˆFÝ,¨U°F¸GÔ<YÑZÔZˆKØÔ×#Ò# KÑ0Ô0Ð0Ð0Ø$/ˆÔ!Ø /ˆÔÐÐr;   c                 óR  — | j                              ¦   «          | j        j        j        €J ‚t          | j        | j        j        j        ¦  «        }| j        }|€J ‚|j        dk    rt          d¦  «        ‚| j	        |_
        |                     |¦  «         t          |¦  «         |xj        | j         j        j        z  c_        | j        |_        | j        |_        || _        | j        }d„ t-          |¦  «        D ¦   «         | _        d„ t-          |¦  «        D ¦   «         | _        dS )z4Resets the internal state of the loop for a new run.Nrf   zO`trainer.predict()` only supports the `CombinedLoader(mode="sequential")` mode.c                 ó   — g | ]}g ‘ŒS © rz   ©Ú.0Ú_s     r:   ú
<listcomp>z)_PredictionLoop.reset.<locals>.<listcomp>¿   s   € Ð#GÐ#GÐ#G¨1 BÐ#GÐ#GÐ#Gr;   c                 ó   — g | ]}g ‘ŒS rz   rz   r{   s     r:   r~   z)_PredictionLoop.reset.<locals>.<listcomp>À   s   € Ð@Ð@Ð@ A˜RÐ@Ð@Ð@r;   )r.   Úreset_on_runr%   Ústatert   r   r2   Ú_modeÚ
ValueErrorr/   ÚlimitsÚsetupÚiterÚfetchedÚcurrentÚreadyÚ_on_before_fetchÚ_start_profilerÚ_on_after_fetchÚ_stop_profilerr3   rH   Úranger,   r5   )r8   r_   rM   rH   s       r:   rS   z_PredictionLoop.reset¨   s+  € àÔ×(Ò(Ñ*Ô*Ð*àŒ|Ô!Ô'Ð3Ð3Ð3Ý+¨D¬L¸$¼,Ô:LÔ:RÑSÔSˆØÔ/ˆØÐ*Ð*Ð*ØÔ  LÒ0Ð0ÝÐnÑoÔoÐoð "&Ô!1ˆÔØ×Ò˜?Ñ+Ô+Ð+Ýˆ\ÑÔÐð 	ÐÔ Ô 3Ô ;Ô AÑAÐÔØ'+Ô'<ˆÔ$Ø&*Ô&:ˆÔ#Ø)ˆÔàÔ.ˆØ#GÐ#Gµ°oÑ0FÔ0FÐ#GÑ#GÔ#GˆÔ Ø@Ð@­¨Ñ)?Ô)?Ð@Ñ@Ô@ˆÔÐÐr;   c                 ó¦   — |                       ¦   «          |                      ¦   «          |                      ¦   «          |                      ¦   «          dS )z^Calls ``_on_predict_model_eval``, ``_on_predict_start`` and ``_on_predict_epoch_start`` hooks.N)r   Ú_on_predict_model_evalÚ_on_predict_startÚ_on_predict_epoch_startr=   s    r:   rT   z_PredictionLoop.on_run_startÂ   sP   € à×/Ò/Ñ1Ô1Ð1Ø×#Ò#Ñ%Ô%Ð%Ø×ÒÑ Ô Ð Ø×$Ò$Ñ&Ô&Ð&Ð&Ð&r;   c                 ó~   — |                       ¦   «         }|                      ¦   «          |                      ¦   «          |S )zeCalls ``on_predict_epoch_end`` and ``on_predict_end`` hooks and returns results from all dataloaders.)Ú_on_predict_epoch_endÚ_on_predict_endÚ_on_predict_model_train)r8   Úresultss     r:   r^   z_PredictionLoop.on_run_endÉ   s<   € à×,Ò,Ñ.Ô.ˆØ×ÒÑÔÐØ×$Ò$Ñ&Ô&Ð&Øˆr;   c                 óX   — | j         �"| j                              ¦   «          d | _         d S d S ©N)r3   Úteardownr=   s    r:   rš   z_PredictionLoop.teardownÐ   s6   € ØÔÐ)ØÔ×'Ò'Ñ)Ô)Ð)Ø!%ˆDÔÐÐð *Ð)r;   ra   rb   rc   r`   c                 ó  — | j         }| j        }|€J ‚t          |t          ¦  «        x}sN|j                             |¦  «        }|j                             ||¬¦  «        }t          j	        |d||¬¦  «        }| j
                             ¦   «          |s|                      ||¦  «        nd}|                      ||| j        dk    r|nd¦  «        }	t          j        |dg|	                     ¦   «         ¢R Ž  t          j        |dg|	                     ¦   «         ¢R Ž  | j
                             ¦   «          |s|                      |	d¦  «        n|f}
t          j	        |dg|
¢R Ž }|€| j                             d¦  «         | j
                             ¦   «          |r9|j        }|j        }|j        }|                      ||| j        dk    r|nd¦  «        }	t          j        |d	|g|	                     ¦   «         ¢R Ž  t          j        |d	|g|	                     ¦   «         ¢R Ž  | j
                             ¦   «          | j        s|rB| j        |                              t=          |t?          j         d
¦  «        ¦  «        ¦  «         dS dS )aŠ  Runs the actual predict step together with all the necessary bookkeeping and the hooks tied to it.

        Args:
            batch: the current batch to run the prediction on
            batch_idx: The index of the current batch.
            dataloader_idx: the index of the dataloader producing the current batch.
            dataloader_iter: The iterator if using this step flavor.

        N)rc   Úbatch_to_deviceFrG   Úon_predict_batch_startÚpredict_stepzBpredict returned None if it was on purpose, ignore this warning...Úon_predict_batch_endÚcpu)!r%   r3   rA   r   Úprecision_pluginÚconvert_inputrj   Ú_on_before_batch_transferr   Ú_call_strategy_hookr.   Úincrement_readyÚ!_store_data_for_prediction_writerÚ_build_kwargsrH   Ú_call_callback_hooksÚvaluesÚ_call_lightning_module_hookÚincrement_startedÚ!_build_step_args_from_hook_kwargsr0   ÚwarnÚincrement_processedrV   rW   rX   Úincrement_completedr6   r5   rn   r
   ÚtorchÚdevice)r8   ra   rb   rc   r`   r%   r_   Úusing_dataloader_iterÚany_on_epochÚhook_kwargsÚ	step_argsrI   s               r:   r[   z_PredictionLoop._predict_stepÕ   sÝ  € ð ”,ˆØÔ)ˆØÐ'Ð'Ð'å)3°LÕB\Ñ)]Ô)]Ð]Ð%ð 	oØÔ,×:Ò:¸5ÑAÔAˆEØÔ,×FÒFÀuÐ]kÐFÑlÔlˆEÝÔ,¨WÐ6GÈÐ_mÐnÑnÔnˆEàÔ×+Ò+Ñ-Ô-Ð-ð VkÐuˆD×2Ò2°9¸nÑMÔMÐMÐpuð 	ð ×(Ò(¨°	ÈTÔMaÐdeÒMeÐMe¸>¸>ÐkoÑpÔpˆåÔ! 'Ð+CÐ[Àk×FXÒFXÑFZÔFZÐ[Ð[Ð[Ð[ÝÔ(¨Ð2JÐbÈ[×M_ÒM_ÑMaÔMaÐbÐbÐbÐbàÔ×-Ò-Ñ/Ô/Ð/ð
 )ð$ˆD×2Ò2°;ÀÑOÔOÐOà!Ð#ð 	õ
 Ô.¨w¸ÐSÈÐSÐSÐSˆØÐØÔ×$Ò$Ð%iÑjÔjÐjàÔ×/Ò/Ñ1Ô1Ð1à ð 	uà Ô'ˆEØ$Ô/ˆIØ)Ô9ˆNØ×,Ò,¨U°IÐQUÔQeÐhiÒQiÐQi¸~¸~ÐosÑtÔtˆKåÔ! 'Ð+AÀ;ÐfÐQ\×QcÒQcÑQeÔQeÐfÐfÐfÐfÝÔ(¨Ð2HÈ+ÐmÐXc×XjÒXjÑXlÔXlÐmÐmÐmÐmàÔ×/Ò/Ñ1Ô1Ð1àÔ#ð 	l |ð 	lØÔ˜nÔ-×4Ò4Õ5HÈÕV[ÔVbÐchÑViÔViÑ5jÔ5jÑkÔkÐkÐkÐkð	lð 	lr;   c                 ó>   — t          d|fd|fg¦  «        }|�||d<   |S )aÈ  Assembles the keyword arguments for the ``predict_step``

        Args:
            batch: the current batch to run the prediction on
            batch_idx: the index of the current batch.
            dataloader_idx: the index of the dataloader producing the current batch. None if not multiple dataloaders
                in sequential mode.

        Returns:
            the dictionary containing all the keyboard arguments for the predict step

        ra   rb   Nrc   r   )r8   ra   rb   rc   Ústep_kwargss        r:   r§   z_PredictionLoop._build_kwargs  s7   € õ " G¨UÐ#3°kÀ9Ð5MÐ"NÑOÔOˆØÐ%Ø,:ˆKÐ(Ñ)ØÐr;   r´   Ústep_hook_namec                 óð   — |                      ¦   «         }t          | j        j        |¦  «        }t	          |dd¬¦  «        s|                     dd¦  «         t          |                     ¦   «         ¦  «        S )z/Helper method to build args for `predict_step`.rb   é   )Úmin_argsN)ÚcopyÚgetattrr%   rj   r!   ÚpopÚtupler©   )r8   r´   r¸   ÚkwargsÚstep_hook_fxs        r:   r¬   z1_PredictionLoop._build_step_args_from_hook_kwargs&  sh   € à×!Ò!Ñ#Ô#ˆÝ˜tœ|Ô<¸nÑMÔMˆÝ)¨,¸ÈaÐPÑPÔPð 	*Ø�JŠJ�{ DÑ)Ô)Ð)Ý�V—]’]‘_”_Ñ%Ô%Ð%r;   Ú
dataloaderc                 óÀ   — t          |dd¦  «        }t          |t          ¦  «        s2| j                             dt          |¦  «        j        › d�¦  «         g S |j        S )z·Returns a reference to the seen batch indices if the dataloader has a batch sampler wrapped by our
        :class:`~pytorch_lightning.overrides.distributed._IndexBatchSamplerWrapper`.Úbatch_samplerNz@Couldn't infer the batch indices fetched from your dataloader: `ú`)r½   rA   r   r0   r­   rD   Ú__name__Úseen_batch_indices)r8   rÂ   rÄ   s      r:   Ú_get_batch_indicesz"_PredictionLoop._get_batch_indices.  sn   € õ   
¨O¸TÑBÔBˆÝ˜-Õ)BÑCÔCð 	ØÔ×$Ò$ØoÕSWÐXbÑScÔScÔSlÐoÐoÐoñô ð ð ˆIØÔ/Ð/r;   c                 óf  — d„ | j         j        D ¦   «         }t          d„ |D ¦   «         ¦  «        }t          d„ |D ¦   «         ¦  «        }|s|rd| j        }|€J ‚|j        |         }|                      |¦  «        }|s|S ||         }|r | j        |                              |¦  «         |r|| _        |S )Nc                 ó<   — g | ]}t          |t          ¦  «        ¯|‘ŒS rz   )rA   r   ©r|   Úcbs     r:   r~   zE_PredictionLoop._store_data_for_prediction_writer.<locals>.<listcomp>:  s)   € ÐjÐjÐj RÅZÐPRÕThÑEiÔEiÐj˜bÐjÐjÐjr;   c              3   ó.   K  — | ]}|j         j        V — Œd S r™   )ÚintervalÚon_epochrË   s     r:   ú	<genexpr>zD_PredictionLoop._store_data_for_prediction_writer.<locals>.<genexpr>;  ó'   è è € ÐMÐM°B˜2œ;Ô/ÐMÐMÐMÐMÐMÐMr;   c              3   ó.   K  — | ]}|j         j        V — Œd S r™   )rÎ   Úon_batchrË   s     r:   rÐ   zD_PredictionLoop._store_data_for_prediction_writer.<locals>.<genexpr><  rÑ   r;   )	r%   Ú	callbacksÚanyr2   rL   rÈ   r,   rn   r-   )	r8   rb   rc   Úprediction_writersr³   Úany_on_batchrM   rÂ   Úbatch_indicess	            r:   r¦   z1_PredictionLoop._store_data_for_prediction_writer9  sí   € ØjÐj¨4¬<Ô+AÐjÑjÔjÐÝÐMÐMÐ:LÐMÑMÔMÑMÔMˆÝÐMÐMÐ:LÐMÑMÔMÑMÔMˆØð 	;˜<ð 	;Ø"Ô3ˆOØ"Ð.Ð.Ð.Ø(Ô2°>ÔBˆJØ ×3Ò3°JÑ?Ô?ˆMØ ð $ð $Ð#Ø)¨)Ô4ˆMØð OØÔ(¨Ô8×?Ò?ÀÑNÔNÐNØð ;Ø-:�Ô*ØÐr;   c                 óp   — | j         j                             dt          | ¦  «        j        › d�¦  «         d S ©Nú[z].predict_next)r%   ÚprofilerÚstartrD   rÆ   r=   s    r:   rŠ   z _PredictionLoop._on_before_fetchM  s6   € ØŒÔ×#Ò#Ð$K­¨T©
¬
Ô(;Ð$KÐ$KÐ$KÑLÔLÐLÐLÐLr;   c                 óp   — | j         j                             dt          | ¦  «        j        › d�¦  «         d S rÚ   )r%   rÜ   ÚstoprD   rÆ   r=   s    r:   rŒ   z_PredictionLoop._on_after_fetchP  s8   € ð 	ŒÔ×"Ò"Ð#J¥t¨D¡z¤zÔ':Ð#JÐ#JÐ#JÑKÔKÐKÐKÐKr;   c                 ó’   — | j         }t          j        |d¦  «         t          j        |d¦  «         t          j        |d¦  «         dS )z!Calls ``on_predict_start`` hooks.Úon_predict_startN)r%   r   r¨   rª   r¤   ©r8   r%   s     r:   r‘   z!_PredictionLoop._on_predict_startU  sK   € à”,ˆÝÔ! 'Ð+=Ñ>Ô>Ð>ÝÔ(¨Ð2DÑEÔEÐEÝÔ  Ð*<Ñ=Ô=Ð=Ð=Ð=r;   c                 ó‚   — | j                              | j        j        ¦  «         t	          j        | j        d¦  «         d S )NÚon_predict_model_eval)r7   Úcapturer%   rj   r   rª   r=   s    r:   r�   z&_PredictionLoop._on_predict_model_eval\  s:   € ØÔ×!Ò! $¤,Ô"?Ñ@Ô@Ð@ÝÔ(¨¬Ð7NÑOÔOÐOÐOÐOr;   c                 óN   — | j                              | j        j        ¦  «         d S r™   )r7   Úrestorer%   rj   r=   s    r:   r–   z'_PredictionLoop._on_predict_model_train`  s$   € ØÔ×!Ò! $¤,Ô"?Ñ@Ô@Ð@Ð@Ð@r;   c                 óh   — | j         }t          j        |d¦  «         t          j        |d¦  «         dS )z'Calls ``on_predict_epoch_start`` hooks.Úon_predict_epoch_startN)r%   r   r¨   rª   râ   s     r:   r’   z'_PredictionLoop._on_predict_epoch_startc  s7   € à”,ˆÝÔ! 'Ð+CÑDÔDÐDÝÔ(¨Ð2JÑKÔKÐKÐKÐKr;   c                 ó„   — | j         }t          j        |d¦  «         t          j        |d¦  «         | j        r| j        S dS )zlCalls ``on_predict_epoch_end`` hook.

        Returns:
            the results for all dataloaders

        Úon_predict_epoch_endN)r%   r   r¨   rª   r>   rI   râ   s     r:   r”   z%_PredictionLoop._on_predict_epoch_endi  sL   € ð ”,ˆÝÔ! 'Ð+AÑBÔBÐBÝÔ(¨Ð2HÑIÔIÐIàÔ"ð 	$ØÔ#Ð#Øˆtr;   c                 ó¼   — | j         sg | _        g | _        | j        }t	          j        |d¦  «         t	          j        |d¦  «         t	          j        |d¦  «         dS )zBResets previous gradient status and calls ``on_predict_end`` hook.Úon_predict_endN)r>   r5   r,   r%   r   r¨   rª   r¤   râ   s     r:   r•   z_PredictionLoop._on_predict_endx  sf   € àÔ&ð 	#Ø "ˆDÔØ#%ˆÔ à”,ˆåÔ! 'Ð+;Ñ<Ô<Ð<ÝÔ(¨Ð2BÑCÔCÐCÝÔ  Ð*:Ñ;Ô;Ð;Ð;Ð;r;   c                 óD  — | j         }| j        €J ‚t          d| j        j        dk    o%| j        dk    ot          | j        t          ¦  «         t          j	        |j
        ¦  «         t          d| j        j        dk    o
| j        dk    t          j	        |j
        ¦  «         d S )N)rž   rf   rG   )r�   rŸ   )r%   r2   r   r‚   rH   rA   r3   r   r   rm   rj   râ   s     r:   r   z2_PredictionLoop._verify_dataloader_idx_requirement„  s»   € Ø”,ˆØÔ$Ð0Ð0Ð0Ý*ØØÔ!Ô'¨<Ò7ð OØÔ$ qÒ(ðOå˜tÔ1Õ3MÑNÔNÐNÝÔ#ØÔ$ñ	
ô 	
ð 	
õ 	+Ø>ØÔ!Ô'¨<Ò7ÐT¸DÔ<PÐSTÒ<TÝÔ#ØÔ$ñ		
ô 	
ð 	
ð 	
ð 	
r;   )Tr™   )r'   N),rÆ   Ú
__module__Ú__qualname__Ú__doc__Úboolr+   Úpropertyr>   Úsetterr   Úlistr   rI   ÚintrH   rP   r   r"   rd   rR   rS   rT   r^   rš   r   r[   r   r§   Ústrr¿   r¬   ÚobjectrÈ   r¦   rŠ   rŒ   r‘   r�   r–   r’   r”   r•   r   Ú__classcell__)r9   s   @r:   r$   r$   /   s¼  ø€ € € € € Ø1Ð1ð*ð * ð *¸dð *Èdð *ð *ð *ð *ð *ð *ð$ ð( Dð (ð (ð (ñ „Xð(ð Ôð	jð 	j°X¸d´^ð 	jÈtð 	jð 	jð 	jñ Ôð	jð ðX˜T #œYð Xð Xð Xñ „XðXð ð. ð .ð .ð .ñ „Xð.ð ð*�dð *ð *ð *ñ „Xð*ð ð!�X˜oÔ.ð !ð !ð !ñ Ôð!ð:!0ð !0ð !0ð !0ðFAð Að Að Að4'ð 'ð 'ð 'ð˜H _Ô5ð ð ð ð ð&ð &ð &ð &ð
=lØð=lØ%(ð=lØ:=ð=lØPXÐYaÔPbð=là	ð=lð =lð =lð =lð~ 3ð °3ð ÈÐQTÌð ÐZeð ð ð ð ð$&¸[ð &ÐZ]ð &Ðbgð &ð &ð &ð &ð	0¨Vð 	0¸¸TÀ#¼Y¼ð 	0ð 	0ð 	0ð 	0ð¸3ð ÐPSð ÐX\ð ð ð ð ð(Mð Mð Mð MðLð Lð Lð Lð
>ð >ð >ð >ðPð Pð Pð PðAð Að Að AðLð Lð Lð Lð x°Ô'@ð ð ð ð ð
<ð 
<ð 
<ð 
<ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r;   r$   )8Úcollectionsr   Úcollections.abcr   Útypingr   r   r   r°   Úlightning_utilitiesr	   Úpytorch_lightningÚplÚlightning_fabric.utilitiesr
   Úpytorch_lightning.callbacksr   Ú pytorch_lightning.loops.fetchersr   r   Úpytorch_lightning.loops.loopr   Ú pytorch_lightning.loops.progressr   Ú!pytorch_lightning.loops.utilitiesr   r   r   Ú'pytorch_lightning.overrides.distributedr   Ú&pytorch_lightning.strategies.launchersr   Úpytorch_lightning.trainerr   Ú3pytorch_lightning.trainer.connectors.data_connectorr   r   r   r   r   Ú pytorch_lightning.trainer.statesr   r   Ú+pytorch_lightning.utilities.combined_loaderr   Ú pytorch_lightning.utilities.datar   Ú&pytorch_lightning.utilities.exceptionsr   Ú)pytorch_lightning.utilities.model_helpersr    Ú+pytorch_lightning.utilities.signature_utilsr!   Ú!pytorch_lightning.utilities.typesr"   r$   rz   r;   r:   ú<module>r     s/  ðð $Ð #Ð #Ð #Ð #Ð #Ø $Ð $Ð $Ð $Ð $Ð $Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'à €€€Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,à Ð Ð Ð Ø :Ð :Ð :Ð :Ð :Ð :Ø <Ð <Ð <Ð <Ð <Ð <Ø UÐ UÐ UÐ UÐ UÐ UÐ UÐ UØ .Ð .Ð .Ð .Ð .Ð .Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø xÐ xÐ xÐ xÐ xÐ xÐ xÐ xÐ xÐ xØ MÐ MÐ MÐ MÐ MÐ MØ KÐ KÐ KÐ KÐ KÐ KØ *Ð *Ð *Ð *Ð *Ð *ðð ð ð ð ð ð ð ð ð ð ð ð ð ð EÐ DÐ DÐ DÐ DÐ DÐ DÐ DØ FÐ FÐ FÐ FÐ FÐ FØ >Ð >Ð >Ð >Ð >Ð >Ø LÐ LÐ LÐ LÐ LÐ LØ AÐ AÐ AÐ AÐ AÐ AØ RÐ RÐ RÐ RÐ RÐ RØ =Ð =Ð =Ð =Ð =Ð =ðe
ð e
ð e
ð e
ð e
�eñ e
ô e
ð e
ð e
ð e
r;   