arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2508.04035cs.LGcs.AI
收藏

PyTorch与TensorFlow深度学习比较综述:可用性、性能与部署权衡

A Comparative Survey of PyTorch vs TensorFlow for Deep Learning: Usability, Performance, and Deployment Trade-offs

Department of Software Engineering Alfaisal University, Riyadh, Saudi Arabia Email

Zakariya Ba Alawi

AI总结:

本文比较了PyTorch与TensorFlow在可用性、性能和部署上的权衡,指出PyTorch以灵活简单见长,TensorFlow生态更成熟,为选型提供参考。

摘要:

本文对TensorFlow和PyTorch这两个领先的深度学习框架进行了全面的比较综述,重点关注它们的可用性、性能与部署权衡。我们回顾了每个框架的编程范式和开发者体验,对比了TensorFlow基于图(现可选即时执行)的方法与PyTorch动态、Python风格的方法。随后,我们基于最近的基准测试和研究,在多个任务和数据规模下比较了模型训练速度和推理性能。我们深入考察了部署灵活性——从TensorFlow成熟的生态系统(用于移动/嵌入式设备的TensorFlow Lite、TensorFlow Serving和JavaScript支持)到PyTorch较新的生产工具(TorchScript编译、ONNX导出和TorchServe)。我们还调查了生态系统和社区支持,包括库集成、行业采用和研究趋势(例如,PyTorch在近期研究出版物中的主导地位与TensorFlow在企业中更广泛的工具集)。我们讨论了计算机视觉、自然语言处理及其他领域的应用,以说明每个框架在实际中的使用方式。最后,我们概述了深度学习框架设计的未来方向和开放挑战,例如统一即时执行与图执行、改善跨框架互操作性,以及集成编译器优化(XLA、JIT)以提高速度。我们的研究结果表明,尽管两个框架都高度适用于最先进的深度学习,但它们表现出不同的权衡:PyTorch提供了研究和社区偏爱的简单性和灵活性,而TensorFlow提供了更完整的生产就绪生态系统——理解这些权衡对于从业者选择合适的工具至关重要。我们包含图表、代码片段以及超过20篇学术论文和官方文档的参考文献,以支持这一比较分析。

英文摘要:

This paper presents a comprehensive comparative survey of TensorFlow and PyTorch, the two leading deep learning frameworks, focusing on their usability, performance, and deployment trade-offs. We review each framework's programming paradigm and developer experience, contrasting TensorFlow's graph-based (now optionally eager) approach with PyTorch's dynamic, Pythonic style. We then compare model training speeds and inference performance across multiple tasks and data regimes, drawing on recent benchmarks and studies. Deployment flexibility is examined in depth - from TensorFlow's mature ecosystem (TensorFlow Lite for mobile/embedded, TensorFlow Serving, and JavaScript support) to PyTorch's newer production tools (TorchScript compilation, ONNX export, and TorchServe). We also survey ecosystem and community support, including library integrations, industry adoption, and research trends (e.g., PyTorch's dominance in recent research publications versus TensorFlow's broader tooling in enterprise). Applications in computer vision, natural language processing, and other domains are discussed to illustrate how each framework is used in practice. Finally, we outline future directions and open challenges in deep learning framework design, such as unifying eager and graph execution, improving cross-framework interoperability, and integrating compiler optimizations (XLA, JIT) for improved speed. Our findings indicate that while both frameworks are highly capable for state-of-the-art deep learning, they exhibit distinct trade-offs: PyTorch offers simplicity and flexibility favored in research, whereas TensorFlow provides a fuller production-ready ecosystem - understanding these trade-offs is key for practitioners selecting the appropriate tool. We include charts, code snippets, and more than 20 references to academic papers and official documentation to support this comparative analysis

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