Ë
    Bp±j  ã                   ój   — d Z ddlZddlmc mZ ddlZddl	Z	ddl
mZmZ  G d„ d«      Z G d„ d«      Zy)au  
TDD RED tests for the MLP forward pass in strategies/strategy_mlp_scores.py.

Contract under test:
  - _tanh(x): clamped closed-form tanh, identical formula to the Pine implementation:
        tanh(x) = x >= 20 ?  1.0
                : x <= -20 ? -1.0
                : (exp(2x) - 1) / (exp(2x) + 1)
  - mlp_forward(X, layers): X is a (T, F) float64 matrix; layers is a list of
    (W, b) tuples with W shape (n_out, n_in) and b shape (n_out,).
    Every layer (including the output layer) applies _tanh; the final scalar
    is scaled by 1000 so scores live in [-1000, +1000] like the existing
    activation-score convention.
é    N)Ú_tanhÚmlp_forwardc                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚTestTanhc                 ó2  — t        j                  ddd«      }t         j                  }t         j                  }t	        |«      }t         j
                  } ||«      }||z
  } ||«      } ||«      }	d}
|	|
k  }|�sŠt        j                  d|fd|	|
f«      dt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      dt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      dt        j                  «       v st        j                  t        «      rt        j                  t        «      ndd	t        j                  «       v st        j                  |«      rt        j                  |«      nd	t        j                  |«      dt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      d	t        j                  «       v st        j                  |«      rt        j                  |«      nd	t        j                  |«      t        j                  |«      t        j                  |	«      t        j                  |
«      d
œz  }dd|iz  }t        t        j                  |«      «      ‚d x}x}x}x}x}x}x}x}	x}}
y )Ng      3Àg      3@iÑ  çê-�™—q=©Ú<)zì%(py20)s
{%(py20)s = %(py2)s
{%(py2)s = %(py0)s.max
}(%(py18)s
{%(py18)s = %(py5)s
{%(py5)s = %(py3)s.abs
}((%(py9)s
{%(py9)s = %(py6)s(%(py7)s)
} - %(py15)s
{%(py15)s = %(py12)s
{%(py12)s = %(py10)s.tanh
}(%(py13)s)
}))
})
} < %(py23)sÚnpr   Úx)Úpy0Úpy2Úpy3Úpy5Úpy6Úpy7Úpy9Úpy10Úpy12Úpy13Úpy15Úpy18Úpy20Úpy23zassert %(py25)sÚpy25)r   ÚlinspaceÚmaxÚabsr   ÚtanhÚ
@pytest_arÚ_call_reprcompareÚ@py_builtinsÚlocalsÚ_should_repr_global_nameÚ	_safereprÚAssertionErrorÚ_format_explanation)Úselfr   Ú@py_assert1Ú@py_assert4Ú@py_assert8Ú@py_assert11Ú@py_assert14Ú@py_assert16Ú@py_assert17Ú@py_assert19Ú@py_assert22Ú@py_assert21Ú@py_format24Ú@py_format26s                 úg/Users/jameslopez/projects/TradingBot25/.worktrees/mlp-comparable-measurement/tests/test_mlp_forward.pyÚtest_matches_numpy_inside_clampz(TestTanh.test_matches_numpy_inside_clamp   s¬  € Ü�K‰K˜˜t TÓ*ˆÜ�v‰vÐ<”b—f‘fÐ<œU 1›XÐ<¬¯©Ð<©°«
Ð<˜X¨
Ñ2Ð<‘fÐ2Ó3Ð<‰vÐ3Ó4Ð<°uÐ<Ð4°uÑ<×<×<Ö<Ð4°u×<×<×<×<×<Ñ<Œr×<×<Ó<Œr×<×<Ô<ˆv×<×<×<×<×<Ð<”b×<×<Ó<”b×<×<Ô<�f×<×<×<×<×<Ð<œU×<×<Ó<œU×<×<×<×<×<Ò< 1×<×<Ó< 1×<×<Ô<˜X×<×<×<×<×<Ð<¬×<×<Ó<¬×<×<Ô<¨×<×<×<×<×<Ð<°×<×<Ó<°×<×<Ô<¨
×<×<Ò<Ð3×<×<Ò<Ð4×<×<Ò<°u×<×<×<×<×<×<×<×<Ò<ó    c           
      óZ	  — t        t        j                  g d¢«      «      d   }d}||k(  }|slt        j                  d|fd||f«      t        j
                  |«      t        j
                  |«      dœz  }dd|iz  }t        t        j                  |«      «      ‚d x}x}}t        j                  }t        j                  }g d¢} ||«      }	t        |	«      }
d}|
|k(  } ||«      }|�s«t        j                  d|fd	|
|f«      d
t        j                  «       v st        j                  t         «      rt        j
                  t         «      nd
dt        j                  «       v st        j                  t        «      rt        j
                  t        «      ndt        j
                  |«      t        j
                  |«      t        j
                  |	«      t        j
                  |
«      t        j
                  |«      dœz  }ddt        j                  «       v st        j                  t        «      rt        j
                  t        «      ndt        j
                  |«      |t        j
                  |«      dœz  }t        t        j                  |«      «      ‚d x}x}x}x}	x}
x}x}}t        j                  }t        j                  }g d¢} ||«      }	t        |	«      }
d}| }|
|k(  } ||«      }|�s«t        j                  d|fd|
|f«      d
t        j                  «       v st        j                  t         «      rt        j
                  t         «      nd
dt        j                  «       v st        j                  t        «      rt        j
                  t        «      ndt        j
                  |«      t        j
                  |«      t        j
                  |	«      t        j
                  |
«      t        j
                  |«      dœz  }ddt        j                  «       v st        j                  t        «      rt        j
                  t        «      ndt        j
                  |«      |t        j
                  |«      dœz  }t        t        j                  |«      «      ‚d x}x}x}x}	x}
x}x}x}}y )N)g      4@g      9@g    €„.Ar   ç      ð?©ú==)z%(py1)s == %(py4)s)Úpy1Úpy4zassert %(py6)sr   )zn%(py12)s
{%(py12)s = %(py3)s(%(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s.array
}(%(py8)s)
})
} == %(py15)sr   r   )r   r=   r   Úpy8r   r   r   zHassert %(py19)s
{%(py19)s = %(py2)s
{%(py2)s = %(py0)s.all
}(%(py17)s)
})r   r   Úpy17Úpy19)g      4Àg      9Àg    €„.Á)zo%(py12)s
{%(py12)s = %(py3)s(%(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s.array
}(%(py8)s)
})
} == -%(py15)szHassert %(py20)s
{%(py20)s = %(py2)s
{%(py2)s = %(py0)s.all
}(%(py18)s)
})r   r   r   r   )r   r   Úarrayr    r!   r%   r&   r'   Úallr"   r#   r$   )r(   Ú@py_assert0Ú@py_assert3Ú@py_assert2Ú@py_format5Ú@py_format7r)   Ú@py_assert5Ú@py_assert7Ú@py_assert9r,   r-   Ú@py_assert13Ú@py_assert18Ú@py_format16Ú@py_format20r.   r0   Ú@py_format17Ú@py_format21s                       r5   Ú test_clamps_to_exact_one_outsidez)TestTanh.test_clamps_to_exact_one_outside   s©  € ä”R—X‘XÒ/Ó0Ó1°!Ñ4Ð;¸Ð;Ð4¸Ñ;×;×;Õ;Ð4¸×;×;Ó;Ð4×;×;Ò;¸×;×;×;×;×;×;Ó;Ü�v‰vÐ@œBŸH™HÐ@Ò%6Ð@™HÐ%6Ó7Ð@”eÐ7Ó8Ð@¸CÐ@Ð8¸CÑ?Ð@‰vÐ@Ó@Ð@Ò@×@×@Ò@Ð8¸C×@×@×@×@×@Ñ@”e×@×@Ó@”e×@×@×@×@×@Ò@œB×@×@Ó@œB×@×@Ô@˜H×@×@Ò@Ð%6×@×@Ò@Ð7×@×@Ò@Ð8×@×@Ò@¸C×@×@×@×@×@Ö@Œr×@×@Ó@Œr×@×@Ô@ˆv×@×@Ó@Ð@×@×@×@×@×@×@Ö@Ü�v‰vÐDœBŸH™HÐDÒ%9ÐD™HÐ%9Ó:ÐD”eÐ:Ó;ÐDÀÐDÀ¸tÐDÐ;¸tÑCÐD‰vÐDÓDÐDÒD×D×DÒDÐ;¸t×D×D×D×D×DÑD”e×D×DÓD”e×D×D×D×D×DÒDœB×D×DÓDœB×D×DÔD˜H×D×DÒDÐ%9×D×DÒDÐ:×D×DÒDÐ;×D×DÒDÀ×D×D×D×D×DÖDŒr×D×DÓDŒr×D×DÔDˆv×D×DÓDÐD×D×D×D×D×D×D×DÑDr7   c                 óx  — d}t        |«      }t        |«      }t        j                  }d} ||«      }||z
  }t	        |«      }d}	||	k  }
