+
     °³j  ã                   óh   € ^ RI Ht ^ RIt^ RIHu Ht ^ RIHt R
R R lltRR R llt	RR R	 llt
R# )é    )ÚOptionalN)ÚTensorc          	      ó^   € V ^8„  d   QhR\         R\         R\        R\        \        ,          /# )é   ÚimgÚabsolute_gridÚmodeÚalign_corners)r   Ústrr   Úbool)Úformats   "Úg/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchvision/models/optical_flow/_utils.pyÚ__annotate__r      s5   € ÷ Wñ W”Vð W¬Fð W¼#ð WÔ[cÔdhÕ[iñ Wó    c                ó:  € V P                   RR w  rEVP                  ^^.RR7      w  rg^V,          V^,
          ,          ^,
          pV^8”  d   ^V,          V^,
          ,          ^,
          p\        P                  ! Wg.RR7      p\        P
                  ! WW#R7      # )z_Same as torch's grid_sample, with absolute pixel coordinates instead of normalized coordinates.N©Údim)r	   r
   éþÿÿÿéÿÿÿÿ)ÚshapeÚsplitÚtorchÚcatÚFÚgrid_sample)	r   r   r	   r
   ÚhÚwÚxgridÚygridÚnormalized_grids	   &&&&     r   r   r      s†   € à�9‰9�R�Sˆ>�D€Aà ×&Ñ&¨¨1 v°2Ð&Ó6�L€EØ��I˜˜Q�Õ !Õ#€Eàˆ1„uØ�E•	˜Q �UÕ# aÕ'ˆÜ—i’i  °BÔ7€Oä�=Š=˜°DÔVÐVr   c                óH   € V ^8„  d   QhR\         R\         R\         R\        /# )r   Ú
batch_sizer   r   Údevice)Úintr   )r   s   "r   r   r      s(   € ÷ 4ñ 4¤ð 4¬ð 4´ð 4¼cñ 4r   c                 óJ  € \         P                  ! V4      p\         P                  ! \         P                  ! WR 7      \         P                  ! W#R 7      RR7      p\         P                  ! VRRR1,          ^ R7      P                  4       pVR,          P                  V ^^^4      # ))r#   Úij)ÚindexingNr   r   )r   r#   ÚmeshgridÚarangeÚstackÚfloatÚrepeat)r"   r   r   r#   Úcoordss   &&&& r   Úmake_coords_gridr.      sq   € Ü�\Š\˜&Ó!€FÜ�^Š^œEŸLšL¨Ô:¼E¿LºLÈÔ<ZÐeiÔj€FÜ�[Š[˜¡ " �¨1Ô-×3Ñ3Ó5€FØ�$�<×Ñ˜z¨1¨a°Ó3Ð3r   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r   Úup_maskÚfactor)r   r   r$   )r   s   "r   r   r      s#   € ÷ dñ d¤¬&Õ!1ð dÄ#ñ dr   c           	     óÐ  € V P                   w  r4rVWR,          Wb,          r‡Vf#   V\        P                  ! WV3RRR7      ,          # VP                  V^^	W"WV4      p\        P
                  ! V^R7      p\        P                  ! W ,          ^^R7      P                  W4^	^^WV4      p	\        P                  ! W,          ^R7      p	V	P                  ^ ^^^^^4      P                  W4Wx4      # )a  Upsample flow by the input factor (default 8).

If up_mask is None we just interpolate.
If up_mask is specified, we upsample using a convex combination of its weights. See paper page 8 and appendix B.
Note that in appendix B the picture assumes a downsample factor of 4 instead of 8.
ÚbilinearT)Úsizer	   r
   r   )Úkernel_sizeÚpadding)
r   r   ÚinterpolateÚviewr   ÚsoftmaxÚunfoldÚsumÚpermuteÚreshape)
Úflowr0   r1   r"   Únum_channelsr   r   Únew_hÚnew_wÚupsampled_flows
   &&&       r   Úupsample_flowrC      sÌ   € ð &*§Z¡ZÑ"€J˜aØ•:˜q�zˆ5à‚ØœŸš d¸°ÀjÐ`dÔeÕeÐeà�l‰l˜: q¨!¨V¸QÓB€GÜ�mŠm˜G¨Ô+€Gä—X’X˜f�m¸ÀAÔF×KÑKÈJÐfgÐijÐlmÐopÓt€NÜ—Y’Y˜wÕ7¸QÔ?€Nà×!Ñ! ! Q¨¨1¨a°Ó3×;Ñ;¸JÐV[ÓcÐcr   )r3   N)Úcpu)Né   )Útypingr   r   Útorch.nn.functionalÚnnÚ
functionalr   r   r   r.   rC   © r   r   Ú<module>rK      s+   ðÝ ã ß Ð Ý ÷W÷4÷dñ dr   