As a result of rwth-i6/returnn#1120 and rwth-i6/returnn#1264, we want to move core functions over to RETURNN, as this should become the common compatibility layer for different backends such as TensorFlow and PyTorch.
These are mostly the functions in nn/_generated_layers.py, but this in turn also means to move over some of the other code logic, like the naming logic, etc.