|
�st        j                  d|
fd||	f«      dt        j                  «       v st        j                  t        «      rt        j                  t        «      nddt        j                  «       v st        j                  t        «      rt        j                  t        «      nddt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      t        j                  |«      t        j                  |«      dt        j                  «       v st        j                  t        «      rt        j                  t        «      ndt        j                  |«      t        j                  |«      t        j                  |«      t        j                  |«      t        j                  |	«      d	œz  }d
d|iz  }t        t        j                  |«      «      ‚d x}x}x}x}x}x}x}x}x}
}	d}t        |«      }t        |«      }d}||k(  }|�s&t        j                  d|fd||f«      dt        j                  «       v st        j                  t        «      rt        j                  t        «      nddt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      t        j                  |«      t        j                  |«      t        j                  |«      dœz  }dd|iz  }t        t        j                  |«      «      ‚d x}x}x}x}}y )Nç      à?r   r	   )z·%(py18)s
{%(py18)s = %(py0)s((%(py8)s
{%(py8)s = %(py1)s(%(py6)s
{%(py6)s = %(py2)s(%(py4)s)
})
} - %(py15)s
{%(py15)s = %(py11)s
{%(py11)s = %(py9)s.tanh
}(%(py13)s)
}))
} < %(py21)sr   Úfloatr   r   )r   r<   r   r=   r   r>   r   Úpy11r   r   r   Úpy21zassert %(py23)sr   ç        r:   )zO%(py7)s
{%(py7)s = %(py0)s(%(py5)s
{%(py5)s = %(py1)s(%(py3)s)
})
} == %(py10)s)r   r<   r   r   r   r   zassert %(py12)sr   )r   rT   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   )r(   rD   rH   rI   Ú@py_assert10Ú@py_assert12r-   r.   r/   Ú@py_assert20r0   Ú@py_format22r3   rE   r*   Ú@py_assert6rJ   r+   Ú@py_format11Ú@py_format13s                       r5   Útest_scalar_inputzTestTanh.test_scalar_input    s  € Ø"Ð<œ˜s›Ð<”5˜Ó$Ð<¤r§w¡wÐ<¨sÐ<¡w¨s£|Ð<Ð$ |Ñ3Ð<ŒsÐ3Ó4Ð<°uÐ<Ð4°uÑ<×<×<Ö<Ð4°u×<×<×<×<×<Ñ<Œs×<×<Ó<Œs×<×<×<×<×<Ò<”5×<×<Ó<”5×<×<×<×<×<Ò<œ×<×<Ó<œ×<×<Ô<˜s×<×<Ò<˜×<×<Ò<Ð$×<×<×<×<×<Ð<¤r×<×<Ó<¤r×<×<Ô< w×<×<Ò<¨s×<×<Ò< |×<×<Ò<Ð4×<×<Ò<°u×<×<×<×<×<×<×<×<Ñ<ØÐ'”U˜3“ZÐ'Œu�ZÓ Ð' CÐ'Ð  CÑ'×'×'Ö'Ð  C×'×'×'×'×'Ñ'Œu×'×'Ó'Œu×'×'×'×'×'Ò'”U×'×'Ó'”U×'×'Ô'˜3×'×'Ò'�Z×'×'Ò'Ð ×'×'Ò' C×'×'×'×'×'×'×'Ð'r7   N)Ú__name__Ú
__module__Ú__qualname__r6   rQ   r_   © r7   r5   r   r      s   „ ò=òEó(r7   r   c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)ÚTestForwardc                 ó,  — t        j                  g d¢g d¢gt         j                  ¬«      }t        j                  ddgt         j                  ¬«      }t        j                  ddggt         j                  ¬«      }t        j                  dgt         j                  ¬«      }t        j                  g d	¢gt         j                  ¬«      }t        j                  ||d
   z  |z   «      }dt        j                  ||z  |z   «      d
   z  }t	        |||f||fg«      }|j
                  }	d}
