-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TF Nest alternative #1314
Comments
I'm currently leaning towards those two options:
|
From these last 2 options I think I would prefer to add the dependency to tree. This will keep the RETURNN code small and more approachable to new developers. |
Ok then it's decided: we use Tree from DeepMind. |
Note that this is currently only used Edit Ok, the RF is also imported when the engine is selected in RETURNN, to initialize and set a reasonable RF backend. This is done always at startup. I'm not sure if we want to avoid this in any way. It would probably get ugly. But so it means everyone really needs to install |
Getting back to this, for completeness, some new alternatives:
|
For some code, it is useful to have functions like what TF
nest
(from tensorflow.python.util import nest
) provides, such asnest.map_structure
,nest.flatten
,nest.pack_sequence_as
, and others.So far, it was not really a problem to use just the TF
nest
, as we anyway have TF as dependency (although for RC, this was debatable: rwth-i6/returnn_common#27).Now, as we support different backends again (#1120), we want to have a framework-independent solution.
So, what are the alternatives:
nest
) and keep our own copy.(Similar discussion here: rwth-i6/returnn_common#27 (comment))
Some known implementations:
nest
. No own package, thus depends on whole TF.pip install dm-tree
torch.utils._pytree
). No own package, thus depends on whole PyTorch. Also slow, hidden, but might be made public, and speed might improve (torch.utils._pytree -> stable pytorch/pytorch#65761).pip install optree
.I did not really looked into them in detail whether they really exactly provide what we need (which is mostly exactly what TF
nest
provides).The text was updated successfully, but these errors were encountered: