~L i.ddlZddlmZ GddZy)NcveZdZdZdZgdZgdZeezZddZ dZ dZ d Z d Z d Z d Z d Z dZy)PythonDispatcher__test__foo)CPU AutogradCPUFPGA AutogradOtherXLA AutogradXLALazy AutogradLazy)CompositeExplicitAutogradAutogradCompositeImplicitAutogradNctj|jtjd|jd|_|j j dy)NFRAGMENTzfoo(Tensor x) -> Tensor)C_dispatch_check_invariantsname_dispatch_library namespacerefdef_selfs ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/_python_dispatcher.py__init__zPythonDispatcher.__init__Is? $$TYY/&&z4>>2F  /0c|jSN)supported_keysrs rkeyszPythonDispatcher.keysSs"""r c*tt|t|k7rtd|dd|vrd|vr td|D]L}||jvrt|d|jd|jj d|d|z Ny) Nz2Overridden is not allowed but found duplicates in .rrz\Registration to both CompositeImplicitAutograd and CompositeExplicitAutograd is not allowed.z3 is not supported, please select a dispatch key in rfn_)dispatchdebug)lenset RuntimeErrorr#rimpl_t_t)r dispatchKeyskeys rregisterzPythonDispatcher.register^s s< !S%6 6D\NRST  (< 7+|;n   FC$---"eNtObObNccde HH  ec  E  Fr c|dd|dS)Nz<15  )rr/kernels r _format_linezPythonDispatcher._format_linewsc!F82&&r cFd|d}||jddz }|dz }|S)Nr3r/r5z--------------------------- )r6)rheaderss r_format_headerzPythonDispatcher._format_header~sA   T  uh // ,,r c^tj|jd|jSN::)r_dispatch_dumprrrs rrawRegistrationsz!PythonDispatcher.rawRegistrationss'4>>"2"TYYK @AAr c^tj|jd|jSr<)r_dispatch_dump_tablerrrs rrawDispatchTablez!PythonDispatcher.rawDispatchTables'%%(8499+&FGGr cV|jd}|j}|jd}|D]p}|jddtfd|jDs6|jddjdd}||j |z }r|S) NzRegistered Kernelsr3:rc3@K|]}j|ywr") startswith).0kfirsts r z1PythonDispatcher.registrations..sD15##A&Dsr=r2)r:r?splitanyr#r6)routputstate state_entriesliner5rIs @r registrationszPythonDispatcher.registrationss$$%9:%%' D) ! ;DJJsOA&ED0C0CDDD)!,2237:$++E6::  ;  r cZ|jd}|j}|jd}tjd}|D]^}|jdd}||j vs&|j d|}||j||jddz }`|S) NzComputed Dispatch Tabler3z)registered at .*FallbackKernel\.cpp.*(\[)rDr[z: rK)r:rBrLrecompile runtime_keyssubr6)rrNtable table_entriesregexrQrHentrys r dispatchTablezPythonDispatcher.dispatchTables$$%>?%%' D)  GH! ED 3"AD%%% #t,$++Au{{4/@/CDD  E  r )returnN)__name__ __module__ __qualname__rrrW alias_keysr#rr$r0r6r:r?rBrRr]r4r rrr7s~I DLJ "J.N1  #F*' B H  r r)rUtorch._C_Crrr4r rres -`r