|	|
k(  }|s­t        j                  d|fd|	|
f«      dt        j                  «       v st        j                  |«      rt        j                  |«      ndt        j                  |	«      t        j                  |
«      dœz  }dd|iz  }t        t        j                  |«      «      ‚d x}	x}}
|d
   }	|	|z
  }
t        |
«      }d}||k  }|�s
t        j                  d|fd||f«      dt        j                  «       v st        j                  t        «      rt        j                  t        «      ndt        j                  |	«      dt        j                  «       v st        j                  |«      rt        j                  |«      ndt        j                  |«      t        j                  |«      dœz  }dd|iz  }t        t        j                  |«      «      ‚d x}	x}
x}x}}y )N)rS   g      Ð¿çš™™™™™¹?)gš™™™™™É?g333333Ó?gš™™™™™Ù¿©Údtyperg   gš™™™™™É¿gffffffæ?g333333ã¿gš™™™™™©?)r9   g      à¿g      Ð?r   ç     @�@)é   r:   ©z-%(py2)s
{%(py2)s = %(py0)s.shape
} == %(py5)sÚout©r   r   r   úassert %(py7)sr   ç•Ö&è.>r	   )z;%(py6)s
{%(py6)s = %(py0)s((%(py2)s - %(py3)s))
} < %(py9)sr   Úexpected)r   r   r   r   r   zassert %(py11)srU   )r   rA   Úfloat64r   r   Úshaper    r!   r"   r#   r$   r%   r&   r'   r   )r(   ÚW1Úb1ÚW2Úb2r   Úhrq   rm   r)   r*   rD   Ú@py_format6Ú@py_format8rH   r+   rI   Ú@py_format10Ú@py_format12s                      r5   Útest_hand_computed_two_layerz(TestForward.test_hand_computed_two_layer&   sö  € ô �X‰XÒ(Ú(ð*Ü13·±ô=ˆä�X‰X�s˜D�k¬¯©Ô4ˆÜ�X‰X˜˜T�{�m¬2¯:©:Ô6ˆÜ�X‰X�t�f¤B§J¡JÔ/ˆÜ�H‰HÒ'Ð(´·
±
Ô;ˆä�G‰G�B˜˜1™‘I ‘NÓ#ˆØœBŸG™G B¨¡F¨R¡KÓ0°Ñ3Ñ3ˆä˜!˜r 2˜h¨¨R¨Ð1Ó2ˆØ�y‰yÐ ˜DÐ ˆy˜DÑ × × Õ ˆy˜D× × × × × Ñ ˆs× × Ó ˆs× × Ô ˆy× × Ò ˜D× × × × × × Ó Ø�q‘6Ð,�6˜HÑ$Ð,ŒsÐ$Ó%Ð,¨Ð,Ð%¨Ñ,×,×,Ö,Ð%¨×,×,×,×,×,Ñ,Œs×,×,Ó,Œs×,×,Ô,�6×,×,×,×,×,Ð,˜H×,×,Ó,˜H×,×,Ô,Ð%×,×,Ò,¨×,×,×,×,×,×,×,Ð,r7   c           
      ó¦  — t         j                  j                  d«      }dg d¢}}|j                  dd||d   f¬«      }t	        t        |«      dz
  «      D �cg c]9  }|j                  d||dz      ||   f¬	«      |j                  d
