4 ms·
As a crazy exercise to learn both Python and Lua at the same time, I've been porting a small Numpy project to Torch. I will say that both the languages are equ
by binarymax 11y ago
As a crazy exercise to learn both Python and Lua at the same time, I've been porting a small Numpy project to Torch. I will say that both the languages are equally nice, but Numpy is much cleaner compared to some of the seemingly hacky things I need to do in torch.
For example. In numpy:
x = numpy.array([1,2,3,4])
y = 1/x
In torch:
x = torch.Tensor({1,2,3,4})
y = x:apply(function(n) return 1/n end)
In any case, its been a fun and interesting exercise!