{"id":7840,"date":"2023-10-06T12:35:24","date_gmt":"2023-10-06T20:35:24","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7840"},"modified":"2025-04-24T17:05:59","modified_gmt":"2025-04-24T17:05:59","slug":"10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/","title":{"rendered":"10 reasons why PyTorch is the deep learning framework of the future"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\">\n\n\n\n<div class=\"fi fj fk fl fm\">\n<div class=\"lu bg\">\n<figure class=\"lv lw lx ly lz lu bg paragraph-image\"><picture><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:2500\/1*IAE_omA9Mf1w7vb5ZmRMCQ.jpeg\" alt=\"\" width=\"2400\" height=\"1667\"><\/picture><figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@mauimaniacs?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener ugc nofollow\">Kevin Finneran<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/search\/photos\/torch?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption><\/figure>\n<\/div>\n<div class=\"ab ca\">\n<div class=\"ch bg eu ev ew ex\">\n<p id=\"09a3\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">It doesn\u2019t matter whether you\u2019re a student, a researcher, a data scientist, a machine learning engineer, or just a machine learning enthusiast, you\u2019re surely going to find PyTorch very useful.<\/p>\n<p id=\"1a78\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">As you might be aware, <a class=\"af mj\" href=\"https:\/\/heartbeat.comet.ml\/introduction-to-pytorch-for-deep-learning-5b437cea90ac\" target=\"_blank\" rel=\"noopener ugc nofollow\">PyTorch<\/a> is an open source machine learning library used primarily for applications such as <a class=\"af mj\" href=\"https:\/\/heartbeat.comet.ml\/the-5-computer-vision-techniques-that-will-change-how-you-see-the-world-1ee19334354b\" target=\"_blank\" rel=\"noopener ugc nofollow\">computer vision<\/a> and <a class=\"af mj\" href=\"https:\/\/heartbeat.comet.ml\/the-7-nlp-techniques-that-will-change-how-you-communicate-in-the-future-part-i-f0114b2f0497\" target=\"_blank\" rel=\"noopener ugc nofollow\">natural language processing.<\/a><\/p>\n<p id=\"806e\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch is a strong player in the field of deep learning and artificial intelligence, and it can be considered primarily as a research-first library.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*bJA8cmEazdHlVj1y\" alt=\"PyTorch Deep Learning\" width=\"700\" height=\"390\"><\/figure><div class=\"mf mg nh\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*bJA8cmEazdHlVj1y 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*bJA8cmEazdHlVj1y 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*bJA8cmEazdHlVj1y 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*bJA8cmEazdHlVj1y 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*bJA8cmEazdHlVj1y 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*bJA8cmEazdHlVj1y 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*bJA8cmEazdHlVj1y 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*bJA8cmEazdHlVj1y 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*bJA8cmEazdHlVj1y 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*bJA8cmEazdHlVj1y 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*bJA8cmEazdHlVj1y 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*bJA8cmEazdHlVj1y 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*bJA8cmEazdHlVj1y 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*bJA8cmEazdHlVj1y 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@martinsattler?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Martin Sattler<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<p id=\"b618\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">Lets\u2019s take a look at the top 10 reasons why PyTorch is one of the most popular deep learning frameworks out there<\/p>\n<h1 id=\"c8a4\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\"><strong class=\"al\">1. PyTorch is Pythonic<\/strong><\/h1>\n<p id=\"c076\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">Python is one of the most popular language used by data scientists. When I use the term \u201cPythonic\u201d, I mean that PyTorch is more attached to or leaning towards Python as its primary programming language. Perhaps not coincidentally, <a class=\"af mj\" href=\"https:\/\/heartbeat.comet.ml\/some-essential-hacks-and-tricks-for-machine-learning-with-python-5478bc6593f2\" target=\"_blank\" rel=\"noopener ugc nofollow\">Python<\/a> is also one of the most popular languages used for building machine learning models and for ML research.<\/p>\n<p id=\"2b59\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch is built to be seamlessly integrated with Python and its popular libraries like NumPy. Check out the code snippet below to see how easy it is to manipulate a NumPy array using PyTorch:<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg\" alt=\"\" width=\"700\" height=\"446\"><\/figure><div class=\"mf mg ou\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*2CxjYYlkOSvjpvBFDeZMWw.jpeg 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">PyTorch and numpy \u2014 The Pythonic view<\/figcaption>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*TzALZF_4hwp8cLrq\" alt=\"\" width=\"700\" height=\"394\"><\/figure><div class=\"mf mg ov\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*TzALZF_4hwp8cLrq 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*TzALZF_4hwp8cLrq 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*TzALZF_4hwp8cLrq 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*TzALZF_4hwp8cLrq 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*TzALZF_4hwp8cLrq 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*TzALZF_4hwp8cLrq 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*TzALZF_4hwp8cLrq 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*TzALZF_4hwp8cLrq 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*TzALZF_4hwp8cLrq 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*TzALZF_4hwp8cLrq 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*TzALZF_4hwp8cLrq 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*TzALZF_4hwp8cLrq 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*TzALZF_4hwp8cLrq 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*TzALZF_4hwp8cLrq 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@hiteshchoudhary?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Hitesh Choudhary<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"54ec\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">2. <strong class=\"al\">Easy to learn<\/strong><\/h1>\n<p id=\"0736\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch is comparatively easier to learn than other deep learning frameworks. This is because its syntax and application are similar to many conventional programming languages like Python.<\/p>\n<p id=\"b233\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\"><a class=\"af mj\" href=\"https:\/\/pytorch.org\/docs\/stable\/index.html\" target=\"_blank\" rel=\"noopener ugc nofollow\">PyTorch\u2019s documentation<\/a> is also very organized and helpful for beginners. And a <a class=\"af mj\" href=\"https:\/\/discuss.pytorch.org\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">focused community of developers<\/a> are also helping to continuously improve PyTorch.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:473\/1*DClZOwBM_YN66oje6LjArg.jpeg\" alt=\"\" width=\"473\" height=\"220\"><\/figure><div class=\"mf mg ow\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:946\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 946w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 473px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*DClZOwBM_YN66oje6LjArg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*DClZOwBM_YN66oje6LjArg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*DClZOwBM_YN66oje6LjArg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*DClZOwBM_YN66oje6LjArg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*DClZOwBM_YN66oje6LjArg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*DClZOwBM_YN66oje6LjArg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:946\/1*DClZOwBM_YN66oje6LjArg.jpeg 946w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 473px\" data-testid=\"og\"><\/picture><\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Defining Machine Learning Model in PyTorch<\/figcaption>\n<\/figure>\n<p id=\"3052\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">As you can see above, defining a machine learning model in PyTorch is as easy as defining a class in Python, with just a few methods.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*S3EIXFqPUKJU8tPP\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"mf mg ox\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*S3EIXFqPUKJU8tPP 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*S3EIXFqPUKJU8tPP 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*S3EIXFqPUKJU8tPP 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*S3EIXFqPUKJU8tPP 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*S3EIXFqPUKJU8tPP 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*S3EIXFqPUKJU8tPP 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*S3EIXFqPUKJU8tPP 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*S3EIXFqPUKJU8tPP 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*S3EIXFqPUKJU8tPP 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*S3EIXFqPUKJU8tPP 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*S3EIXFqPUKJU8tPP 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*S3EIXFqPUKJU8tPP 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*S3EIXFqPUKJU8tPP 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*S3EIXFqPUKJU8tPP 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@timmossholder?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Tim Mossholder<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fi fj fk fl fm\">\n<div class=\"ab ca\">\n<div class=\"ch bg eu ev ew ex\">\n<h1 id=\"dd85\" class=\"nr ns fp be nt nu pq nw nx ny pr oa ob oc ps oe of og pt oi oj ok pu om on oo bj\" data-selectable-paragraph=\"\">3. Higher d<strong class=\"al\">eveloper productivity<\/strong><\/h1>\n<p id=\"48ec\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch is very simple to use, which also means that the learning curve for developers is relatively short.<\/p>\n<p id=\"a85d\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch has a simple Python interface and provides a simple yet powerful API. PyTorch can also be easily implemented on both Windows and Linux.<\/p>\n<p id=\"0b39\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch is easier to learn as it is <strong class=\"be pv\">not<\/strong> a completely different syntax for someone coming from programming background. The code below demonstrates that general programming practices like implementing variables, random numbers, square, and multiplication syntax are all very intuitive.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:473\/1*DClZOwBM_YN66oje6LjArg.jpeg\" alt=\"\" width=\"473\" height=\"220\"><\/figure><div class=\"mf mg ow\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:946\/format:webp\/1*DClZOwBM_YN66oje6LjArg.jpeg 946w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 473px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*DClZOwBM_YN66oje6LjArg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*DClZOwBM_YN66oje6LjArg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*DClZOwBM_YN66oje6LjArg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*DClZOwBM_YN66oje6LjArg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*DClZOwBM_YN66oje6LjArg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*DClZOwBM_YN66oje6LjArg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:946\/1*DClZOwBM_YN66oje6LjArg.jpeg 946w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 473px\" data-testid=\"og\"><\/picture><\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">PyTorch Simple Syntax<\/figcaption>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*NzGVR4ZgTXECO_6M\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"mf mg pw\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*NzGVR4ZgTXECO_6M 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*NzGVR4ZgTXECO_6M 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*NzGVR4ZgTXECO_6M 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*NzGVR4ZgTXECO_6M 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*NzGVR4ZgTXECO_6M 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*NzGVR4ZgTXECO_6M 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*NzGVR4ZgTXECO_6M 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*NzGVR4ZgTXECO_6M 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*NzGVR4ZgTXECO_6M 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*NzGVR4ZgTXECO_6M 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*NzGVR4ZgTXECO_6M 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*NzGVR4ZgTXECO_6M 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*NzGVR4ZgTXECO_6M 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*NzGVR4ZgTXECO_6M 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@schmaendels?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Andreas Klassen<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"5804\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">4. <strong class=\"al\">Easy debugging<\/strong><\/h1>\n<p id=\"ecdd\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">As PyTorch is deeply integrated with Python, many Python debugging tools can also be used in PyTorch code. Specifically, Python\u2019s <a class=\"af mj\" href=\"https:\/\/docs.python.org\/3\/library\/pdb.html\" target=\"_blank\" rel=\"noopener ugc nofollow\">pdb<\/a> and <a class=\"af mj\" href=\"https:\/\/pypi.org\/project\/ipdb\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">ipdb<\/a> tools can be used for this kind of debugging in PyTorch.<\/p>\n<p id=\"a4e8\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">Python\u2019s IDE <a class=\"af mj\" href=\"https:\/\/www.jetbrains.com\/pycharm\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">PyCharm<\/a> also has a <a class=\"af mj\" href=\"https:\/\/www.jetbrains.com\/help\/pycharm\/debugging-code.html\" target=\"_blank\" rel=\"noopener ugc nofollow\">debugger<\/a> can also be used to debug PyTorch code. All this is possible as a computational graph in PyTorch that\u2019s defined at runtime.<\/p>\n<p id=\"9a95\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">If you\u2019re getting error in your code, you can start debugging by placing breakpoints using <code class=\"cw px py pz qa b\">pdb.set_trace()<\/code> at any appropriate line in your code. Then you can execute further computations and check the PyTorch Tensors or variables and nail down the root cause of the error.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg\" alt=\"\" width=\"700\" height=\"192\"><\/figure><div class=\"mf mg qb\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*o7LxLxKg3C-ZbGBSyt7FBg.jpeg 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">PyTorch Debugging with pdb<\/figcaption>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*SG7vktd6-4UB3wZu\" alt=\"Bug PyTorch\" width=\"700\" height=\"700\"><\/figure><div class=\"mf mg qc\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*SG7vktd6-4UB3wZu 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*SG7vktd6-4UB3wZu 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*SG7vktd6-4UB3wZu 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*SG7vktd6-4UB3wZu 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*SG7vktd6-4UB3wZu 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*SG7vktd6-4UB3wZu 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*SG7vktd6-4UB3wZu 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*SG7vktd6-4UB3wZu 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*SG7vktd6-4UB3wZu 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*SG7vktd6-4UB3wZu 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*SG7vktd6-4UB3wZu 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*SG7vktd6-4UB3wZu 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*SG7vktd6-4UB3wZu 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*SG7vktd6-4UB3wZu 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@cbryant?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Caleb Bryant<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"40bb\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">5. <strong class=\"al\">Data Parallelism<\/strong><\/h1>\n<p id=\"731e\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch has a very useful feature known as <a class=\"af mj\" href=\"https:\/\/pytorch.org\/tutorials\/beginner\/blitz\/data_parallel_tutorial.html\" target=\"_blank\" rel=\"noopener ugc nofollow\">data parallelism<\/a>. Using this feature, PyTorch can distribute computational work among multiple CPU or GPU cores.<\/p>\n<p id=\"8146\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">This feature of PyTorch allows us to use <code class=\"cw px py pz qa b\">torch.nn.DataParallel<\/code> to wrap any module and helps us do parallel processing over batch dimension.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*l0L_4rVQA93QHERVEjj33w.jpeg\" alt=\"\" width=\"700\" height=\"183\"><\/figure><div class=\"mf mg qd\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*l0L_4rVQA93QHERVEjj33w.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*l0L_4rVQA93QHERVEjj33w.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*l0L_4rVQA93QHERVEjj33w.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*l0L_4rVQA93QHERVEjj33w.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*l0L_4rVQA93QHERVEjj33w.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*l0L_4rVQA93QHERVEjj33w.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*l0L_4rVQA93QHERVEjj33w.jpeg 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*l0L_4rVQA93QHERVEjj33w.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*l0L_4rVQA93QHERVEjj33w.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*l0L_4rVQA93QHERVEjj33w.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*l0L_4rVQA93QHERVEjj33w.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*l0L_4rVQA93QHERVEjj33w.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*l0L_4rVQA93QHERVEjj33w.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*l0L_4rVQA93QHERVEjj33w.jpeg 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">PyTorch Data Parallel<\/figcaption>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*MfLdEg4WSVL7UebS\" alt=\"Data Parallelism in PyTorch\" width=\"700\" height=\"525\"><\/figure><div class=\"mf mg qe\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*MfLdEg4WSVL7UebS 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*MfLdEg4WSVL7UebS 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*MfLdEg4WSVL7UebS 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*MfLdEg4WSVL7UebS 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*MfLdEg4WSVL7UebS 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*MfLdEg4WSVL7UebS 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*MfLdEg4WSVL7UebS 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*MfLdEg4WSVL7UebS 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*MfLdEg4WSVL7UebS 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*MfLdEg4WSVL7UebS 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*MfLdEg4WSVL7UebS 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*MfLdEg4WSVL7UebS 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*MfLdEg4WSVL7UebS 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*MfLdEg4WSVL7UebS 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@greyes88?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Gilberto Reyes<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"596e\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">6. <strong class=\"al\">Dynamic Computational Graph Support<\/strong><\/h1>\n<p id=\"e1cd\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch supports <a class=\"af mj\" href=\"https:\/\/medium.com\/intuitionmachine\/pytorch-dynamic-computational-graphs-and-modular-deep-learning-7e7f89f18d1\" rel=\"noopener\">dynamic computational graphs<\/a>, which means the network behavior can be changed programmatically at runtime. This facilitates more efficient model optimization and gives PyTorch a major advantage over other machine learning frameworks, which treat neural networks as static objects.<\/p>\n<p id=\"9593\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">With this dynamic approach, we can fully see each and every computation and know exactly what is going on.<\/p>\n<p id=\"39fa\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">When the flow of data and the corresponding operations are defined at runtime, the construction of the computational graph happens dynamically. This is done with the help of autograd class implicitly, as shown below:<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*cExnOZN8GJtQpSLArkiR0w.jpeg\" alt=\"\" width=\"700\" height=\"435\"><\/figure><div class=\"mf mg qf\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*cExnOZN8GJtQpSLArkiR0w.jpeg 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">PyTorch requires_grad example<\/figcaption>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*figM4Urk5fdIFu9h\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"mf mg qg\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*figM4Urk5fdIFu9h 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*figM4Urk5fdIFu9h 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*figM4Urk5fdIFu9h 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*figM4Urk5fdIFu9h 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*figM4Urk5fdIFu9h 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*figM4Urk5fdIFu9h 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*figM4Urk5fdIFu9h 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*figM4Urk5fdIFu9h 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*figM4Urk5fdIFu9h 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*figM4Urk5fdIFu9h 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*figM4Urk5fdIFu9h 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*figM4Urk5fdIFu9h 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*figM4Urk5fdIFu9h 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*figM4Urk5fdIFu9h 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@m_b_m?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">M. B. M.<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"b9a3\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">7. <strong class=\"al\">Hybrid Front-End<\/strong><\/h1>\n<p id=\"0311\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch also provides a new hybrid front-end. This means we have two modes of operation, namely eager mode and graph mode.<\/p>\n<p id=\"1e8b\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">We generally use eager mode for research and development, as this mode provides flexibility and ease of use. And we generally use graph mode for production, as this provides better speed, optimization, and functionality in a C++ runtime environment.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg\" alt=\"\" width=\"700\" height=\"168\"><\/figure><div class=\"mf mg qh\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*gPezo3DMM8ZOzG8kpq3bEw.jpeg 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">PyTorch Train and eval mode<\/figcaption>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*mDITBwNOxJNo1B61\" alt=\"\" width=\"700\" height=\"394\"><\/figure><div class=\"mf mg qi\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*mDITBwNOxJNo1B61 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*mDITBwNOxJNo1B61 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*mDITBwNOxJNo1B61 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*mDITBwNOxJNo1B61 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*mDITBwNOxJNo1B61 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*mDITBwNOxJNo1B61 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*mDITBwNOxJNo1B61 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*mDITBwNOxJNo1B61 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*mDITBwNOxJNo1B61 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*mDITBwNOxJNo1B61 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*mDITBwNOxJNo1B61 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*mDITBwNOxJNo1B61 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*mDITBwNOxJNo1B61 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*mDITBwNOxJNo1B61 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@gpthree?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">George Pagan III<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"2339\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">8. Useful <strong class=\"al\">Libraries<\/strong><\/h1>\n<p id=\"38d2\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">A large community of developers have built many tools and libraries for extending PyTorch. The community is also supporting development in computer vision, reinforcement learning, and much more.<\/p>\n<p id=\"66de\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">This will surely bolster PyTorch\u2019s reach as a fully-featured deep learning library for both research and production purposes. Here are a few examples of popular libraries:<\/p>\n<ul class=\"\">\n<li id=\"2beb\" class=\"mk ml fp be b mm mn mo mp mq mr ms mt mu qj mw mx my qk na nb nc ql ne nf ng qm qn qo bj\" data-selectable-paragraph=\"\"><a class=\"af mj\" href=\"https:\/\/gpytorch.ai\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">GPyTorch<\/a> is a highly efficient and modular implementation with GPU acceleration. It\u2019s implemented in PyTorch and combines Gaussian processes with deep neural networks<em class=\"qp\">.<\/em><\/li>\n<li id=\"58b4\" class=\"mk ml fp be b mm qq mo mp mq qr ms mt mu qs mw mx my qt na nb nc qu ne nf ng qm qn qo bj\" data-selectable-paragraph=\"\"><a class=\"af mj\" href=\"https:\/\/botorch.org\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">BoTorch<\/a> is a PyTorch-related library for Bayesian optimization.<\/li>\n<li id=\"4b14\" class=\"mk ml fp be b mm qq mo mp mq qr ms mt mu qs mw mx my qt na nb nc qu ne nf ng qm qn qo bj\" data-selectable-paragraph=\"\"><a class=\"af mj\" href=\"https:\/\/allennlp.org\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">AllenNLP<\/a> is an open-source NLP research library, built on PyTorch.<\/li>\n<\/ul>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*cwnlBzhExIjtqqFM\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"mf mg qv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*cwnlBzhExIjtqqFM 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*cwnlBzhExIjtqqFM 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*cwnlBzhExIjtqqFM 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*cwnlBzhExIjtqqFM 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*cwnlBzhExIjtqqFM 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*cwnlBzhExIjtqqFM 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*cwnlBzhExIjtqqFM 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*cwnlBzhExIjtqqFM 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*cwnlBzhExIjtqqFM 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*cwnlBzhExIjtqqFM 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*cwnlBzhExIjtqqFM 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*cwnlBzhExIjtqqFM 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*cwnlBzhExIjtqqFM 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*cwnlBzhExIjtqqFM 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@eliabevces?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Eliabe Costa<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"5900\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">9. Open Neural Network Exchange support<\/h1>\n<p id=\"99af\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\"><a class=\"af mj\" href=\"https:\/\/onnx.ai\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">ONNX<\/a> stands for Open Neural Network Exchange. With ONNX, AI developers can easily move models between different tools and choose the combination that work best for them and their given use case.<\/p>\n<p id=\"75a5\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch has native ONNX support and can export models in the standard Open Neural Network Exchange format.<\/p>\n<p id=\"8f69\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">This will enable PyTorch-based models to direct access the ONNX-compatible platforms and run-times.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg\" alt=\"\" width=\"700\" height=\"188\"><\/figure><div class=\"mf mg qw\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*1f1R62jcQbC-A-mJSPw8tg.jpeg 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">PyTorch Open Neural Network Exchange ONNX<\/figcaption>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*jUs1ilWc08jeRBxe\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"mf mg ov\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*jUs1ilWc08jeRBxe 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*jUs1ilWc08jeRBxe 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*jUs1ilWc08jeRBxe 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*jUs1ilWc08jeRBxe 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*jUs1ilWc08jeRBxe 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*jUs1ilWc08jeRBxe 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*jUs1ilWc08jeRBxe 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*jUs1ilWc08jeRBxe 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*jUs1ilWc08jeRBxe 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*jUs1ilWc08jeRBxe 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*jUs1ilWc08jeRBxe 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*jUs1ilWc08jeRBxe 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*jUs1ilWc08jeRBxe 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*jUs1ilWc08jeRBxe 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@wedding_photography?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Wedding Photography<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"d231\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">10. <strong class=\"al\">Cloud support<\/strong><\/h1>\n<p id=\"1d5e\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch is also well-received by major cloud platforms, allowing developers and engineers to do large-scale training jobs on GPUs with PyTorch.<\/p>\n<p id=\"0e01\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">PyTorch\u2019s cloud support also provides the ability to run models in a production environment. Not only that, we can also scale our PyTorch model using the cloud. For example, you can use the below code to work with <a class=\"af mj\" href=\"https:\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/pytorch.html\" target=\"_blank\" rel=\"noopener ugc nofollow\">PyTorch using AWS Sagemaker<\/a>.<\/p>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg\" alt=\"\" width=\"700\" height=\"110\"><\/figure><div class=\"mf mg qx\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*F_Drt4NJVqyuSZiekDEKTQ.jpeg 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<figure class=\"ni nj nk nl nm lu mf mg paragraph-image\">\n<div class=\"nn no ec np bg nq\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg ma mb c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*O7UObJ9KaPVs0MlF\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"mf mg qg\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*O7UObJ9KaPVs0MlF 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*O7UObJ9KaPVs0MlF 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*O7UObJ9KaPVs0MlF 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*O7UObJ9KaPVs0MlF 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*O7UObJ9KaPVs0MlF 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*O7UObJ9KaPVs0MlF 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*O7UObJ9KaPVs0MlF 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*O7UObJ9KaPVs0MlF 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*O7UObJ9KaPVs0MlF 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*O7UObJ9KaPVs0MlF 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*O7UObJ9KaPVs0MlF 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*O7UObJ9KaPVs0MlF 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*O7UObJ9KaPVs0MlF 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*O7UObJ9KaPVs0MlF 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mc md me mf mg mh mi be b bf z dw\" data-selectable-paragraph=\"\">Photo by <a class=\"af mj\" href=\"https:\/\/unsplash.com\/@alexmachado?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Alex Machado<\/a> on <a class=\"af mj\" href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\" target=\"_blank\" rel=\"noopener ugc nofollow\">Unsplash<\/a><\/figcaption>\n<\/figure>\n<h1 id=\"27e9\" class=\"nr ns fp be nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo bj\" data-selectable-paragraph=\"\">Concluding Thoughts<\/h1>\n<p id=\"a363\" class=\"pw-post-body-paragraph mk ml fp be b mm op mo mp mq oq ms mt mu or mw mx my os na nb nc ot ne nf ng fi bj\" data-selectable-paragraph=\"\">We now have ten strong points to support our decision to select PyTorch as our preferred deep learning framework.<\/p>\n<p id=\"ed31\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">I would also like to mention that PyTorch provides excellent community support with a highly active developer community as well.<\/p>\n<p id=\"242c\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">I hope these points will motivate you to try building a machine learning model using PyTorch.<\/p>\n<p id=\"aa3b\" class=\"pw-post-body-paragraph mk ml fp be b mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng fi bj\" data-selectable-paragraph=\"\">Happy machine learning!! \ud83d\ude42<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Photo by Kevin Finneran on Unsplash It doesn\u2019t matter whether you\u2019re a student, a researcher, a data scientist, a machine learning engineer, or just a machine learning enthusiast, you\u2019re surely going to find PyTorch very useful. As you might be aware, PyTorch is an open source machine learning library used primarily for applications such as [&hellip;]<\/p>\n","protected":false},"author":48,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"coauthors":[119],"class_list":["post-7840","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>10 reasons why PyTorch is the deep learning framework of the future - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"10 reasons why PyTorch is the deep learning framework of the future\" \/>\n<meta property=\"og:description\" content=\"Photo by Kevin Finneran on Unsplash It doesn\u2019t matter whether you\u2019re a student, a researcher, a data scientist, a machine learning engineer, or just a machine learning enthusiast, you\u2019re surely going to find PyTorch very useful. As you might be aware, PyTorch is an open source machine learning library used primarily for applications such as [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-06T20:35:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:05:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:2500\/1*IAE_omA9Mf1w7vb5ZmRMCQ.jpeg\" \/>\n<meta name=\"author\" content=\"Dhiraj K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dhiraj K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"10 reasons why PyTorch is the deep learning framework of the future - Comet","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/","og_locale":"en_US","og_type":"article","og_title":"10 reasons why PyTorch is the deep learning framework of the future","og_description":"Photo by Kevin Finneran on Unsplash It doesn\u2019t matter whether you\u2019re a student, a researcher, a data scientist, a machine learning engineer, or just a machine learning enthusiast, you\u2019re surely going to find PyTorch very useful. As you might be aware, PyTorch is an open source machine learning library used primarily for applications such as [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-10-06T20:35:24+00:00","article_modified_time":"2025-04-24T17:05:59+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:2500\/1*IAE_omA9Mf1w7vb5ZmRMCQ.jpeg","type":"","width":"","height":""}],"author":"Dhiraj K","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Dhiraj K","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/"},"author":{"name":"Dhiraj K","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/249d8447ec1dd5591b4602e18408815a"},"headline":"10 reasons why PyTorch is the deep learning framework of the future","datePublished":"2023-10-06T20:35:24+00:00","dateModified":"2025-04-24T17:05:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/"},"wordCount":1096,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:2500\/1*IAE_omA9Mf1w7vb5ZmRMCQ.jpeg","articleSection":["Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/","url":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/","name":"10 reasons why PyTorch is the deep learning framework of the future - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:2500\/1*IAE_omA9Mf1w7vb5ZmRMCQ.jpeg","datePublished":"2023-10-06T20:35:24+00:00","dateModified":"2025-04-24T17:05:59+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:2500\/1*IAE_omA9Mf1w7vb5ZmRMCQ.jpeg","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:2500\/1*IAE_omA9Mf1w7vb5ZmRMCQ.jpeg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/10-reasons-why-pytorch-is-the-deep-learning-framework-of-the-future\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"10 reasons why PyTorch is the deep learning framework of the future"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/249d8447ec1dd5591b4602e18408815a","name":"Dhiraj K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/09c08b3ff448a15a03f233edc2fbd654","url":"https:\/\/secure.gravatar.com\/avatar\/0bcf1f88f82cbd9a2dd63d2c7cbfa8b3af7e49735653bfbad4abf19c709c2db5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0bcf1f88f82cbd9a2dd63d2c7cbfa8b3af7e49735653bfbad4abf19c709c2db5?s=96&d=mm&r=g","caption":"Dhiraj K"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/dhiraj10099gmail-com\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/48"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7840"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7840\/revisions"}],"predecessor-version":[{"id":15517,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7840\/revisions\/15517"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7840"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}