||dz      ¬	«      f‘Œ; }}t        ||«      }|j                  }|f}	||	k(  }
|
s­t        j                  d|
fd||	f«      dt        j                  «       v st        j                  |«      rt        j                  |«      ndt        j                  |«      t        j                  |	«      dœz  }dd|iz  }t        t        j                   |«      «      ‚d x}x}
}	|j"                  }t         j$                  }||k(  }
|
söt        j                  d|
fd||f«      dt        j                  «       v st        j                  |«      rt        j                  |«      ndt        j                  |«      dt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      dœz  }dd|iz  }t        t        j                   |«      «      ‚d x}x}
}t         j&                  }t         j(                  }	 |	|«      }d}||k  } ||«      }|�s{t        j                  d|fd||f«      dt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |	«      dt        j                  «       v st        j                  |«      rt        j                  |«      ndt        j                  |«      t        j                  |«      dœz  }ddt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      |t        j                  |«      dœz  }t        t        j                   |«      «      ‚d x}x}	x}x}x}}y c c}w )Né*   é   ©é1   é   é   rk   éÿÿÿÿrk   r   ©ÚsizerS   ©Úscaler‡   rg   r:   rl   rm   rn   ro   r   )zJ%(py2)s
{%(py2)s = %(py0)s.dtype
} == %(py6)s
{%(py6)s = %(py4)s.float64
}r   )r   r   r=   r   zassert %(py8)sr>   rj   )ú<=)zJ%(py8)s
{%(py8)s = %(py5)s
{%(py5)s = %(py3)s.abs
}(%(py6)s)
} <= %(py11)s)r   r   r   r>   rU   zHassert %(py15)s
{%(py15)s = %(py2)s
{%(py2)s = %(py0)s.all
}(%(py13)s)
})r   r   r   r   )r   ÚrandomÚdefault_rngÚuniformÚrangeÚlenÚnormalr   rs   r    r!   r"   r#   r$   r%   r&   r'   ri   rr   rB   r   )r(   ÚrngÚTÚarchÚXÚiÚlayersrm   r)   r*   rD   ry   rz   rH   rG   Ú@py_format9rI   rX   rJ   r-   r|   rM   s                         r5   Útest_output_shape_and_rangez'TestForward.test_output_shape_and_range8   s©  € Ü�i‰i×#Ñ# BÓ'ˆØ’^ˆ4ˆØ�K‰K˜˜A Q¨¨Q© LˆKÓ1ˆô œ3˜t›9 q™=Ô)ó
ñ *�ð �Z‰Z˜c¨¨a°!©e©°d¸1±gÐ(>ˆZÓ?Ø�Z‰Z˜c¨¨Q°©U©ˆZÓ4ò6à)ð 	ð 
ô
 ˜!˜VÓ$ˆØ�y‰yÐ ˜Q˜DÐ ˆy˜DÑ × × Õ ˆy˜D× × × × × Ñ ˆs× × Ó ˆs× × Ô ˆy× × Ò ˜D× × × × × × Ó Ø�y‰yÐ&œBŸJ™JÐ&ˆy˜JÑ&×&×&Õ&ˆy˜J×&×&×&×&×&Ñ&ˆs×&×&Ó&ˆs×&×&Ô&ˆy×&×&×&×&×&Ð&œB×&×&Ó&œB×&×&Ô&˜J×&×&×&×&×&×&Ó&Ü�v‰vÐ,”b—f‘fÐ,‘f˜S“kÐ, VÐ,�k VÑ+Ð,‰vÐ,Ó,Ð,Ò,×,×,Ò,�k V×,×,×,×,×,Ñ,”b×,×,Ó,”b×,×,Ô,�f×,×,×,×,×,Ð,˜S×,×,Ó,˜S×,×,Ô,�k×,×,Ò, V×,×,×,×,×,Ö,Œr×,×,Ó,Œr×,×,Ô,ˆv×,×,Ó,Ð,×,×,×,×,×,×,Ó,ùò
