Why did legacy.nn become legacy?

What’s the main difference between legacy.nn and the new nn?

Is legacy.nn slower or what problem does it have? Is there any documentation about why it became legacy?

I like the legacy code because it’s easy to read while I can’t even find the implementation of updateGradInput and accGradParameters functions in the new nn package — where are they?

legacy.nn is there for backwards compatibility with lua torch.

If you can find implementations for operations in python, then that means those ops are not being implemented in c++. In general our c++ implementations are faster than their python counterparts.

It depends on what operation you’re looking for, but a number of those can be found here: https://github.com/pytorch/pytorch/tree/master/aten/src/TH/generic

1 Like