torch / torch7

http://torch.ch
Other
8.97k stars 2.38k forks source link

Lua/Torch to PyTorch #1114

Open The-Gupta opened 6 years ago

The-Gupta commented 6 years ago

Is there a mapping resource - document/website page between libraries and its methods of Torch and PyTorch? I'm trying to translate a Lua/Torch code to Python with PyTorch/Numpy.

tastyminerals commented 6 years ago

https://github.com/pytorch/pytorch/tree/master/torch/legacy

The-Gupta commented 6 years ago

@tastyminerals Thank you. Also, I need alternatives in PyTorch for load() and forward() methods of any of dp, optim, nngraph (I'm not sure which method belongs to which library). Do you know?

tastyminerals commented 6 years ago

forward is the method of Module.lua class which is inherited by all torch classes.

function Module:forward(input)
   return self:updateOutput(input)
end

So, it triggers updateOutput method of the class that inherits it.

load is called as torch.load both in pytorch and torch. These methods do not belong to some particular package but part of the torch API.