s   Á>Qc                 ó¶  — t        j                  dt         j                  ¬«      }t        j                  d«      t        j                  d«      ft        j                  d«      t        j                  d«      fg}t         j                  }t        ||«      }d}||k(  } ||«      }|�s¨t        j                  d|fd	||f«      d
t        j                  «       v st        j                  t
        «      rt        j                  t
        «      nd
dt        j                  «       v st        j                  |«      rt        j                  |«      nddt        j                  «       v st        j                  |«      rt        j                  |«      ndt        j                  |«      t        j                  |«      dœz  }ddt        j                  «       v st        j                  t         «      rt        j                  t         «      ndt        j                  |«      |t        j                  |«      dœz  }	t        t        j                  |	«      «      ‚d x}x}x}x}}y )N)é   é   rh   )é   r›   rœ   )rk   rœ   rk   rW   r:   )z:%(py7)s
{%(py7)s = %(py3)s(%(py4)s, %(py5)s)
} == %(py10)sr   r”   r–   )r   r=   r   r   r   zHassert %(py14)s
{%(py14)s = %(py2)s
{%(py2)s = %(py0)s.all
}(%(py12)s)
}r   )r   r   r   Úpy14)r   Úonesrr   ÚzerosrB   r   r    r!   r"   r#   r$   r%   r&   r'   )
r(   r”   r–   r)   r\   rJ   r+   rK   r]   Ú@py_format15s
             r5   Ú!test_zero_weights_give_zero_scorez-TestForward.test_zero_weights_give_zero_scoreF   sM  € Ü�G‰G�F¤"§*¡*Ô-ˆÜ—8‘8˜FÓ#¤R§X¡X¨a£[Ð1´B·H±H¸VÓ4DÄbÇhÁhÈqÃkÐ3RÐSˆÜ�v‰vÐ4”k ! VÓ,Ð4°Ð4Ð,°Ñ3Ð4‰vÐ4Ó4Ð4Ò4×4×4Ò4Ð,°×4×4×4×4×4Ñ4”k×4×4Ó4”k×4×4×4×4×4Ò4 !×4×4Ó4 !×4×4×4×4×4Ò4 V×4×4Ó4 V×4×4Ô4Ð,×4×4Ò4°×4×4×4×4×4Ö4Œr×4×4Ó4Œr×4×4Ô4ˆv×4×4Ó4Ð4×4×4×4×4×4×4Ñ4r7   c                 ó(  — t        j                  d«      }t        j                  j	                  d«      }g d¢}|j                  ddd|d   f¬«      }t        t        |«      dz
  «      D �cg c]9  }|j                  d	||dz      ||   f¬
«      |j                  d||dz      ¬
«      f‘Œ; }}|j                  «       5  |j                  ||j                  ¬«      }|D ]D  \  }}	|j                  ||j                  |j                  «      z  |j                  |	«      z   «      }ŒF |j                  d«      dz  j                  «       }
d d d «       t        j                   }t        j"                  }t%        ||«      }|
z
  } ||«      } ||«      }d}||k  }|�sZt'        j(                  d|fd||f«      dt+        j,                  «       v st'        j.                  t        «      rt'        j0                  t        «      ndt'        j0                  |«      dt+        j,                  «       v st'        j.                  t        «      rt'        j0                  t        «      ndt'        j0                  |«      dt+        j,                  «       v st'        j.                  t$        «      rt'        j0                  t$        «      nddt+        j,                  «       v st'        j.                  |«      rt'        j0                  |«      nddt+        j,                  «       v st'        j.                  |«      rt'        j0                  |«      ndt'        j0                  |«      dt+        j,                  «       v st'        j.                  |
