Cache mapped functions (#531)
* avoid traversing functions multiple times * condense function cache setup * pass function cache to CombineMapper.__init__ too * use Never instead of None as the function result type for mappers that don't support functions * remove multiple inheritance for TransformMapperWithExtraArgs doesn't appear to be needed * add _verify_is_array to avoid the need for rec_ary the latter inflates recursion depth * remove map_foreign from Mapper * use Never as FunctionResultT for NumpyCodegenMapper and FancyDotWriter too * make PlaceholderSubstitutor explicit about not supporting functions * tweak types in rec/rec_function_definition * use P.args/P.kwargs in CachedWalkMapper * use a more specific type than Any for cache key in CachedWalkMapper * remove some more Anys
Loading
Please sign in to comment