L i tddlmZddlZddlZddlmZmZmZmZm Z m Z ddl m Z ddl mZmZmZmZmZddlmZmZmZerddlmZe deeee eefe eefZe deeeeeeZe d eeefeeZej@ dd Z!dd Z"dd Z#dd Z$ ddZ% ddZ& ddZ'y)) annotationsN)AnyCallableOptional TYPE_CHECKINGTypeVarUnion) BackendIndex DispatchKeyNativeFunctionNativeFunctionsGroupNativeFunctionsViewGroup)contextST)IteratorFF2F3c#TKt|tr |jnt|tr |jn|t fd5t jjj5dddddddy#1swYxYw#1swYyxYww)Nc<djdjS)Nzin native_functions.yaml line z: )locfunc)fsV/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torchgen/context.pyz)native_function_manager..<s9!%%affXN)!use_const_ref_for_mutable_tensorsuse_ilistref_for_tensor_lists) isinstancer outrviewrlocal parametrizerpart_of_structured_group)grs @rnative_function_managerr'-s!)* EE A/ 0 FF  N O   ./.Q.Q*+*D*D       s6A B(,B:B?B B(B BB%!B(cDtjdfd }|S)NcVt|5|cdddS#1swYyxYwNr')rrs rwrapperz%with_native_function..wrapperJs' $Q ' 7   s()rrreturnr functoolswrapsrr,s` rwith_native_functionr2Is%__T NrcDtjdfd }|S)NcXt|5||cdddS#1swYyxYwr*r+)rf2rs rr,z)with_native_function_and..wrapperSs+%Q ' 2;    ))rrr5rr-rr.r1s` rwith_native_function_andr7Rs%__T NrcDtjdfd }|S)NcXt|5||cdddS#1swYyxYwr*r+slfrrs rr,z,method_with_native_function..wrapper]s) $Q ' Q<   r6)r;rrrr-rr.r1s` rmethod_with_native_functionr<\s%__T   NrcDtjdfd }|S)Nc^t|d5||cdddS#1swYyxYw)Nrr+r:s rr,z3method_with_nested_native_function..wrapperhs- $QqT * Q<   s #,)r;rrrr-rr.r1s` r"method_with_nested_native_functionr?es'__T   NrcDtjdfd }|S)NcXt|5||cdddS#1swYyxYwr*r+)r backend_indexrs rr,z/with_native_function_and_index..wrapperus* $Q ' *=) * * *r6)rrrBr r-rr.r1s` rwith_native_function_and_indexrCrs'__T** NrcDtjdfd }|S)NcXt|5||cdddS#1swYyxYwr*r+)rbackend_indicesrs rr,z1with_native_function_and_indices..wrappers* $Q ' ,?+ , , ,r6)rrrFzdict[DispatchKey, BackendIndex]r-rr.r1s` r with_native_function_and_indicesrG~s'__T,, Nr)r&z@NativeFunctionsGroup | NativeFunctionsViewGroup | NativeFunctionr-zIterator[None])rCallable[[F], T]r-rH)rCallable[[F, F2], T]r-rI)rCallable[[S, F], T]r-rJ)rCallable[[S, F3], T]r-rK)rCallable[[F, BackendIndex], T]r-rL)r1Callable[[F, dict[DispatchKey, BackendIndex]], T]r-rM)( __future__r contextlibr/typingrrrrrr torchgen.localr#torchgen.modelr r r r rtorchgen.utilsrrrcollections.abcrrboolstrrtuplelistrcontextmanagerr'r2r7r<r?rCrGrrr[s"II)((   .. ./ .2 23   ^  T5,-tN/CD G6  (# ;6r