@@ -218,9 +218,9 @@ function traced_setfield_buffer!(
218218 return traced_setfield! (obj, field, cval, path)
219219end
220220
221- function create_result (
222- tocopy:: T ,
223- path,
221+ Base . @nospecializeinfer function create_result (
222+ @nospecialize ( tocopy) ,
223+ @nospecialize ( path:: Tuple ) ,
224224 result_stores,
225225 path_to_shard_info,
226226 to_unreshard_results,
@@ -230,11 +230,13 @@ function create_result(
230230 result_cache,
231231 var_idx,
232232 resultgen_code,
233- ) where {T}
233+ )
234234 if ! isstructtype (typeof (tocopy))
235235 error (" cannot copy $tocopy of type $(Core. Typeof (tocopy)) " )
236236 end
237237
238+ T = Core. Typeof (tocopy)
239+
238240 args = (
239241 result_stores,
240242 path_to_shard_info,
277279
278280function create_result (
279281 tocopy:: ConcretePJRTNumber{T,D} ,
280- path,
282+ @nospecialize ( path:: Tuple ) ,
281283 result_stores,
282284 path_to_shard_info,
283285 to_unreshard_results,
319321
320322function create_result (
321323 tocopy:: ConcreteIFRTNumber{T} ,
322- path,
324+ @nospecialize ( path:: Tuple ) ,
323325 result_stores,
324326 path_to_shard_info,
325327 to_unreshard_results,
361363
362364function create_result (
363365 tocopy:: ConcretePJRTArray{T,N,D} ,
364- path,
366+ @nospecialize ( path:: Tuple ) ,
365367 result_stores,
366368 path_to_shard_info,
367369 to_unreshard_results,
404406
405407function create_result (
406408 tocopy:: ConcreteIFRTArray{T,N} ,
407- path,
409+ @nospecialize ( path:: Tuple ) ,
408410 result_stores,
409411 path_to_shard_info,
410412 to_unreshard_results,
490492
491493function create_result (
492494 tocopy:: Array{T,N} ,
493- path,
495+ @nospecialize ( path:: Tuple ) ,
494496 result_stores,
495497 path_to_shard_info,
496498 to_unreshard_results,
542544
543545function create_result (
544546 tocopy:: Tuple ,
545- path,
547+ @nospecialize ( path:: Tuple ) ,
546548 result_stores,
547549 path_to_shard_info,
548550 to_unreshard_results,
573575
574576function create_result (
575577 tocopy:: NamedTuple{K,T} ,
576- path,
578+ @nospecialize ( path:: Tuple ) ,
577579 result_stores,
578580 path_to_shard_info,
579581 to_unreshard_results,
604606
605607function create_result (
606608 tocopy:: D ,
607- path,
609+ @nospecialize ( path:: Tuple ) ,
608610 result_stores,
609611 path_to_shard_info,
610612 to_unreshard_results,
661663
662664function create_result (
663665 tocopy:: Reactant.XLA.AbstractDevice ,
664- _path,
666+ @nospecialize ( _path:: Tuple ) ,
665667 _result_stores,
666668 _path_to_shard_info,
667669 _to_unreshard_results,
677679
678680function create_result (
679681 tocopy:: Union{Integer,AbstractFloat,AbstractString,Nothing,Type,Symbol,Char} ,
680- _path,
682+ @nospecialize ( _path:: Tuple ) ,
681683 _result_stores,
682684 _path_to_shard_info,
683685 _to_unreshard_results,
0 commit comments