久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='Vp6r2'></small><noframes id='Vp6r2'>

      <bdo id='Vp6r2'></bdo><ul id='Vp6r2'></ul>
    <legend id='Vp6r2'><style id='Vp6r2'><dir id='Vp6r2'><q id='Vp6r2'></q></dir></style></legend>

    <tfoot id='Vp6r2'></tfoot>
  • <i id='Vp6r2'><tr id='Vp6r2'><dt id='Vp6r2'><q id='Vp6r2'><span id='Vp6r2'><b id='Vp6r2'><form id='Vp6r2'><ins id='Vp6r2'></ins><ul id='Vp6r2'></ul><sub id='Vp6r2'></sub></form><legend id='Vp6r2'></legend><bdo id='Vp6r2'><pre id='Vp6r2'><center id='Vp6r2'></center></pre></bdo></b><th id='Vp6r2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Vp6r2'><tfoot id='Vp6r2'></tfoot><dl id='Vp6r2'><fieldset id='Vp6r2'></fieldset></dl></div>

        “塊大小"multiprocessing.Pool.map 中的參數(shù)

        quot;chunksizequot; parameter in multiprocessing.Pool.map(“塊大小multiprocessing.Pool.map 中的參數(shù))
        1. <tfoot id='0ASOX'></tfoot>
          <i id='0ASOX'><tr id='0ASOX'><dt id='0ASOX'><q id='0ASOX'><span id='0ASOX'><b id='0ASOX'><form id='0ASOX'><ins id='0ASOX'></ins><ul id='0ASOX'></ul><sub id='0ASOX'></sub></form><legend id='0ASOX'></legend><bdo id='0ASOX'><pre id='0ASOX'><center id='0ASOX'></center></pre></bdo></b><th id='0ASOX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0ASOX'><tfoot id='0ASOX'></tfoot><dl id='0ASOX'><fieldset id='0ASOX'></fieldset></dl></div>
            <bdo id='0ASOX'></bdo><ul id='0ASOX'></ul>
              <tbody id='0ASOX'></tbody>

            <small id='0ASOX'></small><noframes id='0ASOX'>

          • <legend id='0ASOX'><style id='0ASOX'><dir id='0ASOX'><q id='0ASOX'></q></dir></style></legend>

                • 本文介紹了“塊大小"multiprocessing.Pool.map 中的參數(shù)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  例如,如果我有一個帶有 2 個處理器的池對象:

                  If I have a pool object with 2 processors for example:

                  p=multiprocessing.Pool(2)
                  

                  我想遍歷目錄中的文件列表并使用 map 函數(shù)

                  and I want to iterate over a list of files on directory and use the map function

                  誰能解釋一下這個函數(shù)的塊大小是多少:

                  could someone explain what is the chunksize of this function:

                  p.map(func, iterable[, chunksize])
                  

                  如果我將 chunksize 例如設(shè)置為 10,這是否意味著每 10 個文件都應(yīng)該使用一個處理器進行處理?

                  If I set the chunksize for example to 10 does that means every 10 files should be processed with one processor?

                  推薦答案

                  看Pool.map 的文檔 看來您幾乎是正確的: chunksize 參數(shù)將導(dǎo)致可迭代對象被拆分為大約該大小,并且每件作品都作為單獨的任務(wù)提交.

                  Looking at the documentation for Pool.map it seems you're almost correct: the chunksize parameter will cause the iterable to be split into pieces of approximately that size, and each piece is submitted as a separate task.

                  所以在您的示例中,是的,map 將采用前 10 個(大約),將其作為單個處理器的任務(wù)提交......然后接下來的 10 個將作為另一個任務(wù)提交,等等.請注意,這并不意味著這會使處理器每 10 個文件交替一次,很有可能處理器 #1 最終得到 1-10 和 11-20,而處理器 #2 得到 21-30 和 31-40.

                  So in your example, yes, map will take the first 10 (approximately), submit it as a task for a single processor... then the next 10 will be submitted as another task, and so on. Note that it doesn't mean that this will make the processors alternate every 10 files, it's quite possible that processor #1 ends up getting 1-10 AND 11-20, and processor #2 gets 21-30 and 31-40.

                  這篇關(guān)于“塊大小"multiprocessing.Pool.map 中的參數(shù)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  What exactly is Python multiprocessing Module#39;s .join() Method Doing?(Python 多處理模塊的 .join() 方法到底在做什么?)
                  Passing multiple parameters to pool.map() function in Python(在 Python 中將多個參數(shù)傳遞給 pool.map() 函數(shù))
                  multiprocessing.pool.MaybeEncodingError: #39;TypeError(quot;cannot serialize #39;_io.BufferedReader#39; objectquot;,)#39;(multiprocessing.pool.MaybeEncodingError: TypeError(cannot serialize _io.BufferedReader object,)) - IT屋-程序員軟件開
                  Python Multiprocess Pool. How to exit the script when one of the worker process determines no more work needs to be done?(Python 多進程池.當(dāng)其中一個工作進程確定不再需要完成工作時,如何退出腳本?) - IT屋-程序員
                  How do you pass a Queue reference to a function managed by pool.map_async()?(如何將隊列引用傳遞給 pool.map_async() 管理的函數(shù)?)
                  yet another confusion with multiprocessing error, #39;module#39; object has no attribute #39;f#39;(與多處理錯誤的另一個混淆,“模塊對象沒有屬性“f)

                        <tbody id='K5sBC'></tbody>
                      • <i id='K5sBC'><tr id='K5sBC'><dt id='K5sBC'><q id='K5sBC'><span id='K5sBC'><b id='K5sBC'><form id='K5sBC'><ins id='K5sBC'></ins><ul id='K5sBC'></ul><sub id='K5sBC'></sub></form><legend id='K5sBC'></legend><bdo id='K5sBC'><pre id='K5sBC'><center id='K5sBC'></center></pre></bdo></b><th id='K5sBC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='K5sBC'><tfoot id='K5sBC'></tfoot><dl id='K5sBC'><fieldset id='K5sBC'></fieldset></dl></div>
                        1. <tfoot id='K5sBC'></tfoot>

                          <small id='K5sBC'></small><noframes id='K5sBC'>

                        2. <legend id='K5sBC'><style id='K5sBC'><dir id='K5sBC'><q id='K5sBC'></q></dir></style></legend>
                            <bdo id='K5sBC'></bdo><ul id='K5sBC'></ul>

                            主站蜘蛛池模板: 精品国产亚洲一区二区三区大结局 | 国产 欧美 日韩 一区 | 国产精品二区三区 | 亚洲国产午夜 | 国产乱一区二区三区视频 | 欧产日产国产精品视频 | 91国语清晰打电话对白 | 国产一级影片 | 麻豆成人在线视频 | 久久久久久免费看 | 亚洲毛片 | 一区中文字幕 | 青春草国产 | 毛片黄片免费看 | 亚洲成人中文字幕 | 蜜月aⅴ国产精品 | 性色在线 | 成人h视频在线观看 | 一区二区视频在线观看 | 天天干天天爱天天操 | 久久精品久久久久久 | 毛片网站在线观看 | 欧美国产视频 | 中文字幕精品一区二区三区精品 | 欧美一区二区三区国产 | 久久久区| 成人性视频在线 | 99久久久久久久久 | 久久网站免费视频 | 精精国产xxxx视频在线播放7 | 久久777| 亚洲精品色 | 午夜av免费 | 美女啪啪国产 | 99热精品在线观看 | 国产免费观看一区 | 久久精品亚洲精品 | 99在线国产 | 精精国产xxxx视频在线野外 | 日本一区二区电影 | 日韩成人av在线 |