In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain to you in detail about pytorch's understanding of the parameter pin_memory when creating data.DataLoader. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Understanding of parameter pin_memory when pytorch creates data.DataLoader
Pin_memory is page-locked memory. When you create a DataLoader, setting pin_memory=True means that the generated Tensor data initially belongs to page-locked memory in memory, so it is faster to escape the Tensor of memory to the video memory of GPU. There are two ways of memory in the host, one is to lock the page, and the other is to unlock the page. The contents of the locked page memory will not be exchanged with the host's virtual memory under any circumstances (note: virtual memory is the hard disk). When there is insufficient host memory in the unlocked page, the data will be stored in virtual memory. And the video memory in the video card is all locked page memory! When the computer has enough memory, you can set pin_memory=True. Set pin_memory=False when the system is stuck or when swapping memory is used too much. Because pin_memory is related to computer hardware performance, pytorch developers cannot ensure that every alchemy player has a high-end device, so pin_ player defaults to False. This is the end of pytorch's understanding of the parameter pin_memory when creating data.DataLoader. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.