{"id":478588,"date":"2023-08-09T09:35:23","date_gmt":"2023-08-09T09:35:23","guid":{"rendered":""},"modified":"2023-09-05T11:17:08","modified_gmt":"2023-09-05T11:17:08","slug":"pytorch","status":"publish","type":"wiki","link":"https:\/\/oneproxy.pro\/cn\/wiki\/pytorch\/","title":{"rendered":"\u706b\u70ac"},"content":{"rendered":"<h2>PyTorch\u7b80\u4ecb<\/h2>\n<p>\u5728\u5feb\u901f\u53d1\u5c55\u7684\u6df1\u5ea6\u5b66\u4e60\u9886\u57df\uff0cPyTorch \u5df2\u6210\u4e3a\u4e00\u4e2a\u5f3a\u5927\u4e14\u591a\u529f\u80fd\u7684\u6846\u67b6\uff0c\u6b63\u5728\u91cd\u5851\u7814\u7a76\u4eba\u5458\u548c\u5f00\u53d1\u4eba\u5458\u5904\u7406\u673a\u5668\u5b66\u4e60\u4efb\u52a1\u7684\u65b9\u5f0f\u3002 PyTorch \u662f\u4e00\u4e2a\u5f00\u6e90\u673a\u5668\u5b66\u4e60\u5e93\uff0c\u63d0\u4f9b\u7075\u6d3b\u52a8\u6001\u7684\u65b9\u6cd5\u6765\u6784\u5efa\u548c\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u3002\u672c\u6587\u6df1\u5165\u63a2\u8ba8\u4e86 PyTorch \u7684\u5386\u53f2\u3001\u7279\u6027\u3001\u7c7b\u578b\u3001\u5e94\u7528\u7a0b\u5e8f\u548c\u672a\u6765\u524d\u666f\uff0c\u5e76\u63a2\u8ba8\u4e86\u4ee3\u7406\u670d\u52a1\u5668\u5982\u4f55\u8865\u5145\u5176\u529f\u80fd\u3002<\/p>\n<h2>PyTorch \u7684\u8d77\u6e90<\/h2>\n<p>PyTorch \u8d77\u6e90\u4e8e Torch \u5e93\uff0c\u8be5\u5e93\u6700\u521d\u7531 Ronan Collobert \u548c\u4ed6\u7684\u8499\u7279\u5229\u5c14\u5927\u5b66\u56e2\u961f\u4e8e 2000 \u5e74\u4ee3\u521d\u5f00\u53d1\u3002\u7136\u800c\uff0cPyTorch \u7684\u6b63\u5f0f\u8bde\u751f\u53ef\u4ee5\u5f52\u529f\u4e8e Facebook \u7684\u4eba\u5de5\u667a\u80fd\u7814\u7a76\u5b9e\u9a8c\u5ba4\uff08FAIR\uff09\uff0c\u8be5\u5b9e\u9a8c\u5ba4\u4e8e 2016 \u5e74\u53d1\u5e03\u4e86 PyTorch\u3002\u8be5\u5e93\u7531\u4e8e\u5176\u76f4\u89c2\u7684\u8bbe\u8ba1\u548c\u52a8\u6001\u8ba1\u7b97\u56fe\u800c\u8fc5\u901f\u6d41\u884c\u8d77\u6765\uff0c\u8fd9\u4f7f\u5176\u4e0e\u5176\u4ed6\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff08\u5982TensorFlow\u3002\u8fd9\u79cd\u52a8\u6001\u56fe\u6784\u9020\u4e3a\u6a21\u578b\u5f00\u53d1\u548c\u8c03\u8bd5\u63d0\u4f9b\u4e86\u66f4\u5927\u7684\u7075\u6d3b\u6027\u3002<\/p>\n<h2>\u4e86\u89e3 PyTorch<\/h2>\n<p>PyTorch \u4ee5\u5176\u7b80\u5355\u6613\u7528\u800c\u95fb\u540d\u3002\u5b83\u91c7\u7528 Pythonic \u754c\u9762\uff0c\u7b80\u5316\u4e86\u6784\u5efa\u548c\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u7684\u8fc7\u7a0b\u3002 PyTorch \u7684\u6838\u5fc3\u662f\u5176\u5f20\u91cf\u8ba1\u7b97\u5e93\uff0c\u5b83\u63d0\u4f9b\u5bf9\u591a\u7ef4\u6570\u7ec4\u7684\u652f\u6301\uff0c\u7c7b\u4f3c\u4e8e NumPy \u6570\u7ec4\uff0c\u4f46\u5177\u6709 GPU \u52a0\u901f\u4ee5\u5b9e\u73b0\u66f4\u5feb\u7684\u8ba1\u7b97\u3002\u8fd9\u4f7f\u5f97\u80fd\u591f\u6709\u6548\u5904\u7406\u5927\u578b\u6570\u636e\u96c6\u548c\u590d\u6742\u7684\u6570\u5b66\u8fd0\u7b97\u3002<\/p>\n<h2>PyTorch\u7684\u5185\u90e8\u7ed3\u6784<\/h2>\n<p>PyTorch \u6309\u7167\u52a8\u6001\u8ba1\u7b97\u56fe\u7684\u539f\u7406\u8fd0\u884c\u3002\u4e0e\u5176\u4ed6\u6846\u67b6\u4f7f\u7528\u7684\u9759\u6001\u8ba1\u7b97\u56fe\u4e0d\u540c\uff0cPyTorch \u5728\u8fd0\u884c\u65f6\u52a8\u6001\u521b\u5efa\u56fe\u3002\u8fd9\u79cd\u52a8\u6001\u7279\u6027\u6709\u5229\u4e8e\u52a8\u6001\u63a7\u5236\u6d41\uff0c\u4ece\u800c\u66f4\u5bb9\u6613\u5b9e\u73b0\u6d89\u53ca\u4e0d\u540c\u8f93\u5165\u5927\u5c0f\u6216\u6761\u4ef6\u64cd\u4f5c\u7684\u590d\u6742\u67b6\u6784\u548c\u6a21\u578b\u3002<\/p>\n<h2>PyTorch \u7684\u4e3b\u8981\u7279\u70b9<\/h2>\n<ul>\n<li>\n<p><strong>\u52a8\u6001\u8ba1\u7b97\uff1a<\/strong> PyTorch \u7684\u52a8\u6001\u8ba1\u7b97\u56fe\u53ef\u4ee5\u8f7b\u677e\u8c03\u8bd5\u6a21\u578b\u5e76\u5b9e\u73b0\u52a8\u6001\u63a7\u5236\u6d41\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u81ea\u52a8\u8bc4\u5206\uff1a<\/strong> PyTorch \u4e2d\u7684\u81ea\u52a8\u5fae\u5206\u529f\u80fd\u901a\u8fc7\u5176 <code data-no-translation=\"\">autograd<\/code> \u5305\uff0c\u8ba1\u7b97\u68af\u5ea6\u5e76\u4fc3\u8fdb\u6709\u6548\u7684\u53cd\u5411\u4f20\u64ad\u8bad\u7ec3\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u6a21\u5757\u5316\u8bbe\u8ba1\uff1a<\/strong> PyTorch \u57fa\u4e8e\u6a21\u5757\u5316\u8bbe\u8ba1\u6784\u5efa\uff0c\u5141\u8bb8\u7528\u6237\u8f7b\u677e\u4fee\u6539\u3001\u6269\u5c55\u548c\u7ec4\u5408\u6846\u67b6\u7684\u4e0d\u540c\u7ec4\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u795e\u7ecf\u7f51\u7edc\u6a21\u5757\uff1a<\/strong> \u8fd9 <code data-no-translation=\"\">torch.nn<\/code> \u6a21\u5757\u63d0\u4f9b\u9884\u6784\u5efa\u5c42\u3001\u635f\u5931\u51fd\u6570\u548c\u4f18\u5316\u7b97\u6cd5\uff0c\u7b80\u5316\u4e86\u6784\u5efa\u590d\u6742\u795e\u7ecf\u7f51\u7edc\u7684\u8fc7\u7a0b\u3002<\/p>\n<\/li>\n<li>\n<p><strong>GPU\u52a0\u901f\uff1a<\/strong> PyTorch \u4e0e GPU \u65e0\u7f1d\u96c6\u6210\uff0c\u53ef\u663e\u7740\u52a0\u5feb\u8bad\u7ec3\u548c\u63a8\u7406\u4efb\u52a1\u7684\u901f\u5ea6\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>PyTorch \u7684\u7c7b\u578b<\/h2>\n<p>PyTorch \u6709\u4e24\u4e2a\u4e3b\u8981\u53d8\u4f53\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u706b\u70ac\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f20\u7edf\u7684 PyTorch \u5e93\u63d0\u4f9b\u4e86\u7528\u4e8e\u6784\u5efa\u548c\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u7684\u65e0\u7f1d\u63a5\u53e3\u3002<\/li>\n<li>\u9002\u5408\u559c\u6b22\u52a8\u6001\u8ba1\u7b97\u56fe\u7684\u7814\u7a76\u4eba\u5458\u548c\u5f00\u53d1\u4eba\u5458\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u706b\u70ac\u811a\u672c\uff1a<\/strong><\/p>\n<ul>\n<li>TorchScript \u662f PyTorch \u7684\u9759\u6001\u7c7b\u578b\u5b50\u96c6\uff0c\u4e13\u4e3a\u751f\u4ea7\u548c\u90e8\u7f72\u76ee\u7684\u800c\u8bbe\u8ba1\u3002<\/li>\n<li>\u975e\u5e38\u9002\u5408\u6548\u7387\u548c\u6a21\u578b\u90e8\u7f72\u81f3\u5173\u91cd\u8981\u7684\u573a\u666f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2>\u5e94\u7528\u548c\u6311\u6218<\/h2>\n<p>PyTorch \u5728\u5404\u4e2a\u9886\u57df\u90fd\u6709\u5e94\u7528\uff0c\u5305\u62ec\u8ba1\u7b97\u673a\u89c6\u89c9\u3001\u81ea\u7136\u8bed\u8a00\u5904\u7406\u548c\u5f3a\u5316\u5b66\u4e60\u3002\u7136\u800c\uff0c\u4f7f\u7528 PyTorch \u4e5f\u5e26\u6765\u4e86\u6311\u6218\uff0c\u4f8b\u5982\u9ad8\u6548\u7ba1\u7406\u5185\u5b58\u3001\u5904\u7406\u590d\u6742\u67b6\u6784\u4ee5\u53ca\u9488\u5bf9\u5927\u89c4\u6a21\u90e8\u7f72\u8fdb\u884c\u4f18\u5316\u3002<\/p>\n<h2>\u6bd4\u8f83\u4e0e\u672a\u6765\u5c55\u671b<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u7279\u5f81<\/th>\n<th>\u706b\u70ac<\/th>\n<th>TensorFlow<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u52a8\u6001\u8ba1\u7b97<\/td>\n<td>\u662f\u7684<\/td>\n<td>\u4e0d<\/td>\n<\/tr>\n<tr>\n<td>\u91c7\u7528\u901f\u5ea6<\/td>\n<td>\u8fc5\u901f\u7684<\/td>\n<td>\u5faa\u5e8f\u6e10\u8fdb<\/td>\n<\/tr>\n<tr>\n<td>\u5b66\u4e60\u66f2\u7ebf<\/td>\n<td>\u6e29\u548c\u7684<\/td>\n<td>\u66f4\u9661<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u6001\u7cfb\u7edf<\/td>\n<td>\u6210\u957f\u4e14\u5145\u6ee1\u6d3b\u529b<\/td>\n<td>\u6210\u719f\u4e14\u591a\u5143\u5316<\/td>\n<\/tr>\n<tr>\n<td>\u90e8\u7f72\u6548\u7387<\/td>\n<td>\u4e00\u4e9b\u5f00\u9500<\/td>\n<td>\u4f18\u5316<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>PyTorch \u7684\u672a\u6765\u770b\u8d77\u6765\u5145\u6ee1\u5e0c\u671b\uff0c\u5b83\u5728\u786c\u4ef6\u517c\u5bb9\u6027\u65b9\u9762\u4e0d\u65ad\u8fdb\u6b65\uff0c\u6539\u8fdb\u4e86\u90e8\u7f72\u9009\u9879\uff0c\u5e76\u589e\u5f3a\u4e86\u4e0e\u5176\u4ed6\u4eba\u5de5\u667a\u80fd\u6846\u67b6\u7684\u96c6\u6210\u3002<\/p>\n<h2>PyTorch \u548c\u4ee3\u7406\u670d\u52a1\u5668<\/h2>\n<p>\u4ee3\u7406\u670d\u52a1\u5668\u5728\u4eba\u5de5\u667a\u80fd\u5f00\u53d1\u548c\u90e8\u7f72\u7684\u5404\u4e2a\u65b9\u9762\u53d1\u6325\u7740\u81f3\u5173\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u5305\u62ec PyTorch \u5e94\u7528\u7a0b\u5e8f\u3002\u4ed6\u4eec\u63d0\u4f9b\u7684\u597d\u5904\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u7f13\u5b58\uff1a<\/strong> \u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u7f13\u5b58\u6a21\u578b\u6743\u91cd\u548c\u6570\u636e\uff0c\u4ece\u800c\u51cf\u5c11\u91cd\u590d\u6a21\u578b\u63a8\u7406\u671f\u95f4\u7684\u5ef6\u8fdf\u3002<\/li>\n<li><strong>\u8d1f\u8f7d\u5747\u8861\uff1a<\/strong> \u5b83\u4eec\u5c06\u4f20\u5165\u8bf7\u6c42\u5206\u5e03\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\uff0c\u786e\u4fdd\u8d44\u6e90\u7684\u6709\u6548\u5229\u7528\u3002<\/li>\n<li><strong>\u5b89\u5168\uff1a<\/strong> \u4ee3\u7406\u5145\u5f53\u4e2d\u4ecb\uff0c\u901a\u8fc7\u4fdd\u62a4\u5185\u90e8\u57fa\u7840\u8bbe\u65bd\u514d\u53d7\u76f4\u63a5\u5916\u90e8\u8bbf\u95ee\u6765\u589e\u52a0\u989d\u5916\u7684\u5b89\u5168\u5c42\u3002<\/li>\n<li><strong>\u533f\u540d\uff1a<\/strong> \u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u5bf9\u8bf7\u6c42\u8fdb\u884c\u533f\u540d\u5904\u7406\uff0c\u8fd9\u5728\u5904\u7406\u654f\u611f\u6570\u636e\u6216\u8fdb\u884c\u7814\u7a76\u65f6\u81f3\u5173\u91cd\u8981\u3002<\/li>\n<\/ul>\n<h2>\u76f8\u5173\u94fe\u63a5<\/h2>\n<p>\u6709\u5173 PyTorch \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u4ee5\u4e0b\u8d44\u6e90\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/pytorch.org\" target=\"_new\" rel=\"noopener nofollow\">PyTorch \u5b98\u65b9\u7f51\u7ad9<\/a><\/li>\n<li><a href=\"https:\/\/pytorch.org\/tutorials\" target=\"_new\" rel=\"noopener nofollow\">PyTorch \u6559\u7a0b<\/a><\/li>\n<li><a href=\"https:\/\/pytorch.org\/docs\" target=\"_new\" rel=\"noopener nofollow\">PyTorch \u6587\u6863<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pytorch\/pytorch\" target=\"_new\" rel=\"noopener nofollow\">PyTorch GitHub \u5b58\u50a8\u5e93<\/a><\/li>\n<\/ul>\n<p>\u603b\u4e4b\uff0cPyTorch \u51ed\u501f\u5176\u52a8\u6001\u8ba1\u7b97\u80fd\u529b\u3001\u6a21\u5757\u5316\u8bbe\u8ba1\u548c\u5e7f\u6cdb\u7684\u793e\u533a\u652f\u6301\u5f7b\u5e95\u6539\u53d8\u4e86\u6df1\u5ea6\u5b66\u4e60\u7684\u683c\u5c40\u3002\u968f\u7740\u5b83\u7684\u4e0d\u65ad\u53d1\u5c55\uff0cPyTorch \u4ecd\u7136\u5904\u4e8e\u4eba\u5de5\u667a\u80fd\u521b\u65b0\u7684\u524d\u6cbf\uff0c\u63a8\u52a8\u5404\u4e2a\u9886\u57df\u7684\u7814\u7a76\u548c\u5e94\u7528\u7684\u8fdb\u6b65\u3002\u5f53\u4e0e\u4ee3\u7406\u670d\u52a1\u5668\u7684\u529f\u80fd\u76f8\u7ed3\u5408\u65f6\uff0c\u9ad8\u6548\u3001\u5b89\u5168\u7684\u4eba\u5de5\u667a\u80fd\u5f00\u53d1\u7684\u53ef\u80fd\u6027\u53d8\u5f97\u66f4\u52a0\u6709\u5e0c\u671b\u3002<\/p>","protected":false},"featured_media":469282,"menu_order":0,"template":"","meta":{"_acf_changed":false,"content-type":"","inline_featured_image":false,"footnotes":""},"class_list":["post-478588","wiki","type-wiki","status-publish","has-post-thumbnail","hentry"],"acf":{"faq_title":"Frequently Asked Questions about <mark>PyTorch: Powering the Future of Deep Learning<\/mark>","faq_items":[{"question":"What is PyTorch and why is it important for AI?","answer":"<p>PyTorch is an open-source machine learning library known for its flexibility and dynamic approach to building neural networks. It's essential for AI development as it offers an intuitive interface, dynamic computation graphs, and powerful GPU acceleration.<\/p>"},{"question":"How did PyTorch originate and who developed it?","answer":"<p>PyTorch emerged from the Torch library, originally created by Ronan Collobert and his team. The formal release came from Facebook's AI Research lab in 2016, gaining popularity for its dynamic graph construction and user-friendly design.<\/p>"},{"question":"What sets PyTorch apart from other deep learning frameworks?","answer":"<p>PyTorch stands out with its dynamic computation graph, enabling dynamic control flow and easy debugging. Unlike static graphs, PyTorch constructs graphs during runtime, making complex architectures and conditional operations simpler to implement.<\/p>"},{"question":"What are the key features of PyTorch?","answer":"<p>PyTorch boasts dynamic computation, automatic differentiation (autograd), modular design, pre-built neural network modules, and efficient GPU acceleration. These features make it a preferred choice for researchers and developers.<\/p>"},{"question":"What are the types of PyTorch available?","answer":"<p>There are two main variations of PyTorch: the traditional PyTorch library and TorchScript. While PyTorch offers dynamic computation graphs, TorchScript provides a statically-typed subset for production and deployment purposes.<\/p>"},{"question":"How can proxy servers be used with PyTorch?","answer":"<p>Proxy servers complement PyTorch by offering caching, load balancing, security, and anonymity benefits. They improve model inference speed, enhance security, and optimize resource utilization in AI development.<\/p>"},{"question":"Where can I learn more about PyTorch?","answer":"<p>For more information, you can visit the <a href=\"https:\/\/pytorch.org\" target=\"_new\">Official PyTorch Website<\/a>, explore <a href=\"https:\/\/pytorch.org\/tutorials\" target=\"_new\">PyTorch Tutorials<\/a>, refer to the <a href=\"https:\/\/pytorch.org\/docs\" target=\"_new\">PyTorch Documentation<\/a>, or check out the <a href=\"https:\/\/github.com\/pytorch\/pytorch\" target=\"_new\">PyTorch GitHub Repository<\/a>.<\/p>"}]},"_links":{"self":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki\/478588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki"}],"about":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/types\/wiki"}],"version-history":[{"count":0,"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki\/478588\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/media\/469282"}],"wp:attachment":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/media?parent=478588"}],"curies":[{"name":"\u53ef\u6e7f\u6027\u7c89\u5242","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}