«      rt'        j0                  |
«      ndt'        j0                  |«      t'        j0                  |«      t'        j0                  |«      dœz  }dd|iz  }t3        t'        j4                  |«      «      ‚d x}x}x}x}x}x}x}}y c c}w # 1 sw Y   �ŒÅxY w)NÚtorchr€   r�   r…   rk   é@   r   r†   rS   rˆ   rg   rh   rj   rp   r	   )zº%(py16)s
{%(py16)s = %(py2)s
{%(py2)s = %(py0)s.max
}(%(py14)s
{%(py14)s = %(py5)s
{%(py5)s = %(py3)s.abs
}((%(py10)s
{%(py10)s = %(py6)s(%(py7)s, %(py8)s)
} - %(py11)s))
})
} < %(py19)sr   r   r”   r–   Úref)r   r   r   r   r   r   r>   r   rU   r�   Úpy16r@   zassert %(py21)srV   )ÚpytestÚimportorskipr   r‹   rŒ   r�   rŽ   r�   r�   Úno_gradÚtensorrr   r   r’   ÚsqueezeÚnumpyr   r   r   r    r!   r"   r#   r$   r%   r&   r'   )r(   r£   r‘   r“   r”   r•   r–   ÚaÚWÚbr¥   r)   r*   rJ   rY   rK   Ú@py_assert15rL   r/   rN   r[   s                        r5   Útest_matches_torch_referencez(TestForward.test_matches_torch_referenceK   s°  € Ü×#Ñ# GÓ,ˆÜ�i‰i×#Ñ# AÓ&ˆÚˆØ�K‰K˜˜A R¨¨a© MˆKÓ2ˆô œ3˜t›9 q™=Ô)ó
ñ *�ð �Z‰Z˜c¨¨a°!©e©°d¸1±gÐ(>ˆZÓ?Ø�Z‰Z˜c¨¨Q°©U©ˆZÓ4ò6à)ð 	ð 
ð
 �]‰]�_Ø—‘˜Q e§m¡m�Ó4ˆAÛ‘��1Ø—J‘J˜q 5§<¡<°·±Ó#4Ñ4°u·|±|ÀA³ÑFÓG‘ð à—9‘9˜R“= 6Ñ)×0Ñ0Ó2ˆC÷	 ô
 �v‰vÐB”b—f‘fÐBœ[¨¨FÓ3ÐBÐ3°cÑ9ÐB‘fÐ9Ó:ÐB‰vÐ:Ó;ÐB¸dÐBÐ;¸dÑB×B×BÖBÐ;¸d×B×B×B×B×BÑBŒr×B×BÓBŒr×B×BÔBˆv×B×B×B×B×BÐB”b×B×BÓB”b×B×BÔB�f×B×B×B×B×BÐBœ[×B×BÓBœ[×B×B×B×B×BÒB¨×B×BÓB¨×B×B×B×B×BÒB¨F×B×BÓB¨F×B×BÔBÐ3×B×B×B×B×BÐB°c×B×BÓB°c×B×BÔBÐ:×B×BÒBÐ;×B×BÒB¸d×B×B×B×B×B×B×BÖBùò
÷
 ‰_ús   Á+>PÂ;B	PÐPN)r`   ra   rb   r}   r˜   r¡   r±   rc   r7   r5   re   re   %   s   „ ò-ò$-ò5ó
Cr7   re   )Ú__doc__Úbuiltinsr"   Ú_pytest.assertion.rewriteÚ	assertionÚrewriter    r¬   r   r§   Ústrategies.strategy_mlp_scoresr   r   r   re   rc   r7   r5   Ú<module>r¸      s0   ðñ÷ „ Ó Û ç =÷(ñ (÷ 5Cò 5Cr7   