PyTorch 和 Torch 是什么关系? [英] What is the relationship between PyTorch and Torch?

查看:34
本文介绍了PyTorch 和 Torch 是什么关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有两个 PyTorch 存储库:

There are two PyTorch repositories :

第一个显然需要 Torch 和 lua 并且是一个包装器,但第二个除了它的名称外没有对 Torch 项目进行任何引用.

The first clearly requires Torch and lua and is a wrapper, but the second doesn't make any reference to the Torch project except with its name.

它与Lua Torch有什么关系?

推荐答案

这里是 pytorch 和 torch 的简短比较.

Here a short comparison on pytorch and torch.

手电筒:

numpy 这样的 Tensor 库,与 numpy 不同,它具有强大的 GPU 支持.
Lua 是 Torch 的包装器(是的!你需要对 Lua 有很好的了解),为此你需要 LuaRocks 包管理器.

A Tensor library like numpy, unlike numpy it has strong GPU support.
Lua is a wrapper for Torch (Yes! you need to have a good understanding of Lua), and for that you will need LuaRocks package manager.

PyTorch:

无需 LuaRocks 包管理器,无需在 Lua 中编写代码.因为我们使用 Python,所以我们可以非常灵活地开发深度学习模型.我们还可以利用 PyTorch 自己的 autograd 来利用主要的 Python 包,如 scipynumpymatplotlibCython.>

No need for the LuaRocks package manager, no need to write code in Lua. And because we are using Python, we can develop Deep Learning models with utmost flexibility. We can also exploit major Python packages likes scipy, numpy, matplotlib and Cython with PyTorch's own autograd.

pytorch 论坛上对此有详细讨论.除此之外,PyTorch 和 Torch 都使用 THNN.Torch 为 THNN 库提供 lua 包装器,而 Pytorch 为相同的库提供 Python 包装器.

There is a detailed discussion on this on pytorch forum. Adding to that both PyTorch and Torch use THNN. Torch provides lua wrappers to the THNN library while Pytorch provides Python wrappers for the same.

PyTorch 的循环网络、权重共享和内存使用以及与 C 接口的灵活性,以及​​ Torch 的当前速度.

PyTorch's recurrent nets, weight sharing and memory usage with the flexibility of interfacing with C, and the current speed of Torch.

有关更多见解,请查看此讨论会此处.

For more insights, have a look at this discussion session here.

这篇关于PyTorch 和 Torch 是什么关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