flax icon indicating copy to clipboard operation
flax copied to clipboard

Deprecate/Remove traverse_util module

Open n2cholas opened this issue 3 years ago • 7 comments

As per @marcvanzee's comment on #1022, most of the traverse_util logic can be done with tree_maps without losing any run time optimizations. The trade-off is the compile times will be longer, but tree_map code is easier to understand.

cc: @avital

n2cholas avatar Jan 31 '22 20:01 n2cholas

I think flatten_dict and unflatten_dict are helpful utilities, perhaps they can be moved to jax_utils?

n2cholas avatar Jan 31 '22 20:01 n2cholas

I agree, those are useful. I don't know what the long term best place for them is, though. Maybe even outside of Flax? So I guess maybe it's fine to just keep them where they are for now (jax_utils is a bad package -- it doesn't describe what it's scope is... traverse_utils is almost descriptive in this case.) But I don't have strong feelings here.

avital avatar Feb 01 '22 14:02 avital

Just curious @n2cholas -- are you planning to work on this or did you file it for us to keep track of it (both answers are fine, just checking). If you don't want to work on this I'll add "pull requests encouraged" to it and maybe someone else wants to give it a shot.

avital avatar Feb 08 '22 19:02 avital

I'd be happy to work on this, but what's the process to actually deprecate then remove this module? Do I just add deprecation warnings to all the functions?

n2cholas avatar Feb 09 '22 05:02 n2cholas

As a first step, yes. Add a deprecation warning and make sure it is clearly deprecated in the docs. Make sure we don't use them anywhere in our examples/HOWTOs/etc. Then we can cut a new release, and in a few months remove it entirely from our code.

avital avatar Feb 10 '22 12:02 avital

Got it, will do next week!

n2cholas avatar Feb 10 '22 15:02 n2cholas