CoolFace
Datasetpublic

Anurag1734/cuda-error-resolution-analysis

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes7downloads
topics_batch_326.json68095 linesDownload Raw Back to raw
1[2  {3    "post_stream": {4      "posts": [5        {6          "id": 294946,7          "name": "Toan Nguyen Duc",8          "username": "Toan_Nguyen_Duc",9          "avatar_template": "/user_avatar/discuss.pytorch.org/toan_nguyen_duc/{size}/32462_2.png",10          "created_at": "2021-07-09T17:39:46.594Z",11          "cooked": "<p>I am doing noise restoration, I have 1 set of images for input and one set of images for labels, but when I augment the data with pytorch, when I visualize a batch, the images and labels are different, although it is still the same image but if i do the crop it will be two different areas which is not what i really want.</p>\n<p><div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://discuss.pytorch.org/uploads/default/original/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2.jpeg\" data-download-href=\"https://discuss.pytorch.org/uploads/default/1f347f8f34a2be39c71e1ad08938f87c2d98cef2\" title=\"image\"><img src=\"https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2_2_690x268.jpeg\" alt=\"image\" data-base62-sha1=\"4s3hh2MHDmyM43ymBd9c3uiGuQi\" width=\"690\" height=\"268\" srcset=\"https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2_2_690x268.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2_2_1035x402.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2.jpeg 2x\" data-dominant-color=\"90938F\"><div class=\"meta\"><svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use href=\"#far-image\"></use></svg><span class=\"filename\">image</span><span class=\"informations\">1214×472 208 KB</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use href=\"#discourse-expand\"></use></svg></div></a></div></p>\n<pre><code class=\"lang-auto\">class GAN_DATASET(Dataset):\n  def __init__(self, ImageFolder, LabelFolder, data_transforms):\n    self.transforms = data_transforms\n    self.list_image = []\n    self.list_label = []\n    for i in os.listdir(ImageFolder):\n      self.list_image.append(i)\n\n    for i in os.listdir(LabelFolder):\n      self.list_label.append(i)\n\n    self.root_hazy_image = os.path.join(ImageFolder)\n    self.root_hazy_label = os.path.join(LabelFolder)\n    self.file_len = len(self.list_image)\n\n  def __getitem__(self, index, is_train=True):\n      hazy = Image.open(self.root_hazy_image + self.list_image[index])\n      hazy = self.transforms(hazy)\n      \n      label = Image.open(self.root_hazy_label + self.list_label[index])\n      label = self.transforms(label)\n      \n      name = self.list_image[index]\n      return hazy,label,name\n  def __len__(self):\n      return self.file_len \n</code></pre>",12          "post_number": 1,13          "post_type": 1,14          "posts_count": 2,15          "updated_at": "2021-07-09T17:39:46.594Z",16          "reply_count": 0,17          "reply_to_post_number": null,18          "quote_count": 0,19          "incoming_link_count": 15,20          "reads": 3,21          "readers_count": 2,22          "score": 75.6,23          "yours": false,24          "topic_id": 126302,25          "topic_slug": "label-and-image-are-the-same-when-augument-data-in-problem-reconstruct-image",26          "display_username": "Toan Nguyen Duc",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://discuss.pytorch.org/uploads/default/original/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2.jpeg",43              "internal": true,44              "reflection": false,45              "clicks": 046            }47          ],48          "read": true,49          "user_title": null,50          "bookmarked": false,51          "actions_summary": [],52          "moderator": false,53          "admin": false,54          "staff": false,55          "user_id": 47059,56          "hidden": false,57          "trust_level": 1,58          "deleted_at": null,59          "user_deleted": false,60          "edit_reason": null,61          "can_view_edit_history": true,62          "wiki": false,63          "post_url": "/t/label-and-image-are-the-same-when-augument-data-in-problem-reconstruct-image/126302/1",64          "can_accept_answer": false,65          "can_unaccept_answer": false,66          "accepted_answer": false,67          "topic_accepted_answer": null,68          "can_vote": false69        },70        {71          "id": 294989,72          "name": "",73          "username": "ptrblck",74          "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",75          "created_at": "2021-07-09T23:07:53.511Z",76          "cooked": "<p>If I understand your use case correctly, you would like to apply the same random transformations to the image and target tensors.<br>\nIn this case you could use the functional API as described in <a href=\"https://discuss.pytorch.org/t/torchvision-transfors-how-to-perform-identical-transform-on-both-image-and-target/10606/7\">this example</a>.</p>",77          "post_number": 2,78          "post_type": 1,79          "posts_count": 2,80          "updated_at": "2021-07-09T23:07:53.511Z",81          "reply_count": 0,82          "reply_to_post_number": null,83          "quote_count": 0,84          "incoming_link_count": 2,85          "reads": 3,86          "readers_count": 2,87          "score": 25.6,88          "yours": false,89          "topic_id": 126302,90          "topic_slug": "label-and-image-are-the-same-when-augument-data-in-problem-reconstruct-image",91          "display_username": "",92          "primary_group_name": null,93          "flair_name": null,94          "flair_url": null,95          "flair_bg_color": null,96          "flair_color": null,97          "flair_group_id": null,98          "badges_granted": [],99          "version": 1,100          "can_edit": false,101          "can_delete": false,102          "can_recover": false,103          "can_see_hidden_post": false,104          "can_wiki": false,105          "link_counts": [106            {107              "url": "https://discuss.pytorch.org/t/torchvision-transfors-how-to-perform-identical-transform-on-both-image-and-target/10606/7",108              "internal": true,109              "reflection": false,110              "title": "Torchvision.transfors: How to perform identical transform on both image and target?",111              "clicks": 5112            }113          ],114          "read": true,115          "user_title": "",116          "bookmarked": false,117          "actions_summary": [118            {119              "id": 2,120              "count": 1121            }122          ],123          "moderator": true,124          "admin": true,125          "staff": true,126          "user_id": 3534,127          "hidden": false,128          "trust_level": 2,129          "deleted_at": null,130          "user_deleted": false,131          "edit_reason": null,132          "can_view_edit_history": true,133          "wiki": false,134          "post_url": "/t/label-and-image-are-the-same-when-augument-data-in-problem-reconstruct-image/126302/2",135          "can_accept_answer": false,136          "can_unaccept_answer": false,137          "accepted_answer": false,138          "topic_accepted_answer": null139        }140      ],141      "stream": [142        294946,143        294989144      ]145    },146    "timeline_lookup": [147      [148        1,149        1569150      ]151    ],152    "suggested_topics": [153      {154        "fancy_title": "Unexpected Behavior with Weight Sharing between nn.Linear and nn.Embedding",155        "id": 212223,156        "title": "Unexpected Behavior with Weight Sharing between nn.Linear and nn.Embedding",157        "slug": "unexpected-behavior-with-weight-sharing-between-nn-linear-and-nn-embedding",158        "posts_count": 3,159        "reply_count": 1,160        "highest_post_number": 3,161        "image_url": null,162        "created_at": "2024-10-28T22:58:14.282Z",163        "last_posted_at": "2024-10-29T00:47:09.870Z",164        "bumped": true,165        "bumped_at": "2024-10-29T00:47:09.870Z",166        "archetype": "regular",167        "unseen": false,168        "pinned": false,169        "unpinned": null,170        "visible": true,171        "closed": false,172        "archived": false,173        "bookmarked": null,174        "liked": null,175        "tags_descriptions": {},176        "like_count": 1,177        "views": 58,178        "category_id": 1,179        "featured_link": null,180        "has_accepted_answer": false,181        "posters": [182          {183            "extras": "latest",184            "description": "Original Poster, Most Recent Poster",185            "user": {186              "id": 59149,187              "username": "samlk",188              "name": "Kryštof Šaml",189              "avatar_template": "/letter_avatar_proxy/v4/letter/s/c57346/{size}.png",190              "trust_level": 1191            }192          },193          {194            "extras": null,195            "description": "Frequent Poster",196            "user": {197              "id": 3534,198              "username": "ptrblck",199              "name": "",200              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",201              "admin": true,202              "moderator": true,203              "trust_level": 2204            }205          }206        ]207      },208      {209        "fancy_title": "Loading model from checkpoint results differ to loading model directly",210        "id": 212514,211        "title": "Loading model from checkpoint results differ to loading model directly",212        "slug": "loading-model-from-checkpoint-results-differ-to-loading-model-directly",213        "posts_count": 3,214        "reply_count": 1,215        "highest_post_number": 3,216        "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/5/f/5f8b63b57c5fb949f5ab5ca1980be73ad1741806_2_1024x880.png",217        "created_at": "2024-11-04T17:40:35.061Z",218        "last_posted_at": "2024-11-06T11:09:50.739Z",219        "bumped": true,220        "bumped_at": "2024-11-06T11:09:50.739Z",221        "archetype": "regular",222        "unseen": false,223        "pinned": false,224        "unpinned": null,225        "visible": true,226        "closed": false,227        "archived": false,228        "bookmarked": null,229        "liked": null,230        "tags_descriptions": {},231        "like_count": 0,232        "views": 291,233        "category_id": 1,234        "featured_link": null,235        "has_accepted_answer": true,236        "posters": [237          {238            "extras": "latest",239            "description": "Original Poster, Most Recent Poster, Accepted Answer",240            "user": {241              "id": 71636,242              "username": "sophiamaedler",243              "name": "Sophia Mädler",244              "avatar_template": "/user_avatar/discuss.pytorch.org/sophiamaedler/{size}/66166_2.png",245              "trust_level": 1246            }247          },248          {249            "extras": null,250            "description": "Frequent Poster",251            "user": {252              "id": 3534,253              "username": "ptrblck",254              "name": "",255              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",256              "admin": true,257              "moderator": true,258              "trust_level": 2259            }260          }261        ]262      },263      {264        "fancy_title": "Error while implementing BYOL Training Strategy",265        "id": 212422,266        "title": "Error while implementing BYOL Training Strategy",267        "slug": "error-while-implementing-byol-training-strategy",268        "posts_count": 4,269        "reply_count": 2,270        "highest_post_number": 4,271        "image_url": null,272        "created_at": "2024-11-01T18:13:24.323Z",273        "last_posted_at": "2024-11-02T18:19:56.396Z",274        "bumped": true,275        "bumped_at": "2024-11-02T18:19:56.396Z",276        "archetype": "regular",277        "unseen": false,278        "pinned": false,279        "unpinned": null,280        "visible": true,281        "closed": false,282        "archived": false,283        "bookmarked": null,284        "liked": null,285        "tags_descriptions": {},286        "like_count": 0,287        "views": 64,288        "category_id": 1,289        "featured_link": null,290        "has_accepted_answer": true,291        "posters": [292          {293            "extras": null,294            "description": "Original Poster",295            "user": {296              "id": 80558,297              "username": "Rebantadey",298              "name": "",299              "avatar_template": "/letter_avatar_proxy/v4/letter/r/6f9a4e/{size}.png",300              "trust_level": 1301            }302          },303          {304            "extras": "latest",305            "description": "Most Recent Poster, Accepted Answer",306            "user": {307              "id": 3534,308              "username": "ptrblck",309              "name": "",310              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",311              "admin": true,312              "moderator": true,313              "trust_level": 2314            }315          }316        ]317      },318      {319        "fancy_title": "No CUDA 12.4 distribution for Linux when using pip?",320        "id": 213783,321        "title": "No CUDA 12.4 distribution for Linux when using pip?",322        "slug": "no-cuda-12-4-distribution-for-linux-when-using-pip",323        "posts_count": 5,324        "reply_count": 2,325        "highest_post_number": 5,326        "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/d/2/d222135c692d3df71abaf45fd1709ced8159e8bd.png",327        "created_at": "2024-12-04T06:31:14.083Z",328        "last_posted_at": "2024-12-04T13:29:00.235Z",329        "bumped": true,330        "bumped_at": "2024-12-04T13:29:00.235Z",331        "archetype": "regular",332        "unseen": false,333        "pinned": false,334        "unpinned": null,335        "visible": true,336        "closed": false,337        "archived": false,338        "bookmarked": null,339        "liked": null,340        "tags_descriptions": {},341        "like_count": 4,342        "views": 209,343        "category_id": 1,344        "featured_link": null,345        "has_accepted_answer": true,346        "posters": [347          {348            "extras": null,349            "description": "Original Poster",350            "user": {351              "id": 81293,352              "username": "jhj0517",353              "name": "jhj0517",354              "avatar_template": "/user_avatar/discuss.pytorch.org/jhj0517/{size}/74344_2.png",355              "trust_level": 0356            }357          },358          {359            "extras": "latest",360            "description": "Most Recent Poster, Accepted Answer",361            "user": {362              "id": 3534,363              "username": "ptrblck",364              "name": "",365              "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",366              "admin": true,367              "moderator": true,368              "trust_level": 2369            }370          },371          {372            "extras": null,373            "description": "Frequent Poster",374            "user": {375              "id": 81089,376              "username": "Aknw_Fen",377              "name": "Aknw Fen",378              "avatar_template": "/user_avatar/discuss.pytorch.org/aknw_fen/{size}/74156_2.png",379              "trust_level": 2380            }381          }382        ]383      },384      {385        "fancy_title": "Torch operation time measurement using benchmark.Timer",386        "id": 214601,387        "title": "Torch operation time measurement using benchmark.Timer",388        "slug": "torch-operation-time-measurement-using-benchmark-timer",389        "posts_count": 4,390        "reply_count": 2,391        "highest_post_number": 4,392        "image_url": null,393        "created_at": "2024-12-24T13:25:29.457Z",394        "last_posted_at": "2024-12-26T19:00:12.957Z",395        "bumped": true,396        "bumped_at": "2024-12-26T19:00:12.957Z",397        "archetype": "regular",398        "unseen": false,399        "pinned": false,400        "unpinned": null,401        "visible": true,402        "closed": false,403        "archived": false,404        "bookmarked": null,405        "liked": null,406        "tags_descriptions": {},407        "like_count": 0,408        "views": 267,409        "category_id": 1,410        "featured_link": null,411        "has_accepted_answer": true,412        "posters": [413          {414            "extras": null,415            "description": "Original Poster",416            "user": {417              "id": 67104,418              "username": "sakura1",419              "name": "",420              "avatar_template": "/user_avatar/discuss.pytorch.org/sakura1/{size}/74707_2.png",421              "trust_level": 1422            }423          },424          {425            "extras": "latest",426            "description": "Most Recent Poster, Accepted Answer",427            "user": {428              "id": 41396,429              "username": "soulitzer",430              "name": "",431              "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",432              "trust_level": 2433            }434          }435        ]436      }437    ],438    "tags_descriptions": {},439    "fancy_title": "Label and image are the same when augument data in problem reconstruct image",440    "id": 126302,441    "title": "Label and image are the same when augument data in problem reconstruct image",442    "posts_count": 2,443    "created_at": "2021-07-09T17:39:46.513Z",444    "views": 643,445    "reply_count": 0,446    "like_count": 1,447    "last_posted_at": "2021-07-09T23:07:53.511Z",448    "visible": true,449    "closed": false,450    "archived": false,451    "has_summary": false,452    "archetype": "regular",453    "slug": "label-and-image-are-the-same-when-augument-data-in-problem-reconstruct-image",454    "category_id": 1,455    "word_count": 224,456    "deleted_at": null,457    "user_id": 47059,458    "featured_link": null,459    "pinned_globally": false,460    "pinned_at": null,461    "pinned_until": null,462    "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2_2_1024x398.jpeg",463    "slow_mode_seconds": 0,464    "draft": null,465    "draft_key": "topic_126302",466    "draft_sequence": null,467    "unpinned": null,468    "pinned": false,469    "current_post_number": 1,470    "highest_post_number": 2,471    "deleted_by": null,472    "actions_summary": [473      {474        "id": 4,475        "count": 0,476        "hidden": false,477        "can_act": false478      },479      {480        "id": 8,481        "count": 0,482        "hidden": false,483        "can_act": false484      },485      {486        "id": 10,487        "count": 0,488        "hidden": false,489        "can_act": false490      },491      {492        "id": 7,493        "count": 0,494        "hidden": false,495        "can_act": false496      }497    ],498    "chunk_size": 20,499    "bookmarked": false,500    "topic_timer": null,501    "message_bus_last_id": 0,502    "participant_count": 2,503    "show_read_indicator": false,504    "thumbnails": [505      {506        "max_width": null,507        "max_height": null,508        "width": 1214,509        "height": 472,510        "url": "https://discuss.pytorch.org/uploads/default/original/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2.jpeg"511      },512      {513        "max_width": 1024,514        "max_height": 1024,515        "width": 1024,516        "height": 398,517        "url": "https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f347f8f34a2be39c71e1ad08938f87c2d98cef2_2_1024x398.jpeg"518      }519    ],520    "slow_mode_enabled_until": null,521    "can_vote": false,522    "vote_count": 0,523    "user_voted": false,524    "discourse_zendesk_plugin_zendesk_id": null,525    "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",526    "details": {527      "can_edit": false,528      "notification_level": 1,529      "participants": [530        {531          "id": 3534,532          "username": "ptrblck",533          "name": "",534          "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",535          "post_count": 1,536          "primary_group_name": null,537          "flair_name": null,538          "flair_url": null,539          "flair_color": null,540          "flair_bg_color": null,541          "flair_group_id": null,542          "admin": true,543          "moderator": true,544          "trust_level": 2545        },546        {547          "id": 47059,548          "username": "Toan_Nguyen_Duc",549          "name": "Toan Nguyen Duc",550          "avatar_template": "/user_avatar/discuss.pytorch.org/toan_nguyen_duc/{size}/32462_2.png",551          "post_count": 1,552          "primary_group_name": null,553          "flair_name": null,554          "flair_url": null,555          "flair_color": null,556          "flair_bg_color": null,557          "flair_group_id": null,558          "trust_level": 1559        }560      ],561      "created_by": {562        "id": 47059,563        "username": "Toan_Nguyen_Duc",564        "name": "Toan Nguyen Duc",565        "avatar_template": "/user_avatar/discuss.pytorch.org/toan_nguyen_duc/{size}/32462_2.png"566      },567      "last_poster": {568        "id": 3534,569        "username": "ptrblck",570        "name": "",571        "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"572      },573      "links": [574        {575          "url": "https://discuss.pytorch.org/t/torchvision-transfors-how-to-perform-identical-transform-on-both-image-and-target/10606/7",576          "title": "Torchvision.transfors: How to perform identical transform on both image and target?",577          "internal": true,578          "attachment": false,579          "reflection": false,580          "clicks": 5,581          "user_id": 3534,582          "domain": "discuss.pytorch.org",583          "root_domain": "pytorch.org"584        }585      ]586    },587    "bookmarks": []588  },589  {590    "post_stream": {591      "posts": [592        {593          "id": 294777,594          "name": "Dino Vougioukas",595          "username": "Sfitsos",596          "avatar_template": "/user_avatar/discuss.pytorch.org/sfitsos/{size}/10434_2.png",597          "created_at": "2021-07-08T20:24:27.995Z",598          "cooked": "<p>I have a model that has a GRU in it. I have traced the model but when I load it and call the forward method it works only if the length of the sequence I use is the same as the dummy input used when tracing. I get this warning when tracing:</p>\n<pre><code>TracerWarning: Iterating over a tensor might cause the trace to be incorrect.\nPassing a tensor of different shape won't change the number of iterations \nexecuted (and might lead to errors or silently ​give incorrect results).\n</code></pre>\n<p>My dummy sequence has a length of 25 with features of size 256 (6400). I chose this at random since the model should work for variable sequence lengths. However, when I load the model and pass a sequence with a different length to the dummy input I get this error:</p>\n<p>RuntimeError: shape ‘[-1, 30, 256]’ is invalid for input of size 6400</p>\n<p>Is this normal (i.e. what the warning was about) and if so are there any workarounds?</p>\n<p>I suppose one workaround is to have a max size and pad the tensor when I use it but this is not optimal.</p>",599          "post_number": 1,600          "post_type": 1,601          "posts_count": 4,602          "updated_at": "2021-07-08T20:33:28.820Z",603          "reply_count": 0,604          "reply_to_post_number": null,605          "quote_count": 0,606          "incoming_link_count": 1885,607          "reads": 34,608          "readers_count": 33,609          "score": 9401.8,610          "yours": false,611          "topic_id": 126235,612          "topic_slug": "torchscript-for-model-with-gru",613          "display_username": "Dino Vougioukas",614          "primary_group_name": null,615          "flair_name": null,616          "flair_url": null,617          "flair_bg_color": null,618          "flair_color": null,619          "flair_group_id": null,620          "badges_granted": [],621          "version": 2,622          "can_edit": false,623          "can_delete": false,624          "can_recover": false,625          "can_see_hidden_post": false,626          "can_wiki": false,627          "read": true,628          "user_title": null,629          "bookmarked": false,630          "actions_summary": [],631          "moderator": false,632          "admin": false,633          "staff": false,634          "user_id": 4061,635          "hidden": false,636          "trust_level": 2,637          "deleted_at": null,638          "user_deleted": false,639          "edit_reason": null,640          "can_view_edit_history": true,641          "wiki": false,642          "post_url": "/t/torchscript-for-model-with-gru/126235/1",643          "can_accept_answer": false,644          "can_unaccept_answer": false,645          "accepted_answer": false,646          "topic_accepted_answer": true,647          "can_vote": false648        },649        {650          "id": 294784,651          "name": "Daniel Falbel",652          "username": "dfalbel",653          "avatar_template": "/user_avatar/discuss.pytorch.org/dfalbel/{size}/8880_2.png",654          "created_at": "2021-07-08T21:12:12.254Z",655          "cooked": "<p>AFAICT this is exactly tthe case where tracing doesn’t work well. See the <code>Warning</code> section in the <code>torch.jit.trace</code> documentation page:</p>\n<p><a href=\"https://pytorch.org/docs/stable/generated/torch.jit.trace.html#torch.jit.trace\" class=\"onebox\" target=\"_blank\" rel=\"noopener nofollow ugc\">https://pytorch.org/docs/stable/generated/torch.jit.trace.html#torch.jit.trace</a></p>\n<blockquote>\n<p>…<br>\nTracing will not record any control-flow like if-statements or loops.<br>\n…</p>\n</blockquote>\n<p>It also offers a possible solution:</p>\n<blockquote>\n<p>In cases like these, tracing would not be appropriate and <a href=\"https://pytorch.org/docs/stable/generated/torch.jit.script.html#torch.jit.script\" rel=\"noopener nofollow ugc\"><code>scripting</code></a> is a better choice. If you trace such models, you may silently get incorrect results on subsequent invocations of the model. The tracer will try to emit warnings when doing something that may cause an incorrect trace to be produced.</p>\n</blockquote>",656          "post_number": 2,657          "post_type": 1,658          "posts_count": 4,659          "updated_at": "2021-07-08T21:13:38.870Z",660          "reply_count": 1,661          "reply_to_post_number": null,662          "quote_count": 0,663          "incoming_link_count": 30,664          "reads": 32,665          "readers_count": 31,666          "score": 161.4,667          "yours": false,668          "topic_id": 126235,669          "topic_slug": "torchscript-for-model-with-gru",670          "display_username": "Daniel Falbel",671          "primary_group_name": null,672          "flair_name": null,673          "flair_url": null,674          "flair_bg_color": null,675          "flair_color": null,676          "flair_group_id": null,677          "badges_granted": [],678          "version": 2,679          "can_edit": false,680          "can_delete": false,681          "can_recover": false,682          "can_see_hidden_post": false,683          "can_wiki": false,684          "link_counts": [685            {686              "url": "https://pytorch.org/docs/stable/generated/torch.jit.trace.html#torch.jit.trace",687              "internal": false,688              "reflection": false,689              "title": "torch.jit.trace — PyTorch 1.9.0 documentation",690              "clicks": 65691            },692            {693              "url": "https://pytorch.org/docs/stable/generated/torch.jit.script.html#torch.jit.script",694              "internal": false,695              "reflection": false,696              "title": "torch.jit.script — PyTorch 1.9.0 documentation",697              "clicks": 51698            }699          ],700          "read": true,701          "user_title": null,702          "bookmarked": false,703          "actions_summary": [],704          "moderator": false,705          "admin": false,706          "staff": false,707          "user_id": 13551,708          "hidden": false,709          "trust_level": 2,710          "deleted_at": null,711          "user_deleted": false,712          "edit_reason": null,713          "can_view_edit_history": true,714          "wiki": false,715          "post_url": "/t/torchscript-for-model-with-gru/126235/2",716          "can_accept_answer": false,717          "can_unaccept_answer": false,718          "accepted_answer": false,719          "topic_accepted_answer": true720        },721        {722          "id": 294788,723          "name": "Dino Vougioukas",724          "username": "Sfitsos",725          "avatar_template": "/user_avatar/discuss.pytorch.org/sfitsos/{size}/10434_2.png",726          "created_at": "2021-07-08T21:40:18.185Z",727          "cooked": "<p>The problem in my case seems to be that the handling of variable sized tensors (due to variable sequence lengths). I assume then that this is internally implemented with a loop. I will look into scripting but if the loop is in the pytorch code then how would I do it? Another alternative that I just considered is inputting the hidden state for the GRU and passing it to the network which will output the hidden state for use in future steps. That way I suppose I could use use a dummy with length 1 and perform the loop outside. Would something like this work?</p>",728          "post_number": 3,729          "post_type": 1,730          "posts_count": 4,731          "updated_at": "2021-07-08T21:43:26.060Z",732          "reply_count": 1,733          "reply_to_post_number": 2,734          "quote_count": 0,735          "incoming_link_count": 18,736          "reads": 29,737          "readers_count": 28,738          "score": 100.8,739          "yours": false,740          "topic_id": 126235,741          "topic_slug": "torchscript-for-model-with-gru",742          "display_username": "Dino Vougioukas",743          "primary_group_name": null,744          "flair_name": null,745          "flair_url": null,746          "flair_bg_color": null,747          "flair_color": null,748          "flair_group_id": null,749          "badges_granted": [],750          "version": 1,751          "can_edit": false,752          "can_delete": false,753          "can_recover": false,754          "can_see_hidden_post": false,755          "can_wiki": false,756          "read": true,757          "user_title": null,758          "reply_to_user": {759            "id": 13551,760            "username": "dfalbel",761            "name": "Daniel Falbel",762            "avatar_template": "/user_avatar/discuss.pytorch.org/dfalbel/{size}/8880_2.png"763          },764          "bookmarked": false,765          "actions_summary": [],766          "moderator": false,767          "admin": false,768          "staff": false,769          "user_id": 4061,770          "hidden": false,771          "trust_level": 2,772          "deleted_at": null,773          "user_deleted": false,774          "edit_reason": null,775          "can_view_edit_history": true,776          "wiki": false,777          "post_url": "/t/torchscript-for-model-with-gru/126235/3",778          "can_accept_answer": false,779          "can_unaccept_answer": false,780          "accepted_answer": false,781          "topic_accepted_answer": true782        },783        {784          "id": 294987,785          "name": "Daniel Falbel",786          "username": "dfalbel",787          "avatar_template": "/user_avatar/discuss.pytorch.org/dfalbel/{size}/8880_2.png",788          "created_at": "2021-07-09T21:26:46.901Z",789          "cooked": "<p>I think scripting works fine in that case and is probably the best option:</p>\n<pre><code class=\"lang-auto\">import torch\nimport torch.nn as nn\n\nclass MyGRU (nn.Module):\n  def __init__ (self):\n    super(MyGRU, self).__init__()\n    self.gru = nn.GRU(10, 32, 5)\n  \n  def forward (self, x):\n    return self.gru(x)\n\nmodule = torch.jit.script(MyGRU())\nprint(module(torch.randn(100, 15, 10))[0].shape)\nprint(module(torch.randn(100, 20, 10))[0].shape)\n</code></pre>",790          "post_number": 4,791          "post_type": 1,792          "posts_count": 4,793          "updated_at": "2021-07-12T10:21:33.372Z",794          "reply_count": 0,795          "reply_to_post_number": 3,796          "quote_count": 0,797          "incoming_link_count": 30,798          "reads": 23,799          "readers_count": 22,800          "score": 149.6,801          "yours": false,802          "topic_id": 126235,803          "topic_slug": "torchscript-for-model-with-gru",804          "display_username": "Daniel Falbel",805          "primary_group_name": null,806          "flair_name": null,807          "flair_url": null,808          "flair_bg_color": null,809          "flair_color": null,810          "flair_group_id": null,811          "badges_granted": [],812          "version": 1,813          "can_edit": false,814          "can_delete": false,815          "can_recover": false,816          "can_see_hidden_post": false,817          "can_wiki": false,818          "read": true,819          "user_title": null,820          "reply_to_user": {821            "id": 4061,822            "username": "Sfitsos",823            "name": "Dino Vougioukas",824            "avatar_template": "/user_avatar/discuss.pytorch.org/sfitsos/{size}/10434_2.png"825          },826          "bookmarked": false,827          "actions_summary": [],828          "moderator": false,829          "admin": false,830          "staff": false,831          "user_id": 13551,832          "hidden": false,833          "trust_level": 2,834          "deleted_at": null,835          "user_deleted": false,836          "edit_reason": null,837          "can_view_edit_history": true,838          "wiki": false,839          "post_url": "/t/torchscript-for-model-with-gru/126235/4",840          "can_accept_answer": false,841          "can_unaccept_answer": false,842          "accepted_answer": true,843          "topic_accepted_answer": true844        }845      ],846      "stream": [847        294777,848        294784,849        294788,850        294987851      ]852    },853    "timeline_lookup": [854      [855        1,856        1570857      ],858      [859        4,860        1569861      ]862    ],863    "suggested_topics": [864      {865        "fancy_title": "[JIT] Compilation-induced discrepancy in F.instance_norm when passing input as running stats",866        "id": 219915,867        "title": "[JIT] Compilation-induced discrepancy in F.instance_norm when passing input as running stats",868        "slug": "jit-compilation-induced-discrepancy-in-f-instance-norm-when-passing-input-as-running-stats",869        "posts_count": 1,870        "reply_count": 0,871        "highest_post_number": 1,872        "image_url": null,873        "created_at": "2025-05-10T09:51:36.969Z",874        "last_posted_at": "2025-05-10T09:51:37.012Z",875        "bumped": true,876        "bumped_at": "2025-05-10T09:51:37.012Z",877        "archetype": "regular",878        "unseen": false,879        "pinned": false,880        "unpinned": null,881        "visible": true,882        "closed": false,883        "archived": false,884        "bookmarked": null,885        "liked": null,886        "tags_descriptions": {},887        "like_count": 0,888        "views": 18,889        "category_id": 13,890        "featured_link": null,891        "has_accepted_answer": false,892        "posters": [893          {894            "extras": "latest single",895            "description": "Original Poster, Most Recent Poster",896            "user": {897              "id": 83508,898              "username": "zhouxiaoyaozzz",899              "name": "瑞 周",900              "avatar_template": "/user_avatar/discuss.pytorch.org/zhouxiaoyaozzz/{size}/76376_2.png",901              "trust_level": 0902            }903          }904        ]905      },906      {907        "fancy_title": "Can a Lightning model be converted to TorchScript format?",908        "id": 220231,909        "title": "Can a Lightning model be converted to TorchScript format?",910        "slug": "can-a-lightning-model-be-converted-to-torchscript-format",911        "posts_count": 1,912        "reply_count": 0,913        "highest_post_number": 1,914        "image_url": null,915        "created_at": "2025-05-21T16:56:41.699Z",916        "last_posted_at": "2025-05-21T16:56:41.757Z",917        "bumped": true,918        "bumped_at": "2025-05-21T17:05:56.516Z",919        "archetype": "regular",920        "unseen": false,921        "pinned": false,922        "unpinned": null,923        "visible": true,924        "closed": false,925        "archived": false,926        "bookmarked": null,927        "liked": null,928        "tags_descriptions": {},929        "like_count": 0,930        "views": 36,931        "category_id": 13,932        "featured_link": null,933        "has_accepted_answer": false,934        "posters": [935          {936            "extras": "latest single",937            "description": "Original Poster, Most Recent Poster",938            "user": {939              "id": 59649,940              "username": "evilroach",941              "name": "Evil Roach",942              "avatar_template": "/user_avatar/discuss.pytorch.org/evilroach/{size}/53515_2.png",943              "trust_level": 1944            }945          }946        ]947      },948      {949        "fancy_title": "How to use torch.jit.trace to trace CausalLMOutputWithPast?",950        "id": 216140,951        "title": "How to use torch.jit.trace to trace CausalLMOutputWithPast?",952        "slug": "how-to-use-torch-jit-trace-to-trace-causallmoutputwithpast",953        "posts_count": 2,954        "reply_count": 0,955        "highest_post_number": 2,956        "image_url": null,957        "created_at": "2025-02-02T06:29:49.693Z",958        "last_posted_at": "2025-02-02T14:07:08.081Z",959        "bumped": true,960        "bumped_at": "2025-02-02T14:26:15.495Z",961        "archetype": "regular",962        "unseen": false,963        "pinned": false,964        "unpinned": null,965        "visible": true,966        "closed": false,967        "archived": false,968        "bookmarked": null,969        "liked": null,970        "tags_descriptions": {},971        "like_count": 0,972        "views": 258,973        "category_id": 13,974        "featured_link": null,975        "has_accepted_answer": false,976        "posters": [977          {978            "extras": null,979            "description": "Original Poster",980            "user": {981              "id": 82440,982              "username": "GoodJob",983              "name": "GoodJob",984              "avatar_template": "/user_avatar/discuss.pytorch.org/goodjob/{size}/75425_2.png",985              "trust_level": 0986            }987          },988          {989            "extras": "latest",990            "description": "Most Recent Poster",991            "user": {992              "id": 60146,993              "username": "MyCenturaHealth",994              "name": "MyCenturaHealth",995              "avatar_template": "/user_avatar/discuss.pytorch.org/mycenturahealth/{size}/46345_2.png",996              "trust_level": 1997            }998          }999        ]1000      },1001      {1002        "fancy_title": "Torch.jit._get_trace_graph",1003        "id": 219103,1004        "title": "Torch.jit._get_trace_graph",1005        "slug": "torch-jit-get-trace-graph",1006        "posts_count": 1,1007        "reply_count": 0,1008        "highest_post_number": 1,1009        "image_url": null,1010        "created_at": "2025-04-15T11:21:23.571Z",1011        "last_posted_at": "2025-04-15T11:21:23.612Z",1012        "bumped": true,1013        "bumped_at": "2025-04-16T05:35:42.219Z",1014        "archetype": "regular",1015        "unseen": false,1016        "pinned": false,1017        "unpinned": null,1018        "visible": true,1019        "closed": false,1020        "archived": false,1021        "bookmarked": null,1022        "liked": null,1023        "tags_descriptions": {},1024        "like_count": 0,1025        "views": 72,1026        "category_id": 13,1027        "featured_link": null,1028        "has_accepted_answer": false,1029        "posters": [1030          {1031            "extras": "latest single",1032            "description": "Original Poster, Most Recent Poster",1033            "user": {1034              "id": 81709,1035              "username": "QLYYLQ",1036              "name": "qly",1037              "avatar_template": "/user_avatar/discuss.pytorch.org/qlyylq/{size}/74718_2.png",1038              "trust_level": 11039            }1040          }1041        ]1042      },1043      {1044        "fancy_title": "Use torch_tensorrt.compiler()",1045        "id": 221138,1046        "title": "Use torch_tensorrt.compiler()",1047        "slug": "use-torch-tensorrt-compiler",1048        "posts_count": 1,1049        "reply_count": 0,1050        "highest_post_number": 1,1051        "image_url": null,1052        "created_at": "2025-06-29T12:39:13.524Z",1053        "last_posted_at": "2025-06-29T12:39:13.566Z",1054        "bumped": true,1055        "bumped_at": "2025-06-29T12:39:13.566Z",1056        "archetype": "regular",1057        "unseen": false,1058        "pinned": false,1059        "unpinned": null,1060        "visible": true,1061        "closed": false,1062        "archived": false,1063        "bookmarked": null,1064        "liked": null,1065        "tags_descriptions": {},1066        "like_count": 0,1067        "views": 30,1068        "category_id": 13,1069        "featured_link": null,1070        "has_accepted_answer": false,1071        "posters": [1072          {1073            "extras": "latest single",1074            "description": "Original Poster, Most Recent Poster",1075            "user": {1076              "id": 71302,1077              "username": "Muhammad_Tarek_Refaa",1078              "name": "Muhammad Tarek Refaat",1079              "avatar_template": "/user_avatar/discuss.pytorch.org/muhammad_tarek_refaa/{size}/65846_2.png",1080              "trust_level": 11081            }1082          }1083        ]1084      }1085    ],1086    "tags_descriptions": {},1087    "fancy_title": "Torchscript for model with GRU",1088    "id": 126235,1089    "title": "Torchscript for model with GRU",1090    "posts_count": 4,1091    "created_at": "2021-07-08T20:24:27.901Z",1092    "views": 2770,1093    "reply_count": 2,1094    "like_count": 0,1095    "last_posted_at": "2021-07-09T21:26:46.901Z",1096    "visible": true,1097    "closed": false,1098    "archived": false,1099    "has_summary": false,1100    "archetype": "regular",1101    "slug": "torchscript-for-model-with-gru",1102    "category_id": 13,1103    "word_count": 483,1104    "deleted_at": null,1105    "user_id": 4061,1106    "featured_link": null,1107    "pinned_globally": false,1108    "pinned_at": null,1109    "pinned_until": null,1110    "image_url": null,1111    "slow_mode_seconds": 0,1112    "draft": null,1113    "draft_key": "topic_126235",1114    "draft_sequence": null,1115    "unpinned": null,1116    "pinned": false,1117    "current_post_number": 1,1118    "highest_post_number": 4,1119    "deleted_by": null,1120    "actions_summary": [1121      {1122        "id": 4,1123        "count": 0,1124        "hidden": false,1125        "can_act": false1126      },1127      {1128        "id": 8,1129        "count": 0,1130        "hidden": false,1131        "can_act": false1132      },1133      {1134        "id": 10,1135        "count": 0,1136        "hidden": false,1137        "can_act": false1138      },1139      {1140        "id": 7,1141        "count": 0,1142        "hidden": false,1143        "can_act": false1144      }1145    ],1146    "chunk_size": 20,1147    "bookmarked": false,1148    "topic_timer": null,1149    "message_bus_last_id": 0,1150    "participant_count": 2,1151    "show_read_indicator": false,1152    "thumbnails": null,1153    "slow_mode_enabled_until": null,1154    "accepted_answer": {1155      "post_number": 4,1156      "username": "dfalbel",1157      "name": "Daniel Falbel",1158      "excerpt": "I think scripting works fine in that case and is probably the best option: \nimport torch\nimport torch.nn as nn\n\nclass MyGRU (nn.Module):\n  def __init__ (self):\n    super(MyGRU, self).__init__()\n    self.gru = nn.GRU(10, 32, 5)\n  \n  def forward (self, x):\n    return self.gru(x)\n\nmodule = torch.jit.sc&hellip;"1159    },1160    "can_vote": false,1161    "vote_count": 0,1162    "user_voted": false,1163    "discourse_zendesk_plugin_zendesk_id": null,1164    "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1165    "details": {1166      "can_edit": false,1167      "notification_level": 1,1168      "participants": [1169        {1170          "id": 4061,1171          "username": "Sfitsos",1172          "name": "Dino Vougioukas",1173          "avatar_template": "/user_avatar/discuss.pytorch.org/sfitsos/{size}/10434_2.png",1174          "post_count": 2,1175          "primary_group_name": null,1176          "flair_name": null,1177          "flair_url": null,1178          "flair_color": null,1179          "flair_bg_color": null,1180          "flair_group_id": null,1181          "trust_level": 21182        },1183        {1184          "id": 13551,1185          "username": "dfalbel",1186          "name": "Daniel Falbel",1187          "avatar_template": "/user_avatar/discuss.pytorch.org/dfalbel/{size}/8880_2.png",1188          "post_count": 2,1189          "primary_group_name": null,1190          "flair_name": null,1191          "flair_url": null,1192          "flair_color": null,1193          "flair_bg_color": null,1194          "flair_group_id": null,1195          "trust_level": 21196        }1197      ],1198      "created_by": {1199        "id": 4061,1200        "username": "Sfitsos",

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