CoolFace
Datasetpublic

Anurag1734/cuda-error-resolution-analysis

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes7downloads
topics_batch_558.json59282 linesDownload Raw Back to raw
1[2  {3    "post_stream": {4      "posts": [5        {6          "id": 139554,7          "name": "Santosh Gupta",8          "username": "Santosh-Gupta",9          "avatar_template": "/user_avatar/discuss.pytorch.org/santosh-gupta/{size}/30716_2.png",10          "created_at": "2019-10-13T06:58:57.117Z",11          "cooked": "<p>I am working with multiple files, and multiple training samples in each file. I will use <code>ConcatDataset</code> as described here:</p>\n<aside class=\"quote\" data-post=\"7\" data-topic=\"11769\">\n  <div class=\"title\">\n    <div class=\"quote-controls\"></div>\n    <img loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/aeb1de/48.png\" class=\"avatar\">\n    <a href=\"https://discuss.pytorch.org/t/dataloaders-multiple-files-and-multiple-rows-per-column-with-lazy-evaluation/11769/7\">DataLoaders - Multiple files, and multiple rows per column with lazy evaluation</a> \n  </div>\n  <blockquote>\n    I created one dataset for each file, and if there’s only 3000 files then it isn’t that much to hold it inside an array (object that has a reference to). \nIf you wrote your DataSet with linecache, then it won’t read each file into memory. \nAt least this is my observation after reading more files than my computer’s memory can support.\n  </blockquote>\n</aside>\n\n<p>I need to have negative samples in addition to my true samples, and I need my negative samples to be randomly selected from all the training data files. So, I am wondering, would the returned batch samples just be a random consecutive chuck from a random single file, or would be batch span across multiple random indexes across all the datafiles?</p>\n<p>If there are more details needed about what I am trying to do exactly, it’s because I am trying to train over a TPU with Pytorch XLA.</p>\n<p>Normally for negative samples, I would just use a 2nd <code>DataSet</code> and <code>DataLoader</code>, however, I am trying to train over TPUs with Pytorch XLA (alpha was just released a few days ago <a href=\"https://github.com/pytorch/xla\" class=\"inline-onebox\" rel=\"noopener nofollow ugc\">GitHub - pytorch/xla: Enabling PyTorch on XLA Devices (e.g. Google TPU)</a> ), and to do that I need to send my <code>DataLoader</code> to a <code>torch_xla.distributed.data_parallel.DataParallel</code> object, like <code>model_parallel(train_loop_fn, train_loader)</code> which can be seen in these example notebooks</p>\n<p><a href=\"https://github.com/pytorch/xla/blob/master/contrib/colab/resnet18-training-xrt-1-15.ipynb\" class=\"onebox\" target=\"_blank\" rel=\"noopener nofollow ugc\">https://github.com/pytorch/xla/blob/master/contrib/colab/resnet18-training-xrt-1-15.ipynb</a></p>\n<p><a href=\"https://github.com/pytorch/xla/blob/master/contrib/colab/mnist-training-xrt-1-15.ipynb\" class=\"onebox\" target=\"_blank\" rel=\"noopener nofollow ugc\">https://github.com/pytorch/xla/blob/master/contrib/colab/mnist-training-xrt-1-15.ipynb</a></p>\n<p>So, I am now limited to a single <code>DataLoader</code>, which will need to handle both the true samples, and negative samples that need to be randomly selected from all my files.</p>",12          "post_number": 1,13          "post_type": 1,14          "posts_count": 1,15          "updated_at": "2019-10-13T07:01:45.969Z",16          "reply_count": 0,17          "reply_to_post_number": null,18          "quote_count": 0,19          "incoming_link_count": 48,20          "reads": 11,21          "readers_count": 10,22          "score": 242.2,23          "yours": false,24          "topic_id": 58081,25          "topic_slug": "does-a-dataloader-created-from-concatdataset-create-a-batch-from-a-different-files-or-a-single-file",26          "display_username": "Santosh Gupta",27          "primary_group_name": null,28          "flair_name": null,29          "flair_url": null,30          "flair_bg_color": null,31          "flair_color": null,32          "flair_group_id": null,33          "badges_granted": [],34          "version": 1,35          "can_edit": false,36          "can_delete": false,37          "can_recover": false,38          "can_see_hidden_post": false,39          "can_wiki": false,40          "link_counts": [41            {42              "url": "https://github.com/pytorch/xla",43              "internal": false,44              "reflection": false,45              "title": "GitHub - pytorch/xla: Enabling PyTorch on Google TPU",46              "clicks": 247            },48            {49              "url": "https://github.com/pytorch/xla/blob/master/contrib/colab/mnist-training-xrt-1-15.ipynb",50              "internal": false,51              "reflection": false,52              "title": "xla/mnist-training-xrt-1-15.ipynb at master · pytorch/xla · GitHub",53              "clicks": 154            },55            {56              "url": "https://github.com/pytorch/xla/blob/master/contrib/colab/resnet18-training-xrt-1-15.ipynb",57              "internal": false,58              "reflection": false,59              "title": "xla/resnet18-training-xrt-1-15.ipynb at master · pytorch/xla · GitHub",60              "clicks": 161            },62            {63              "url": "https://discuss.pytorch.org/t/dataloaders-multiple-files-and-multiple-rows-per-column-with-lazy-evaluation/11769/7",64              "internal": true,65              "reflection": false,66              "title": "DataLoaders - Multiple files, and multiple rows per column with lazy evaluation",67              "clicks": 068            }69          ],70          "read": true,71          "user_title": null,72          "bookmarked": false,73          "actions_summary": [],74          "moderator": false,75          "admin": false,76          "staff": false,77          "user_id": 21256,78          "hidden": false,79          "trust_level": 2,80          "deleted_at": null,81          "user_deleted": false,82          "edit_reason": null,83          "can_view_edit_history": true,84          "wiki": false,85          "post_url": "/t/does-a-dataloader-created-from-concatdataset-create-a-batch-from-a-different-files-or-a-single-file/58081/1",86          "can_accept_answer": false,87          "can_unaccept_answer": false,88          "accepted_answer": false,89          "topic_accepted_answer": null,90          "can_vote": false91        }92      ],93      "stream": [94        13955495      ]96    },97    "timeline_lookup": [98      [99        1,100        2205101      ]102    ],103    "suggested_topics": [104      {105        "fancy_title": "Alternatives to parallel processing of ensemble of the same architecture?",106        "id": 212634,107        "title": "Alternatives to parallel processing of ensemble of the same architecture?",108        "slug": "alternatives-to-parallel-processing-of-ensemble-of-the-same-architecture",109        "posts_count": 4,110        "reply_count": 1,111        "highest_post_number": 4,112        "image_url": null,113        "created_at": "2024-11-06T22:12:39.021Z",114        "last_posted_at": "2024-11-12T06:16:53.789Z",115        "bumped": true,116        "bumped_at": "2024-11-12T06:16:53.789Z",117        "archetype": "regular",118        "unseen": false,119        "pinned": false,120        "unpinned": null,121        "visible": true,122        "closed": false,123        "archived": false,124        "bookmarked": null,125        "liked": null,126        "tags_descriptions": {},127        "like_count": 2,128        "views": 36,129        "category_id": 1,130        "featured_link": null,131        "has_accepted_answer": false,132        "posters": [133          {134            "extras": "latest",135            "description": "Original Poster, Most Recent Poster",136            "user": {137              "id": 80628,138              "username": "fabrizio_chavez",139              "name": "fabrizio chavez",140              "avatar_template": "/user_avatar/discuss.pytorch.org/fabrizio_chavez/{size}/72477_2.png",141              "trust_level": 1142            }143          },144          {145            "extras": null,146            "description": "Frequent Poster",147            "user": {148              "id": 80724,149              "username": "paulge",150              "name": "",151              "avatar_template": "/letter_avatar_proxy/v4/letter/p/82dd89/{size}.png",152              "trust_level": 2153            }154          }155        ]156      },157      {158        "fancy_title": "What&rsquo;s the theoreticl basis of torch.testing tolerance table?",159        "id": 213255,160        "title": "What's the theoreticl basis of torch.testing tolerance table?",161        "slug": "whats-the-theoreticl-basis-of-torch-testing-tolerance-table",162        "posts_count": 1,163        "reply_count": 0,164        "highest_post_number": 1,165        "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/7/0/704c9ddf26dc72ffe8f69312a123846fdab78ded_2_1024x736.png",166        "created_at": "2024-11-21T07:42:12.294Z",167        "last_posted_at": "2024-11-21T07:42:12.347Z",168        "bumped": true,169        "bumped_at": "2024-11-21T07:42:12.347Z",170        "archetype": "regular",171        "unseen": false,172        "pinned": false,173        "unpinned": null,174        "visible": true,175        "closed": false,176        "archived": false,177        "bookmarked": null,178        "liked": null,179        "tags_descriptions": {},180        "like_count": 0,181        "views": 25,182        "category_id": 1,183        "featured_link": null,184        "has_accepted_answer": false,185        "posters": [186          {187            "extras": "latest single",188            "description": "Original Poster, Most Recent Poster",189            "user": {190              "id": 81043,191              "username": "Jiexin-Zheng",192              "name": "Jiexin Zheng",193              "avatar_template": "/user_avatar/discuss.pytorch.org/jiexin-zheng/{size}/74108_2.png",194              "trust_level": 0195            }196          }197        ]198      },199      {200        "fancy_title": "Can you do bf16 x bf16 -&gt; FP32 matmul?",201        "id": 216379,202        "title": "Can you do bf16 x bf16 -> FP32 matmul?",203        "slug": "can-you-do-bf16-x-bf16-fp32-matmul",204        "posts_count": 2,205        "reply_count": 0,206        "highest_post_number": 2,207        "image_url": null,208        "created_at": "2025-02-07T20:02:38.382Z",209        "last_posted_at": "2025-02-07T22:03:35.903Z",210        "bumped": true,211        "bumped_at": "2025-02-07T22:03:35.903Z",212        "archetype": "regular",213        "unseen": false,214        "pinned": false,215        "unpinned": null,216        "visible": true,217        "closed": false,218        "archived": false,219        "bookmarked": null,220        "liked": null,221        "tags_descriptions": {},222        "like_count": 1,223        "views": 106,224        "category_id": 1,225        "featured_link": null,226        "has_accepted_answer": false,227        "posters": [228          {229            "extras": null,230            "description": "Original Poster",231            "user": {232              "id": 80233,233              "username": "henrylhtsang",234              "name": "Henry Tsang",235              "avatar_template": "/user_avatar/discuss.pytorch.org/henrylhtsang/{size}/73345_2.png",236              "trust_level": 1237            }238          },239          {240            "extras": "latest",241            "description": "Most Recent Poster",242            "user": {243              "id": 35151,244              "username": "malfet",245              "name": "Nikita Shulga",246              "avatar_template": "/user_avatar/discuss.pytorch.org/malfet/{size}/27485_2.png",247              "trust_level": 2248            }249          }250        ]251      },252      {253        "fancy_title": "CrossEntropyLoss doesn&rsquo;t move the weight to same device",254        "id": 216873,255        "title": "CrossEntropyLoss doesn't move the weight to same device",256        "slug": "crossentropyloss-doesnt-move-the-weight-to-same-device",257        "posts_count": 2,258        "reply_count": 0,259        "highest_post_number": 2,260        "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/10ccb444e94588fc96239b1083cce2b48800bc90_2_1024x131.png",261        "created_at": "2025-02-19T07:56:45.910Z",262        "last_posted_at": "2025-02-19T15:11:46.352Z",263        "bumped": true,264        "bumped_at": "2025-02-19T15:11:46.352Z",265        "archetype": "regular",266        "unseen": false,267        "pinned": false,268        "unpinned": null,269        "visible": true,270        "closed": false,271        "archived": false,272        "bookmarked": null,273        "liked": null,274        "tags_descriptions": {},275        "like_count": 0,276        "views": 50,277        "category_id": 1,278        "featured_link": null,279        "has_accepted_answer": true,280        "posters": [281          {282            "extras": null,283            "description": "Original Poster",284            "user": {285              "id": 32866,286              "username": "glenguo06",287              "name": "Glen",288              "avatar_template": "/user_avatar/discuss.pytorch.org/glenguo06/{size}/25474_2.png",289              "trust_level": 1290            }291          },292          {293            "extras": "latest",294            "description": "Most Recent Poster, Accepted Answer",295            "user": {296              "id": 18088,297              "username": "KFrank",298              "name": "K. Frank",299              "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",300              "trust_level": 2301            }302          }303        ]304      },305      {306        "fancy_title": "RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x92160 and 9216x120)",307        "id": 212186,308        "title": "RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x92160 and 9216x120)",309        "slug": "runtimeerror-mat1-and-mat2-shapes-cannot-be-multiplied-1x92160-and-9216x120",310        "posts_count": 9,311        "reply_count": 7,312        "highest_post_number": 9,313        "image_url": null,314        "created_at": "2024-10-28T03:24:27.630Z",315        "last_posted_at": "2024-10-28T08:36:54.814Z",316        "bumped": true,317        "bumped_at": "2024-10-28T08:36:54.814Z",318        "archetype": "regular",319        "unseen": false,320        "pinned": false,321        "unpinned": null,322        "visible": true,323        "closed": false,324        "archived": false,325        "bookmarked": null,326        "liked": null,327        "tags_descriptions": {},328        "like_count": 0,329        "views": 109,330        "category_id": 1,331        "featured_link": null,332        "has_accepted_answer": false,333        "posters": [334          {335            "extras": "latest",336            "description": "Original Poster, Most Recent Poster",337            "user": {338              "id": 80524,339              "username": "nassimus",340              "name": "nassim moualek",341              "avatar_template": "/user_avatar/discuss.pytorch.org/nassimus/{size}/73605_2.png",342              "trust_level": 1343            }344          },345          {346            "extras": null,347            "description": "Frequent Poster",348            "user": {349              "id": 12117,350              "username": "Tony-Y",351              "name": "",352              "avatar_template": "/user_avatar/discuss.pytorch.org/tony-y/{size}/8373_2.png",353              "trust_level": 2354            }355          }356        ]357      }358    ],359    "tags_descriptions": {},360    "fancy_title": "Does a `DataLoader` created from `ConcatDataset` create a batch from a different files, or a single file?",361    "id": 58081,362    "title": "Does a `DataLoader` created from `ConcatDataset` create a batch from a different files, or a single file?",363    "posts_count": 1,364    "created_at": "2019-10-13T06:58:57.044Z",365    "views": 680,366    "reply_count": 0,367    "like_count": 0,368    "last_posted_at": "2019-10-13T06:58:57.117Z",369    "visible": true,370    "closed": false,371    "archived": false,372    "has_summary": false,373    "archetype": "regular",374    "slug": "does-a-dataloader-created-from-concatdataset-create-a-batch-from-a-different-files-or-a-single-file",375    "category_id": 1,376    "word_count": 254,377    "deleted_at": null,378    "user_id": 21256,379    "featured_link": null,380    "pinned_globally": false,381    "pinned_at": null,382    "pinned_until": null,383    "image_url": null,384    "slow_mode_seconds": 0,385    "draft": null,386    "draft_key": "topic_58081",387    "draft_sequence": null,388    "unpinned": null,389    "pinned": false,390    "current_post_number": 1,391    "highest_post_number": 1,392    "deleted_by": null,393    "actions_summary": [394      {395        "id": 4,396        "count": 0,397        "hidden": false,398        "can_act": false399      },400      {401        "id": 8,402        "count": 0,403        "hidden": false,404        "can_act": false405      },406      {407        "id": 10,408        "count": 0,409        "hidden": false,410        "can_act": false411      },412      {413        "id": 7,414        "count": 0,415        "hidden": false,416        "can_act": false417      }418    ],419    "chunk_size": 20,420    "bookmarked": false,421    "topic_timer": null,422    "message_bus_last_id": 0,423    "participant_count": 1,424    "show_read_indicator": false,425    "thumbnails": null,426    "slow_mode_enabled_until": null,427    "can_vote": false,428    "vote_count": 0,429    "user_voted": false,430    "discourse_zendesk_plugin_zendesk_id": null,431    "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",432    "details": {433      "can_edit": false,434      "notification_level": 1,435      "participants": [436        {437          "id": 21256,438          "username": "Santosh-Gupta",439          "name": "Santosh Gupta",440          "avatar_template": "/user_avatar/discuss.pytorch.org/santosh-gupta/{size}/30716_2.png",441          "post_count": 1,442          "primary_group_name": null,443          "flair_name": null,444          "flair_url": null,445          "flair_color": null,446          "flair_bg_color": null,447          "flair_group_id": null,448          "trust_level": 2449        }450      ],451      "created_by": {452        "id": 21256,453        "username": "Santosh-Gupta",454        "name": "Santosh Gupta",455        "avatar_template": "/user_avatar/discuss.pytorch.org/santosh-gupta/{size}/30716_2.png"456      },457      "last_poster": {458        "id": 21256,459        "username": "Santosh-Gupta",460        "name": "Santosh Gupta",461        "avatar_template": "/user_avatar/discuss.pytorch.org/santosh-gupta/{size}/30716_2.png"462      },463      "links": [464        {465          "url": "https://github.com/pytorch/xla",466          "title": "GitHub - pytorch/xla: Enabling PyTorch on Google TPU",467          "internal": false,468          "attachment": false,469          "reflection": false,470          "clicks": 2,471          "user_id": 21256,472          "domain": "github.com",473          "root_domain": "github.com"474        },475        {476          "url": "https://github.com/pytorch/xla/blob/master/contrib/colab/mnist-training-xrt-1-15.ipynb",477          "title": "xla/mnist-training-xrt-1-15.ipynb at master · pytorch/xla · GitHub",478          "internal": false,479          "attachment": false,480          "reflection": false,481          "clicks": 1,482          "user_id": 21256,483          "domain": "github.com",484          "root_domain": "github.com"485        },486        {487          "url": "https://github.com/pytorch/xla/blob/master/contrib/colab/resnet18-training-xrt-1-15.ipynb",488          "title": "xla/resnet18-training-xrt-1-15.ipynb at master · pytorch/xla · GitHub",489          "internal": false,490          "attachment": false,491          "reflection": false,492          "clicks": 1,493          "user_id": 21256,494          "domain": "github.com",495          "root_domain": "github.com"496        }497      ]498    },499    "bookmarks": []500  },501  {502    "post_stream": {503      "posts": [504        {505          "id": 139178,506          "name": "izuna385",507          "username": "izuna385",508          "avatar_template": "/letter_avatar_proxy/v4/letter/i/3ab097/{size}.png",509          "created_at": "2019-10-11T01:47:54.426Z",510          "cooked": "<p>Currently I has  index of <code>batch_size * candidate_size</code> and desired_candidate : <code>batch_size * top_5</code></p>\n<p>like, if <code>batch_size</code> == 16 and candidate_size == 15</p>\n<pre><code class=\"lang-auto\">&gt;&gt; index.size()\ntorch.Size([64, 15])\n\n&gt;&gt; desired_candidate.size()\ntorch.Size([64, 5])\n\n&gt;&gt; index[0]\ntensor([104, 171, 182,   3,  56, 178,   6,   6,   4,  21,  30, 182,  27,  39,  56], device='cuda:0', dtype=torch.int32)\n\n&gt;&gt; desired_candidate[0]\ntensor([171,   4, 182, 102,  61], device='cuda:0')\n</code></pre>\n<p>I’d like to filter index by its desired_candidate, so the desired one is</p>\n<pre><code class=\"lang-auto\">&gt;&gt; index_[0]\ntensor([104, -1, -1,   3,  56, 178,   6,   6,   -1,  21,  30, -1,  27,  39,  56], device='cuda:0', dtype=torch.int32)\n</code></pre>\n<p>for each batch. But I can’t find out how to do this.<br>\nIf someone would know how to implement this, I’d appreciate it.<br>\nThanks.</p>",511          "post_number": 1,512          "post_type": 1,513          "posts_count": 3,514          "updated_at": "2019-10-11T06:57:08.042Z",515          "reply_count": 0,516          "reply_to_post_number": null,517          "quote_count": 0,518          "incoming_link_count": 1647,519          "reads": 71,520          "readers_count": 70,521          "score": 8249.2,522          "yours": false,523          "topic_id": 57917,524          "topic_slug": "how-to-mask-for-each-batch",525          "display_username": "izuna385",526          "primary_group_name": null,527          "flair_name": null,528          "flair_url": null,529          "flair_bg_color": null,530          "flair_color": null,531          "flair_group_id": null,532          "badges_granted": [],533          "version": 2,534          "can_edit": false,535          "can_delete": false,536          "can_recover": false,537          "can_see_hidden_post": false,538          "can_wiki": false,539          "read": true,540          "user_title": null,541          "bookmarked": false,542          "actions_summary": [],543          "moderator": false,544          "admin": false,545          "staff": false,546          "user_id": 21314,547          "hidden": false,548          "trust_level": 1,549          "deleted_at": null,550          "user_deleted": false,551          "edit_reason": null,552          "can_view_edit_history": true,553          "wiki": false,554          "post_url": "/t/how-to-mask-for-each-batch/57917/1",555          "can_accept_answer": false,556          "can_unaccept_answer": false,557          "accepted_answer": false,558          "topic_accepted_answer": true,559          "can_vote": false560        },561        {562          "id": 139480,563          "name": "Alban D",564          "username": "albanD",565          "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",566          "created_at": "2019-10-12T22:29:49.032Z",567          "cooked": "<p>Hi,</p>\n<p>It might depend a bit on the memory limitations you have. But the following should work (the sizes are very small for printing purposes):</p>\n<pre><code class=\"lang-auto\">import torch\n\nb = 2\nc = 3\n\nindex = torch.rand(b, c).mul(5).long()\ndesired_candidate = torch.rand(b, 5).mul(5).long()\n\nprint(index)\nprint(desired_candidate)\n\n\nexpanded_size = (b, c, 5)\nexpanded_index = index.unsqueeze(2).expand(expanded_size)\nexpanded_desired_candidate = desired_candidate.unsqueeze(1).expand(expanded_size)\n\nmask = expanded_index.eq(expanded_desired_candidate).any(-1)\n\nindex[mask] = -1\nprint(index)\n</code></pre>\n<p>Let me know if it fits your needs !</p>",568          "post_number": 2,569          "post_type": 1,570          "posts_count": 3,571          "updated_at": "2019-10-13T06:47:38.189Z",572          "reply_count": 0,573          "reply_to_post_number": null,574          "quote_count": 0,575          "incoming_link_count": 18,576          "reads": 60,577          "readers_count": 59,578          "score": 117.0,579          "yours": false,580          "topic_id": 57917,581          "topic_slug": "how-to-mask-for-each-batch",582          "display_username": "Alban D",583          "primary_group_name": null,584          "flair_name": null,585          "flair_url": null,586          "flair_bg_color": null,587          "flair_color": null,588          "flair_group_id": null,589          "badges_granted": [],590          "version": 1,591          "can_edit": false,592          "can_delete": false,593          "can_recover": false,594          "can_see_hidden_post": false,595          "can_wiki": false,596          "read": true,597          "user_title": "",598          "bookmarked": false,599          "actions_summary": [600            {601              "id": 2,602              "count": 1603            }604          ],605          "moderator": true,606          "admin": true,607          "staff": true,608          "user_id": 211,609          "hidden": false,610          "trust_level": 4,611          "deleted_at": null,612          "user_deleted": false,613          "edit_reason": null,614          "can_view_edit_history": true,615          "wiki": false,616          "post_url": "/t/how-to-mask-for-each-batch/57917/2",617          "can_accept_answer": false,618          "can_unaccept_answer": false,619          "accepted_answer": true,620          "topic_accepted_answer": true621        },622        {623          "id": 139551,624          "name": "izuna385",625          "username": "izuna385",626          "avatar_template": "/letter_avatar_proxy/v4/letter/i/3ab097/{size}.png",627          "created_at": "2019-10-13T06:47:34.486Z",628          "cooked": "<p>Thanks for great advice! I’ll try it.</p>",629          "post_number": 3,630          "post_type": 1,631          "posts_count": 3,632          "updated_at": "2019-10-13T06:47:34.486Z",633          "reply_count": 0,634          "reply_to_post_number": null,635          "quote_count": 0,636          "incoming_link_count": 4,637          "reads": 58,638          "readers_count": 57,639          "score": 31.6,640          "yours": false,641          "topic_id": 57917,642          "topic_slug": "how-to-mask-for-each-batch",643          "display_username": "izuna385",644          "primary_group_name": null,645          "flair_name": null,646          "flair_url": null,647          "flair_bg_color": null,648          "flair_color": null,649          "flair_group_id": null,650          "badges_granted": [],651          "version": 1,652          "can_edit": false,653          "can_delete": false,654          "can_recover": false,655          "can_see_hidden_post": false,656          "can_wiki": false,657          "read": true,658          "user_title": null,659          "bookmarked": false,660          "actions_summary": [],661          "moderator": false,662          "admin": false,663          "staff": false,664          "user_id": 21314,665          "hidden": false,666          "trust_level": 1,667          "deleted_at": null,668          "user_deleted": false,669          "edit_reason": null,670          "can_view_edit_history": true,671          "wiki": false,672          "post_url": "/t/how-to-mask-for-each-batch/57917/3",673          "can_accept_answer": false,674          "can_unaccept_answer": false,675          "accepted_answer": false,676          "topic_accepted_answer": true677        }678      ],679      "stream": [680        139178,681        139480,682        139551683      ]684    },685    "timeline_lookup": [686      [687        1,688        2207689      ],690      [691        2,692        2205693      ]694    ],695    "suggested_topics": [696      {697        "fancy_title": "CUDA not available",698        "id": 215422,699        "title": "CUDA not available",700        "slug": "cuda-not-available",701        "posts_count": 8,702        "reply_count": 6,703        "highest_post_number": 8,704        "image_url": null,705        "created_at": "2025-01-15T13:11:20.130Z",706        "last_posted_at": "2025-01-16T16:46:47.831Z",707        "bumped": true,708        "bumped_at": "2025-01-16T16:46:47.831Z",709        "archetype": "regular",710        "unseen": false,711        "pinned": false,712        "unpinned": null,713        "visible": true,714        "closed": false,715        "archived": false,716        "bookmarked": null,717        "liked": null,718        "tags_descriptions": {},719        "like_count": 0,720        "views": 1418,721        "category_id": 1,722        "featured_link": null,723        "has_accepted_answer": true,724        "posters": [725          {726            "extras": null,727            "description": "Original Poster",728            "user": {729              "id": 46535,730              "username": "MoRoBe",731              "name": "",732              "avatar_template": "/user_avatar/discuss.pytorch.org/morobe/{size}/39577_2.png",733              "trust_level": 1734            }735          },736          {737            "extras": "latest",738            "description": "Most Recent Poster, Accepted Answer",739            "user": {740              "id": 18088,741              "username": "KFrank",742              "name": "K. Frank",743              "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",744              "trust_level": 2745            }746          },747          {748            "extras": null,749            "description": "Frequent Poster",750            "user": {751              "id": 3534,752              "username": "ptrblck",753              "name": "",754              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",755              "admin": true,756              "moderator": true,757              "trust_level": 2758            }759          }760        ]761      },762      {763        "fancy_title": "How to use torch without nvidia dependencies",764        "id": 216296,765        "title": "How to use torch without nvidia dependencies",766        "slug": "how-to-use-torch-without-nvidia-dependencies",767        "posts_count": 7,768        "reply_count": 4,769        "highest_post_number": 7,770        "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/0/d/0d7f52c069d82f965911f5b45070e7e0716e0d34.png",771        "created_at": "2025-02-06T03:03:59.414Z",772        "last_posted_at": "2025-02-06T08:13:26.997Z",773        "bumped": true,774        "bumped_at": "2025-02-06T08:13:26.997Z",775        "archetype": "regular",776        "unseen": false,777        "pinned": false,778        "unpinned": null,779        "visible": true,780        "closed": false,781        "archived": false,782        "bookmarked": null,783        "liked": null,784        "tags_descriptions": {},785        "like_count": 0,786        "views": 432,787        "category_id": 1,788        "featured_link": null,789        "has_accepted_answer": false,790        "posters": [791          {792            "extras": "latest",793            "description": "Original Poster, Most Recent Poster",794            "user": {795              "id": 82516,796              "username": "Wayne20-ops",797              "name": "Wayne20 Ops",798              "avatar_template": "/user_avatar/discuss.pytorch.org/wayne20-ops/{size}/75495_2.png",799              "trust_level": 0800            }801          },802          {803            "extras": null,804            "description": "Frequent Poster",805            "user": {806              "id": 19553,807              "username": "anantguptadbl",808              "name": "Anant Gupta",809              "avatar_template": "/user_avatar/discuss.pytorch.org/anantguptadbl/{size}/17784_2.png",810              "trust_level": 2811            }812          }813        ]814      },815      {816        "fancy_title": "Significant time difference to transfer tensor from gpu to cpu between 2 models",817        "id": 217539,818        "title": "Significant time difference to transfer tensor from gpu to cpu between 2 models",819        "slug": "significant-time-difference-to-transfer-tensor-from-gpu-to-cpu-between-2-models",820        "posts_count": 2,821        "reply_count": 0,822        "highest_post_number": 2,823        "image_url": null,824        "created_at": "2025-03-06T22:25:46.006Z",825        "last_posted_at": "2025-03-06T22:36:16.094Z",826        "bumped": true,827        "bumped_at": "2025-03-06T22:36:16.094Z",828        "archetype": "regular",829        "unseen": false,830        "pinned": false,831        "unpinned": null,832        "visible": true,833        "closed": false,834        "archived": false,835        "bookmarked": null,836        "liked": null,837        "tags_descriptions": {},838        "like_count": 0,839        "views": 71,840        "category_id": 1,841        "featured_link": null,842        "has_accepted_answer": false,843        "posters": [844          {845            "extras": null,846            "description": "Original Poster",847            "user": {848              "id": 83115,849              "username": "aleoris",850              "name": "",851              "avatar_template": "/letter_avatar_proxy/v4/letter/a/3ab097/{size}.png",852              "trust_level": 0853            }854          },855          {856            "extras": "latest",857            "description": "Most Recent Poster",858            "user": {859              "id": 3534,860              "username": "ptrblck",861              "name": "",862              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",863              "admin": true,864              "moderator": true,865              "trust_level": 2866            }867          }868        ]869      },870      {871        "fancy_title": "Unexpected CUDA IPC handle behaviour",872        "id": 218867,873        "title": "Unexpected CUDA IPC handle behaviour",874        "slug": "unexpected-cuda-ipc-handle-behaviour",875        "posts_count": 2,876        "reply_count": 0,877        "highest_post_number": 2,878        "image_url": null,879        "created_at": "2025-04-08T12:41:57.732Z",880        "last_posted_at": "2025-04-09T14:31:15.553Z",881        "bumped": true,882        "bumped_at": "2025-04-09T14:31:15.553Z",883        "archetype": "regular",884        "unseen": false,885        "pinned": false,886        "unpinned": null,887        "visible": true,888        "closed": false,889        "archived": false,890        "bookmarked": null,891        "liked": null,892        "tags_descriptions": {},893        "like_count": 0,894        "views": 180,895        "category_id": 1,896        "featured_link": null,897        "has_accepted_answer": true,898        "posters": [899          {900            "extras": "latest single",901            "description": "Original Poster, Most Recent Poster, Accepted Answer",902            "user": {903              "id": 83703,904              "username": "Gino",905              "name": "",906              "avatar_template": "/user_avatar/discuss.pytorch.org/gino/{size}/74902_2.png",907              "trust_level": 0908            }909          }910        ]911      },912      {913        "fancy_title": "Slurm: Torch not compiled with CUDA enabled",914        "id": 212928,915        "title": "Slurm: Torch not compiled with CUDA enabled",916        "slug": "slurm-torch-not-compiled-with-cuda-enabled",917        "posts_count": 5,918        "reply_count": 6,919        "highest_post_number": 8,920        "image_url": null,921        "created_at": "2024-11-13T13:04:57.351Z",922        "last_posted_at": "2024-11-14T02:51:32.282Z",923        "bumped": true,924        "bumped_at": "2024-11-14T02:51:32.282Z",925        "archetype": "regular",926        "unseen": false,927        "pinned": false,928        "unpinned": null,929        "visible": true,930        "closed": false,931        "archived": false,932        "bookmarked": null,933        "liked": null,934        "tags_descriptions": {},935        "like_count": 0,936        "views": 1298,937        "category_id": 1,938        "featured_link": null,939        "has_accepted_answer": false,940        "posters": [941          {942            "extras": "latest",943            "description": "Original Poster, Most Recent Poster",944            "user": {945              "id": 80887,946              "username": "WuJiayang",947              "name": "",948              "avatar_template": "/letter_avatar_proxy/v4/letter/w/d6d6ee/{size}.png",949              "trust_level": 0950            }951          },952          {953            "extras": null,954            "description": "Frequent Poster",955            "user": {956              "id": 3534,957              "username": "ptrblck",958              "name": "",959              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",960              "admin": true,961              "moderator": true,962              "trust_level": 2963            }964          }965        ]966      }967    ],968    "tags_descriptions": {},969    "fancy_title": "How to mask for each batch?",970    "id": 57917,971    "title": "How to mask for each batch?",972    "posts_count": 3,973    "created_at": "2019-10-11T01:47:54.375Z",974    "views": 2598,975    "reply_count": 0,976    "like_count": 1,977    "last_posted_at": "2019-10-13T06:47:34.486Z",978    "visible": true,979    "closed": false,980    "archived": false,981    "has_summary": false,982    "archetype": "regular",983    "slug": "how-to-mask-for-each-batch",984    "category_id": 1,985    "word_count": 223,986    "deleted_at": null,987    "user_id": 21314,988    "featured_link": null,989    "pinned_globally": false,990    "pinned_at": null,991    "pinned_until": null,992    "image_url": null,993    "slow_mode_seconds": 0,994    "draft": null,995    "draft_key": "topic_57917",996    "draft_sequence": null,997    "unpinned": null,998    "pinned": false,999    "current_post_number": 1,1000    "highest_post_number": 3,1001    "deleted_by": null,1002    "actions_summary": [1003      {1004        "id": 4,1005        "count": 0,1006        "hidden": false,1007        "can_act": false1008      },1009      {1010        "id": 8,1011        "count": 0,1012        "hidden": false,1013        "can_act": false1014      },1015      {1016        "id": 10,1017        "count": 0,1018        "hidden": false,1019        "can_act": false1020      },1021      {1022        "id": 7,1023        "count": 0,1024        "hidden": false,1025        "can_act": false1026      }1027    ],1028    "chunk_size": 20,1029    "bookmarked": false,1030    "topic_timer": null,1031    "message_bus_last_id": 0,1032    "participant_count": 2,1033    "show_read_indicator": false,1034    "thumbnails": null,1035    "slow_mode_enabled_until": null,1036    "accepted_answer": {1037      "post_number": 2,1038      "username": "albanD",1039      "name": "Alban D",1040      "excerpt": "Hi, \nIt might depend a bit on the memory limitations you have. But the following should work (the sizes are very small for printing purposes): \nimport torch\n\nb = 2\nc = 3\n\nindex = torch.rand(b, c).mul(5).long()\ndesired_candidate = torch.rand(b, 5).mul(5).long()\n\nprint(index)\nprint(desired_candidate)\n&hellip;"1041    },1042    "can_vote": false,1043    "vote_count": 0,1044    "user_voted": false,1045    "discourse_zendesk_plugin_zendesk_id": null,1046    "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1047    "details": {1048      "can_edit": false,1049      "notification_level": 1,1050      "participants": [1051        {1052          "id": 21314,1053          "username": "izuna385",1054          "name": "izuna385",1055          "avatar_template": "/letter_avatar_proxy/v4/letter/i/3ab097/{size}.png",1056          "post_count": 2,1057          "primary_group_name": null,1058          "flair_name": null,1059          "flair_url": null,1060          "flair_color": null,1061          "flair_bg_color": null,1062          "flair_group_id": null,1063          "trust_level": 11064        },1065        {1066          "id": 211,1067          "username": "albanD",1068          "name": "Alban D",1069          "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",1070          "post_count": 1,1071          "primary_group_name": null,1072          "flair_name": null,1073          "flair_url": null,1074          "flair_color": null,1075          "flair_bg_color": null,1076          "flair_group_id": null,1077          "admin": true,1078          "moderator": true,1079          "trust_level": 41080        }1081      ],1082      "created_by": {1083        "id": 21314,1084        "username": "izuna385",1085        "name": "izuna385",1086        "avatar_template": "/letter_avatar_proxy/v4/letter/i/3ab097/{size}.png"1087      },1088      "last_poster": {1089        "id": 21314,1090        "username": "izuna385",1091        "name": "izuna385",1092        "avatar_template": "/letter_avatar_proxy/v4/letter/i/3ab097/{size}.png"1093      }1094    },1095    "bookmarks": []1096  },1097  {1098    "post_stream": {1099      "posts": [1100        {1101          "id": 139303,1102          "name": "Er Hall",1103          "username": "Er_Hall",1104          "avatar_template": "/user_avatar/discuss.pytorch.org/er_hall/{size}/16234_2.png",1105          "created_at": "2019-10-11T17:21:09.078Z",1106          "cooked": "<p>Hi all,</p>\n<p>I have a question I have a multiclass classification problem where each sample belongs only to one class, my targets are in [0, C-1] format.</p>\n<p>My question is: as input the cross entropy loss must take logits? so as a last layer I need to have a sigmoid layer?</p>",1107          "post_number": 1,1108          "post_type": 1,1109          "posts_count": 3,1110          "updated_at": "2019-10-11T17:21:09.078Z",1111          "reply_count": 0,1112          "reply_to_post_number": null,1113          "quote_count": 0,1114          "incoming_link_count": 51,1115          "reads": 25,1116          "readers_count": 24,1117          "score": 260.0,1118          "yours": false,1119          "topic_id": 57976,1120          "topic_slug": "cross-entropy-loss-for-multiclass-classification",1121          "display_username": "Er Hall",1122          "primary_group_name": null,1123          "flair_name": null,1124          "flair_url": null,1125          "flair_bg_color": null,1126          "flair_color": null,1127          "flair_group_id": null,1128          "badges_granted": [],1129          "version": 1,1130          "can_edit": false,1131          "can_delete": false,1132          "can_recover": false,1133          "can_see_hidden_post": false,1134          "can_wiki": false,1135          "read": true,1136          "user_title": null,1137          "bookmarked": false,1138          "actions_summary": [],1139          "moderator": false,1140          "admin": false,1141          "staff": false,1142          "user_id": 22880,1143          "hidden": false,1144          "trust_level": 1,1145          "deleted_at": null,1146          "user_deleted": false,1147          "edit_reason": null,1148          "can_view_edit_history": true,1149          "wiki": false,1150          "post_url": "/t/cross-entropy-loss-for-multiclass-classification/57976/1",1151          "can_accept_answer": false,1152          "can_unaccept_answer": false,1153          "accepted_answer": false,1154          "topic_accepted_answer": null,1155          "can_vote": false1156        },1157        {1158          "id": 139487,1159          "name": "Alban D",1160          "username": "albanD",1161          "avatar_template": "/user_avatar/discuss.pytorch.org/alband/{size}/215_2.png",1162          "created_at": "2019-10-12T22:41:05.410Z",1163          "cooked": "<p>You can see the doc for what exactly each one is doing: <a href=\"https://pytorch.org/docs/stable/nn.html#crossentropyloss\" rel=\"nofollow noopener\">cross entropy</a>, <a href=\"https://pytorch.org/docs/stable/nn.html#nllloss\" rel=\"nofollow noopener\">nll</a>, <a href=\"https://pytorch.org/docs/stable/nn.html#bceloss\" rel=\"nofollow noopener\">bce</a> and <a href=\"https://pytorch.org/docs/stable/nn.html#bcewithlogitsloss\" rel=\"nofollow noopener\">bce with logits</a> should be the ones you want to check.</p>",1164          "post_number": 2,1165          "post_type": 1,1166          "posts_count": 3,1167          "updated_at": "2019-10-12T22:41:05.410Z",1168          "reply_count": 1,1169          "reply_to_post_number": null,1170          "quote_count": 0,1171          "incoming_link_count": 0,1172          "reads": 22,1173          "readers_count": 21,1174          "score": 9.4,1175          "yours": false,1176          "topic_id": 57976,1177          "topic_slug": "cross-entropy-loss-for-multiclass-classification",1178          "display_username": "Alban D",1179          "primary_group_name": null,1180          "flair_name": null,1181          "flair_url": null,1182          "flair_bg_color": null,1183          "flair_color": null,1184          "flair_group_id": null,1185          "badges_granted": [],1186          "version": 1,1187          "can_edit": false,1188          "can_delete": false,1189          "can_recover": false,1190          "can_see_hidden_post": false,1191          "can_wiki": false,1192          "link_counts": [1193            {1194              "url": "https://pytorch.org/docs/stable/nn.html#crossentropyloss",1195              "internal": false,1196              "reflection": false,1197              "title": "torch.nn — PyTorch master documentation",1198              "clicks": 91199            },1200            {

Showing the first 1,200 of 59282 lines. Download the file for the rest.