Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 293196,7 "name": "Leroy Lin",8 "username": "yzleroy",9 "avatar_template": "/user_avatar/discuss.pytorch.org/yzleroy/{size}/39811_2.png",10 "created_at": "2021-06-30T07:03:55.645Z",11 "cooked": "<p>If I have a tensor <strong>A</strong> [1,5,3], then I perform shuffle operation, like torch.randperm(len(<strong>A</strong>)) and get shuffled index [2,1,0]. Then I shuffle <strong>A</strong> according to shuffled index, the resulted tensor is [3, 5, 1]. but how can I get original tensor ([1,5,3])? Is there any reverse shuffle function of pytorch? I know I can assign elements according to shuffled index, but it’s very slow. Can anybody help me? Thank you very much!!!</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 3,15 "updated_at": "2021-06-30T07:10:20.695Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 361,20 "reads": 6,21 "readers_count": 5,22 "score": 1806.2,23 "yours": false,24 "topic_id": 125432,25 "topic_slug": "how-to-reverse-shuffle-process-by-pytorch",26 "display_username": "Leroy Lin",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": 2,35 "can_edit": false,36 "can_delete": false,37 "can_recover": false,38 "can_see_hidden_post": false,39 "can_wiki": false,40 "read": true,41 "user_title": null,42 "bookmarked": false,43 "actions_summary": [],44 "moderator": false,45 "admin": false,46 "staff": false,47 "user_id": 46751,48 "hidden": false,49 "trust_level": 1,50 "deleted_at": null,51 "user_deleted": false,52 "edit_reason": null,53 "can_view_edit_history": true,54 "wiki": false,55 "post_url": "/t/how-to-reverse-shuffle-process-by-pytorch/125432/1",56 "can_accept_answer": false,57 "can_unaccept_answer": false,58 "accepted_answer": false,59 "topic_accepted_answer": null,60 "can_vote": false61 },62 {63 "id": 293201,64 "name": "",65 "username": "ptrblck",66 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",67 "created_at": "2021-06-30T07:11:29.584Z",68 "cooked": "<p>If I understand your use case correctly, this should work:</p>\n<pre><code class=\"lang-python\">a = torch.randn(7)\nprint(a)\n> tensor([ 1.1022, -0.3638, -0.4358, 0.2048, 1.3897, -2.2341, -0.3528])\n\nidx = torch.randperm(a.size(0))\nprint(idx)\n> tensor([5, 6, 0, 2, 4, 3, 1])\n\nb = a[idx]\nprint(b)\n> tensor([-2.2341, -0.3528, 1.1022, -0.4358, 1.3897, 0.2048, -0.3638])\n\nc = torch.zeros_like(a)\nc[idx] = b\nprint(c)\n> tensor([ 1.1022, -0.3638, -0.4358, 0.2048, 1.3897, -2.2341, -0.3528])\n\nprint((c == a).all())\n> tensor(True)\n</code></pre>",69 "post_number": 2,70 "post_type": 1,71 "posts_count": 3,72 "updated_at": "2021-06-30T07:11:29.584Z",73 "reply_count": 1,74 "reply_to_post_number": null,75 "quote_count": 0,76 "incoming_link_count": 10,77 "reads": 6,78 "readers_count": 5,79 "score": 56.2,80 "yours": false,81 "topic_id": 125432,82 "topic_slug": "how-to-reverse-shuffle-process-by-pytorch",83 "display_username": "",84 "primary_group_name": null,85 "flair_name": null,86 "flair_url": null,87 "flair_bg_color": null,88 "flair_color": null,89 "flair_group_id": null,90 "badges_granted": [],91 "version": 1,92 "can_edit": false,93 "can_delete": false,94 "can_recover": false,95 "can_see_hidden_post": false,96 "can_wiki": false,97 "read": true,98 "user_title": "",99 "bookmarked": false,100 "actions_summary": [],101 "moderator": true,102 "admin": true,103 "staff": true,104 "user_id": 3534,105 "hidden": false,106 "trust_level": 2,107 "deleted_at": null,108 "user_deleted": false,109 "edit_reason": null,110 "can_view_edit_history": true,111 "wiki": false,112 "post_url": "/t/how-to-reverse-shuffle-process-by-pytorch/125432/2",113 "can_accept_answer": false,114 "can_unaccept_answer": false,115 "accepted_answer": false,116 "topic_accepted_answer": null117 },118 {119 "id": 293205,120 "name": "Leroy Lin",121 "username": "yzleroy",122 "avatar_template": "/user_avatar/discuss.pytorch.org/yzleroy/{size}/39811_2.png",123 "created_at": "2021-06-30T07:13:35.560Z",124 "cooked": "<p>Yes, thank you very much!!! <img src=\"https://discuss.pytorch.org/images/emoji/apple/heart_eyes.png?v=9\" title=\":heart_eyes:\" class=\"emoji\" alt=\":heart_eyes:\"> <img src=\"https://discuss.pytorch.org/images/emoji/apple/smiling_face_with_three_hearts.png?v=9\" title=\":smiling_face_with_three_hearts:\" class=\"emoji\" alt=\":smiling_face_with_three_hearts:\"></p>",125 "post_number": 4,126 "post_type": 1,127 "posts_count": 3,128 "updated_at": "2021-06-30T07:13:35.560Z",129 "reply_count": 0,130 "reply_to_post_number": 2,131 "quote_count": 0,132 "incoming_link_count": 3,133 "reads": 5,134 "readers_count": 4,135 "score": 16.0,136 "yours": false,137 "topic_id": 125432,138 "topic_slug": "how-to-reverse-shuffle-process-by-pytorch",139 "display_username": "Leroy Lin",140 "primary_group_name": null,141 "flair_name": null,142 "flair_url": null,143 "flair_bg_color": null,144 "flair_color": null,145 "flair_group_id": null,146 "badges_granted": [],147 "version": 1,148 "can_edit": false,149 "can_delete": false,150 "can_recover": false,151 "can_see_hidden_post": false,152 "can_wiki": false,153 "read": true,154 "user_title": null,155 "reply_to_user": {156 "id": 3534,157 "username": "ptrblck",158 "name": "",159 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"160 },161 "bookmarked": false,162 "actions_summary": [],163 "moderator": false,164 "admin": false,165 "staff": false,166 "user_id": 46751,167 "hidden": false,168 "trust_level": 1,169 "deleted_at": null,170 "user_deleted": false,171 "edit_reason": null,172 "can_view_edit_history": true,173 "wiki": false,174 "post_url": "/t/how-to-reverse-shuffle-process-by-pytorch/125432/4",175 "can_accept_answer": false,176 "can_unaccept_answer": false,177 "accepted_answer": false,178 "topic_accepted_answer": null179 }180 ],181 "stream": [182 293196,183 293201,184 293205185 ]186 },187 "timeline_lookup": [188 [189 1,190 1579191 ]192 ],193 "suggested_topics": [194 {195 "fancy_title": "Adding softmax layer with crossentropy",196 "id": 214246,197 "title": "Adding softmax layer with crossentropy",198 "slug": "adding-softmax-layer-with-crossentropy",199 "posts_count": 2,200 "reply_count": 0,201 "highest_post_number": 2,202 "image_url": null,203 "created_at": "2024-12-15T15:31:16.823Z",204 "last_posted_at": "2024-12-15T17:04:48.668Z",205 "bumped": true,206 "bumped_at": "2024-12-15T17:04:48.668Z",207 "archetype": "regular",208 "unseen": false,209 "pinned": false,210 "unpinned": null,211 "visible": true,212 "closed": false,213 "archived": false,214 "bookmarked": null,215 "liked": null,216 "tags_descriptions": {},217 "like_count": 0,218 "views": 174,219 "category_id": 5,220 "featured_link": null,221 "has_accepted_answer": false,222 "posters": [223 {224 "extras": null,225 "description": "Original Poster",226 "user": {227 "id": 46221,228 "username": "mathwseg",229 "name": "mathwseg",230 "avatar_template": "/user_avatar/discuss.pytorch.org/mathwseg/{size}/39221_2.png",231 "trust_level": 1232 }233 },234 {235 "extras": "latest",236 "description": "Most Recent Poster",237 "user": {238 "id": 41396,239 "username": "soulitzer",240 "name": "",241 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",242 "trust_level": 2243 }244 }245 ]246 },247 {248 "fancy_title": "How to combine pre-trained weights of components from different multimodal LLMs?",249 "id": 215119,250 "title": "How to combine pre-trained weights of components from different multimodal LLMs?",251 "slug": "how-to-combine-pre-trained-weights-of-components-from-different-multimodal-llms",252 "posts_count": 1,253 "reply_count": 0,254 "highest_post_number": 1,255 "image_url": null,256 "created_at": "2025-01-08T12:57:20.583Z",257 "last_posted_at": "2025-01-08T12:57:20.618Z",258 "bumped": true,259 "bumped_at": "2025-01-08T12:57:20.618Z",260 "archetype": "regular",261 "unseen": false,262 "pinned": false,263 "unpinned": null,264 "visible": true,265 "closed": false,266 "archived": false,267 "bookmarked": null,268 "liked": null,269 "tags_descriptions": {},270 "like_count": 0,271 "views": 42,272 "category_id": 5,273 "featured_link": null,274 "has_accepted_answer": false,275 "posters": [276 {277 "extras": "latest single",278 "description": "Original Poster, Most Recent Poster",279 "user": {280 "id": 81933,281 "username": "tcm",282 "name": "Minh Tu",283 "avatar_template": "/user_avatar/discuss.pytorch.org/tcm/{size}/74956_2.png",284 "trust_level": 1285 }286 }287 ]288 },289 {290 "fancy_title": "Targeted Image Augmentation",291 "id": 215621,292 "title": "Targeted Image Augmentation",293 "slug": "targeted-image-augmentation",294 "posts_count": 3,295 "reply_count": 1,296 "highest_post_number": 3,297 "image_url": null,298 "created_at": "2025-01-20T12:20:38.861Z",299 "last_posted_at": "2025-01-21T08:44:57.139Z",300 "bumped": true,301 "bumped_at": "2025-01-21T08:44:57.139Z",302 "archetype": "regular",303 "unseen": false,304 "pinned": false,305 "unpinned": null,306 "visible": true,307 "closed": false,308 "archived": false,309 "bookmarked": null,310 "liked": null,311 "tags_descriptions": {},312 "like_count": 1,313 "views": 191,314 "category_id": 5,315 "featured_link": null,316 "has_accepted_answer": false,317 "posters": [318 {319 "extras": "latest",320 "description": "Original Poster, Most Recent Poster",321 "user": {322 "id": 81941,323 "username": "MUSTAFA_CAGRI_CIVICI",324 "name": "MUSTAFA ÇAĞRI ÇİVİCİ",325 "avatar_template": "/user_avatar/discuss.pytorch.org/mustafa_cagri_civici/{size}/74964_2.png",326 "trust_level": 1327 }328 },329 {330 "extras": null,331 "description": "Frequent Poster",332 "user": {333 "id": 18088,334 "username": "KFrank",335 "name": "K. Frank",336 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",337 "trust_level": 2338 }339 }340 ]341 },342 {343 "fancy_title": "Getting predictions only for the first channel in UNet architecture",344 "id": 215832,345 "title": "Getting predictions only for the first channel in UNet architecture",346 "slug": "getting-predictions-only-for-the-first-channel-in-unet-architecture",347 "posts_count": 3,348 "reply_count": 1,349 "highest_post_number": 3,350 "image_url": null,351 "created_at": "2025-01-24T17:38:26.402Z",352 "last_posted_at": "2025-01-25T04:20:04.373Z",353 "bumped": true,354 "bumped_at": "2025-01-25T04:20:04.373Z",355 "archetype": "regular",356 "unseen": false,357 "pinned": false,358 "unpinned": null,359 "visible": true,360 "closed": false,361 "archived": false,362 "bookmarked": null,363 "liked": null,364 "tags_descriptions": {},365 "like_count": 0,366 "views": 68,367 "category_id": 5,368 "featured_link": null,369 "has_accepted_answer": false,370 "posters": [371 {372 "extras": "latest",373 "description": "Original Poster, Most Recent Poster",374 "user": {375 "id": 82180,376 "username": "Amit_Sur",377 "name": "Amit Sur",378 "avatar_template": "/user_avatar/discuss.pytorch.org/amit_sur/{size}/75195_2.png",379 "trust_level": 1380 }381 },382 {383 "extras": null,384 "description": "Frequent Poster",385 "user": {386 "id": 3534,387 "username": "ptrblck",388 "name": "",389 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",390 "admin": true,391 "moderator": true,392 "trust_level": 2393 }394 }395 ]396 },397 {398 "fancy_title": "Efficient single object detector",399 "id": 214164,400 "title": "Efficient single object detector",401 "slug": "efficient-single-object-detector",402 "posts_count": 6,403 "reply_count": 3,404 "highest_post_number": 6,405 "image_url": null,406 "created_at": "2024-12-12T18:33:33.575Z",407 "last_posted_at": "2024-12-18T17:00:44.088Z",408 "bumped": true,409 "bumped_at": "2024-12-18T17:00:44.088Z",410 "archetype": "regular",411 "unseen": false,412 "pinned": false,413 "unpinned": null,414 "visible": true,415 "closed": false,416 "archived": false,417 "bookmarked": null,418 "liked": null,419 "tags_descriptions": {},420 "like_count": 2,421 "views": 502,422 "category_id": 5,423 "featured_link": null,424 "has_accepted_answer": false,425 "posters": [426 {427 "extras": null,428 "description": "Original Poster",429 "user": {430 "id": 78029,431 "username": "AviZ",432 "name": "",433 "avatar_template": "/letter_avatar_proxy/v4/letter/a/e0b2c6/{size}.png",434 "trust_level": 1435 }436 },437 {438 "extras": "latest",439 "description": "Most Recent Poster",440 "user": {441 "id": 81089,442 "username": "Aknw_Fen",443 "name": "Aknw Fen",444 "avatar_template": "/user_avatar/discuss.pytorch.org/aknw_fen/{size}/74156_2.png",445 "trust_level": 2446 }447 }448 ]449 }450 ],451 "tags_descriptions": {},452 "fancy_title": "How to reverse shuffle process by pytorch",453 "id": 125432,454 "title": "How to reverse shuffle process by pytorch",455 "posts_count": 3,456 "created_at": "2021-06-30T07:03:55.585Z",457 "views": 859,458 "reply_count": 2,459 "like_count": 0,460 "last_posted_at": "2021-06-30T07:13:35.560Z",461 "visible": true,462 "closed": false,463 "archived": false,464 "has_summary": false,465 "archetype": "regular",466 "slug": "how-to-reverse-shuffle-process-by-pytorch",467 "category_id": 5,468 "word_count": 191,469 "deleted_at": null,470 "user_id": 46751,471 "featured_link": null,472 "pinned_globally": false,473 "pinned_at": null,474 "pinned_until": null,475 "image_url": null,476 "slow_mode_seconds": 0,477 "draft": null,478 "draft_key": "topic_125432",479 "draft_sequence": null,480 "unpinned": null,481 "pinned": false,482 "current_post_number": 1,483 "highest_post_number": 4,484 "deleted_by": null,485 "actions_summary": [486 {487 "id": 4,488 "count": 0,489 "hidden": false,490 "can_act": false491 },492 {493 "id": 8,494 "count": 0,495 "hidden": false,496 "can_act": false497 },498 {499 "id": 10,500 "count": 0,501 "hidden": false,502 "can_act": false503 },504 {505 "id": 7,506 "count": 0,507 "hidden": false,508 "can_act": false509 }510 ],511 "chunk_size": 20,512 "bookmarked": false,513 "topic_timer": null,514 "message_bus_last_id": 0,515 "participant_count": 2,516 "show_read_indicator": false,517 "thumbnails": null,518 "slow_mode_enabled_until": null,519 "can_vote": false,520 "vote_count": 0,521 "user_voted": false,522 "discourse_zendesk_plugin_zendesk_id": null,523 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",524 "details": {525 "can_edit": false,526 "notification_level": 1,527 "participants": [528 {529 "id": 46751,530 "username": "yzleroy",531 "name": "Leroy Lin",532 "avatar_template": "/user_avatar/discuss.pytorch.org/yzleroy/{size}/39811_2.png",533 "post_count": 2,534 "primary_group_name": null,535 "flair_name": null,536 "flair_url": null,537 "flair_color": null,538 "flair_bg_color": null,539 "flair_group_id": null,540 "trust_level": 1541 },542 {543 "id": 3534,544 "username": "ptrblck",545 "name": "",546 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",547 "post_count": 1,548 "primary_group_name": null,549 "flair_name": null,550 "flair_url": null,551 "flair_color": null,552 "flair_bg_color": null,553 "flair_group_id": null,554 "admin": true,555 "moderator": true,556 "trust_level": 2557 }558 ],559 "created_by": {560 "id": 46751,561 "username": "yzleroy",562 "name": "Leroy Lin",563 "avatar_template": "/user_avatar/discuss.pytorch.org/yzleroy/{size}/39811_2.png"564 },565 "last_poster": {566 "id": 46751,567 "username": "yzleroy",568 "name": "Leroy Lin",569 "avatar_template": "/user_avatar/discuss.pytorch.org/yzleroy/{size}/39811_2.png"570 }571 },572 "bookmarks": []573 },574 {575 "post_stream": {576 "posts": [577 {578 "id": 293020,579 "name": "Thoger Bundsgaard",580 "username": "thoger",581 "avatar_template": "/letter_avatar_proxy/v4/letter/t/e19adc/{size}.png",582 "created_at": "2021-06-29T15:11:10.422Z",583 "cooked": "<p>Hi</p>\n<p>I love the amazing Pytorch docs, but one issue we ran into is that they seem a bit sparse on the topic of how loss functions, specifically Cross Entropy, is <strong>implemented</strong> (i.e. mathematically and/or the raw code).</p>\n<p>Does someone have an insight into where I would go about finding that?</p>\n<p>Context: We are implementing a custom loss function that can incorporate class weights in “distribution-based classes” (not quite sure what the specific term is).</p>\n<p>(Sorry if this is a out-of-scope question – feel free to refer me to where a question like this would be more appropriate)</p>",584 "post_number": 1,585 "post_type": 1,586 "posts_count": 3,587 "updated_at": "2021-06-29T15:11:10.422Z",588 "reply_count": 0,589 "reply_to_post_number": null,590 "quote_count": 0,591 "incoming_link_count": 37,592 "reads": 6,593 "readers_count": 5,594 "score": 186.2,595 "yours": false,596 "topic_id": 125375,597 "topic_slug": "where-to-find-implementation-of-cross-entropy-loss-function",598 "display_username": "Thoger Bundsgaard",599 "primary_group_name": null,600 "flair_name": null,601 "flair_url": null,602 "flair_bg_color": null,603 "flair_color": null,604 "flair_group_id": null,605 "badges_granted": [],606 "version": 1,607 "can_edit": false,608 "can_delete": false,609 "can_recover": false,610 "can_see_hidden_post": false,611 "can_wiki": false,612 "read": true,613 "user_title": null,614 "bookmarked": false,615 "actions_summary": [],616 "moderator": false,617 "admin": false,618 "staff": false,619 "user_id": 46736,620 "hidden": false,621 "trust_level": 1,622 "deleted_at": null,623 "user_deleted": false,624 "edit_reason": null,625 "can_view_edit_history": true,626 "wiki": false,627 "post_url": "/t/where-to-find-implementation-of-cross-entropy-loss-function/125375/1",628 "can_accept_answer": false,629 "can_unaccept_answer": false,630 "accepted_answer": false,631 "topic_accepted_answer": true,632 "can_vote": false633 },634 {635 "id": 293185,636 "name": "",637 "username": "ptrblck",638 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",639 "created_at": "2021-06-30T06:13:18.951Z",640 "cooked": "<p>A manual (and slow) implementation can be found <a href=\"https://discuss.pytorch.org/t/cross-entropy-loss-clarification/103830/2\">here</a> and the CPU implementation calls into <a href=\"https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L458-L471\"><code>cross_entropy_loss</code></a> and then into <a href=\"https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L27-L28\"><code>nll_loss</code></a>.</p>",641 "post_number": 2,642 "post_type": 1,643 "posts_count": 3,644 "updated_at": "2021-06-30T07:06:14.674Z",645 "reply_count": 1,646 "reply_to_post_number": null,647 "quote_count": 0,648 "incoming_link_count": 1,649 "reads": 4,650 "readers_count": 3,651 "score": 25.8,652 "yours": false,653 "topic_id": 125375,654 "topic_slug": "where-to-find-implementation-of-cross-entropy-loss-function",655 "display_username": "",656 "primary_group_name": null,657 "flair_name": null,658 "flair_url": null,659 "flair_bg_color": null,660 "flair_color": null,661 "flair_group_id": null,662 "badges_granted": [],663 "version": 1,664 "can_edit": false,665 "can_delete": false,666 "can_recover": false,667 "can_see_hidden_post": false,668 "can_wiki": false,669 "link_counts": [670 {671 "url": "https://discuss.pytorch.org/t/cross-entropy-loss-clarification/103830/2",672 "internal": true,673 "reflection": false,674 "title": "Cross entropy loss clarification",675 "clicks": 8676 },677 {678 "url": "https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L458-L471",679 "internal": false,680 "reflection": false,681 "title": "pytorch/LossNLL.cpp at 99b641169b4086225479ddad7a8c027c1faf8f19 · pytorch/pytorch · GitHub",682 "clicks": 7683 },684 {685 "url": "https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L27-L28",686 "internal": false,687 "reflection": false,688 "title": "pytorch/LossNLL.cpp at 99b641169b4086225479ddad7a8c027c1faf8f19 · pytorch/pytorch · GitHub",689 "clicks": 2690 }691 ],692 "read": true,693 "user_title": "",694 "bookmarked": false,695 "actions_summary": [696 {697 "id": 2,698 "count": 1699 }700 ],701 "moderator": true,702 "admin": true,703 "staff": true,704 "user_id": 3534,705 "hidden": false,706 "trust_level": 2,707 "deleted_at": null,708 "user_deleted": false,709 "edit_reason": null,710 "can_view_edit_history": true,711 "wiki": false,712 "post_url": "/t/where-to-find-implementation-of-cross-entropy-loss-function/125375/2",713 "can_accept_answer": false,714 "can_unaccept_answer": false,715 "accepted_answer": true,716 "topic_accepted_answer": true717 },718 {719 "id": 293198,720 "name": "Thoger Bundsgaard",721 "username": "thoger",722 "avatar_template": "/letter_avatar_proxy/v4/letter/t/e19adc/{size}.png",723 "created_at": "2021-06-30T07:05:26.483Z",724 "cooked": "<p>Thank you, very helpful! Highly appreciated! If I had been a bit more lucky in my search, I should of course have found your reference on my own, but alas.</p>\n<p>(Out of topic-context: And just now that I have the chance, also thank you so much for not just this answer but the tons of other answers you provide in here that prove hyper-helpful on a daily basis)</p>",725 "post_number": 3,726 "post_type": 1,727 "posts_count": 3,728 "updated_at": "2021-06-30T07:05:26.483Z",729 "reply_count": 0,730 "reply_to_post_number": 2,731 "quote_count": 0,732 "incoming_link_count": 1,733 "reads": 4,734 "readers_count": 3,735 "score": 50.8,736 "yours": false,737 "topic_id": 125375,738 "topic_slug": "where-to-find-implementation-of-cross-entropy-loss-function",739 "display_username": "Thoger Bundsgaard",740 "primary_group_name": null,741 "flair_name": null,742 "flair_url": null,743 "flair_bg_color": null,744 "flair_color": null,745 "flair_group_id": null,746 "badges_granted": [],747 "version": 1,748 "can_edit": false,749 "can_delete": false,750 "can_recover": false,751 "can_see_hidden_post": false,752 "can_wiki": false,753 "read": true,754 "user_title": null,755 "reply_to_user": {756 "id": 3534,757 "username": "ptrblck",758 "name": "",759 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"760 },761 "bookmarked": false,762 "actions_summary": [763 {764 "id": 2,765 "count": 1766 }767 ],768 "moderator": false,769 "admin": false,770 "staff": false,771 "user_id": 46736,772 "hidden": false,773 "trust_level": 1,774 "deleted_at": null,775 "user_deleted": false,776 "edit_reason": null,777 "can_view_edit_history": true,778 "wiki": false,779 "post_url": "/t/where-to-find-implementation-of-cross-entropy-loss-function/125375/3",780 "can_accept_answer": false,781 "can_unaccept_answer": false,782 "accepted_answer": false,783 "topic_accepted_answer": true784 }785 ],786 "stream": [787 293020,788 293185,789 293198790 ]791 },792 "timeline_lookup": [793 [794 1,795 1579796 ]797 ],798 "suggested_topics": [799 {800 "fancy_title": "Can Multi-Channel Outputs in U-Net Represent Multiple Time Steps for Rainfall Prediction?",801 "id": 217366,802 "title": "Can Multi-Channel Outputs in U-Net Represent Multiple Time Steps for Rainfall Prediction?",803 "slug": "can-multi-channel-outputs-in-u-net-represent-multiple-time-steps-for-rainfall-prediction",804 "posts_count": 5,805 "reply_count": 3,806 "highest_post_number": 5,807 "image_url": null,808 "created_at": "2025-03-03T03:50:16.496Z",809 "last_posted_at": "2025-03-04T18:44:46.241Z",810 "bumped": true,811 "bumped_at": "2025-03-04T18:44:46.241Z",812 "archetype": "regular",813 "unseen": false,814 "pinned": false,815 "unpinned": null,816 "visible": true,817 "closed": false,818 "archived": false,819 "bookmarked": null,820 "liked": null,821 "tags_descriptions": {},822 "like_count": 4,823 "views": 100,824 "category_id": 5,825 "featured_link": null,826 "has_accepted_answer": true,827 "posters": [828 {829 "extras": null,830 "description": "Original Poster",831 "user": {832 "id": 82912,833 "username": "ILoveSorasakiHina",834 "name": "ILoveTakanashiHoshino",835 "avatar_template": "/user_avatar/discuss.pytorch.org/ilovesorasakihina/{size}/75858_2.png",836 "trust_level": 1837 }838 },839 {840 "extras": "latest",841 "description": "Most Recent Poster, Accepted Answer",842 "user": {843 "id": 64488,844 "username": "Naming-isDifficult",845 "name": "",846 "avatar_template": "/user_avatar/discuss.pytorch.org/naming-isdifficult/{size}/58644_2.png",847 "trust_level": 2848 }849 },850 {851 "extras": null,852 "description": "Frequent Poster",853 "user": {854 "id": 18088,855 "username": "KFrank",856 "name": "K. Frank",857 "avatar_template": "/letter_avatar_proxy/v4/letter/k/ecb155/{size}.png",858 "trust_level": 2859 }860 }861 ]862 },863 {864 "fancy_title": "Is it safe to assume labels will be the same for two different directories using datasets.ImageFolder",865 "id": 214336,866 "title": "Is it safe to assume labels will be the same for two different directories using datasets.ImageFolder",867 "slug": "is-it-safe-to-assume-labels-will-be-the-same-for-two-different-directories-using-datasets-imagefolder",868 "posts_count": 3,869 "reply_count": 1,870 "highest_post_number": 3,871 "image_url": null,872 "created_at": "2024-12-17T21:53:56.157Z",873 "last_posted_at": "2024-12-19T02:42:54.893Z",874 "bumped": true,875 "bumped_at": "2024-12-19T02:42:54.893Z",876 "archetype": "regular",877 "unseen": false,878 "pinned": false,879 "unpinned": null,880 "visible": true,881 "closed": false,882 "archived": false,883 "bookmarked": null,884 "liked": null,885 "tags_descriptions": {},886 "like_count": 0,887 "views": 45,888 "category_id": 5,889 "featured_link": null,890 "has_accepted_answer": true,891 "posters": [892 {893 "extras": "latest",894 "description": "Original Poster, Most Recent Poster",895 "user": {896 "id": 81556,897 "username": "abdul_alotaibi",898 "name": "Abdulrahman Alotaibi",899 "avatar_template": "/user_avatar/discuss.pytorch.org/abdul_alotaibi/{size}/74575_2.png",900 "trust_level": 0901 }902 },903 {904 "extras": null,905 "description": "Frequent Poster, Accepted Answer",906 "user": {907 "id": 3534,908 "username": "ptrblck",909 "name": "",910 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",911 "admin": true,912 "moderator": true,913 "trust_level": 2914 }915 }916 ]917 },918 {919 "fancy_title": "Gradient-like buffers for lines in images",920 "id": 213543,921 "title": "Gradient-like buffers for lines in images",922 "slug": "gradient-like-buffers-for-lines-in-images",923 "posts_count": 1,924 "reply_count": 0,925 "highest_post_number": 1,926 "image_url": "https://discuss.pytorch.org/uploads/default/original/3X/b/c/bcc39b604f84752d479b43cbfa41683ef50dd1c4.png",927 "created_at": "2024-11-27T16:07:40.656Z",928 "last_posted_at": "2024-11-27T16:07:40.705Z",929 "bumped": true,930 "bumped_at": "2024-11-27T16:27:52.181Z",931 "archetype": "regular",932 "unseen": false,933 "pinned": false,934 "unpinned": null,935 "visible": true,936 "closed": false,937 "archived": false,938 "bookmarked": null,939 "liked": null,940 "tags_descriptions": {},941 "like_count": 0,942 "views": 84,943 "category_id": 5,944 "featured_link": null,945 "has_accepted_answer": false,946 "posters": [947 {948 "extras": "latest single",949 "description": "Original Poster, Most Recent Poster",950 "user": {951 "id": 67179,952 "username": "ayoubft",953 "name": "",954 "avatar_template": "/user_avatar/discuss.pytorch.org/ayoubft/{size}/61489_2.png",955 "trust_level": 1956 }957 }958 ]959 },960 {961 "fancy_title": "Swin Based Backbone for FasterRCNN",962 "id": 212736,963 "title": "Swin Based Backbone for FasterRCNN",964 "slug": "swin-based-backbone-for-fasterrcnn",965 "posts_count": 1,966 "reply_count": 0,967 "highest_post_number": 1,968 "image_url": null,969 "created_at": "2024-11-09T12:29:52.715Z",970 "last_posted_at": "2024-11-09T12:29:52.773Z",971 "bumped": true,972 "bumped_at": "2024-11-09T12:29:52.773Z",973 "archetype": "regular",974 "unseen": false,975 "pinned": false,976 "unpinned": null,977 "visible": true,978 "closed": false,979 "archived": false,980 "bookmarked": null,981 "liked": null,982 "tags_descriptions": {},983 "like_count": 0,984 "views": 137,985 "category_id": 5,986 "featured_link": null,987 "has_accepted_answer": false,988 "posters": [989 {990 "extras": "latest single",991 "description": "Original Poster, Most Recent Poster",992 "user": {993 "id": 80786,994 "username": "berk",995 "name": "",996 "avatar_template": "/user_avatar/discuss.pytorch.org/berk/{size}/73881_2.png",997 "trust_level": 1998 }999 }1000 ]1001 },1002 {1003 "fancy_title": "Integrating kFold cross validation",1004 "id": 218039,1005 "title": "Integrating kFold cross validation",1006 "slug": "integrating-kfold-cross-validation",1007 "posts_count": 1,1008 "reply_count": 0,1009 "highest_post_number": 1,1010 "image_url": null,1011 "created_at": "2025-03-19T21:31:30.408Z",1012 "last_posted_at": "2025-03-19T21:31:30.450Z",1013 "bumped": true,1014 "bumped_at": "2025-03-19T21:31:30.450Z",1015 "archetype": "regular",1016 "unseen": false,1017 "pinned": false,1018 "unpinned": null,1019 "visible": true,1020 "closed": false,1021 "archived": false,1022 "bookmarked": null,1023 "liked": null,1024 "tags_descriptions": {},1025 "like_count": 0,1026 "views": 31,1027 "category_id": 5,1028 "featured_link": null,1029 "has_accepted_answer": false,1030 "posters": [1031 {1032 "extras": "latest single",1033 "description": "Original Poster, Most Recent Poster",1034 "user": {1035 "id": 68222,1036 "username": "amy2",1037 "name": "amy",1038 "avatar_template": "/user_avatar/discuss.pytorch.org/amy2/{size}/62675_2.png",1039 "trust_level": 11040 }1041 }1042 ]1043 }1044 ],1045 "tags_descriptions": {},1046 "fancy_title": "Where to find implementation of Cross Entropy loss function",1047 "id": 125375,1048 "title": "Where to find implementation of Cross Entropy loss function",1049 "posts_count": 3,1050 "created_at": "2021-06-29T15:11:10.315Z",1051 "views": 419,1052 "reply_count": 1,1053 "like_count": 2,1054 "last_posted_at": "2021-06-30T07:05:26.483Z",1055 "visible": true,1056 "closed": false,1057 "archived": false,1058 "has_summary": false,1059 "archetype": "regular",1060 "slug": "where-to-find-implementation-of-cross-entropy-loss-function",1061 "category_id": 5,1062 "word_count": 235,1063 "deleted_at": null,1064 "user_id": 46736,1065 "featured_link": null,1066 "pinned_globally": false,1067 "pinned_at": null,1068 "pinned_until": null,1069 "image_url": null,1070 "slow_mode_seconds": 0,1071 "draft": null,1072 "draft_key": "topic_125375",1073 "draft_sequence": null,1074 "unpinned": null,1075 "pinned": false,1076 "current_post_number": 1,1077 "highest_post_number": 3,1078 "deleted_by": null,1079 "actions_summary": [1080 {1081 "id": 4,1082 "count": 0,1083 "hidden": false,1084 "can_act": false1085 },1086 {1087 "id": 8,1088 "count": 0,1089 "hidden": false,1090 "can_act": false1091 },1092 {1093 "id": 10,1094 "count": 0,1095 "hidden": false,1096 "can_act": false1097 },1098 {1099 "id": 7,1100 "count": 0,1101 "hidden": false,1102 "can_act": false1103 }1104 ],1105 "chunk_size": 20,1106 "bookmarked": false,1107 "topic_timer": null,1108 "message_bus_last_id": 0,1109 "participant_count": 2,1110 "show_read_indicator": false,1111 "thumbnails": null,1112 "slow_mode_enabled_until": null,1113 "accepted_answer": {1114 "post_number": 2,1115 "username": "ptrblck",1116 "name": "",1117 "excerpt": "A manual (and slow) implementation can be found <a href=\"https://discuss.pytorch.org/t/cross-entropy-loss-clarification/103830/2\">here</a> and the CPU implementation calls into <a href=\"https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L458-L471\">cross_entropy_loss</a> and then into <a href=\"https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L27-L28\">nll_loss</a>."1118 },1119 "can_vote": false,1120 "vote_count": 0,1121 "user_voted": false,1122 "discourse_zendesk_plugin_zendesk_id": null,1123 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",1124 "details": {1125 "can_edit": false,1126 "notification_level": 1,1127 "participants": [1128 {1129 "id": 46736,1130 "username": "thoger",1131 "name": "Thoger Bundsgaard",1132 "avatar_template": "/letter_avatar_proxy/v4/letter/t/e19adc/{size}.png",1133 "post_count": 2,1134 "primary_group_name": null,1135 "flair_name": null,1136 "flair_url": null,1137 "flair_color": null,1138 "flair_bg_color": null,1139 "flair_group_id": null,1140 "trust_level": 11141 },1142 {1143 "id": 3534,1144 "username": "ptrblck",1145 "name": "",1146 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1147 "post_count": 1,1148 "primary_group_name": null,1149 "flair_name": null,1150 "flair_url": null,1151 "flair_color": null,1152 "flair_bg_color": null,1153 "flair_group_id": null,1154 "admin": true,1155 "moderator": true,1156 "trust_level": 21157 }1158 ],1159 "created_by": {1160 "id": 46736,1161 "username": "thoger",1162 "name": "Thoger Bundsgaard",1163 "avatar_template": "/letter_avatar_proxy/v4/letter/t/e19adc/{size}.png"1164 },1165 "last_poster": {1166 "id": 46736,1167 "username": "thoger",1168 "name": "Thoger Bundsgaard",1169 "avatar_template": "/letter_avatar_proxy/v4/letter/t/e19adc/{size}.png"1170 },1171 "links": [1172 {1173 "url": "https://discuss.pytorch.org/t/cross-entropy-loss-clarification/103830/2",1174 "title": "Cross entropy loss clarification",1175 "internal": true,1176 "attachment": false,1177 "reflection": false,1178 "clicks": 8,1179 "user_id": 3534,1180 "domain": "discuss.pytorch.org",1181 "root_domain": "pytorch.org"1182 },1183 {1184 "url": "https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L458-L471",1185 "title": "pytorch/LossNLL.cpp at 99b641169b4086225479ddad7a8c027c1faf8f19 · pytorch/pytorch · GitHub",1186 "internal": false,1187 "attachment": false,1188 "reflection": false,1189 "clicks": 7,1190 "user_id": 3534,1191 "domain": "github.com",1192 "root_domain": "github.com"1193 },1194 {1195 "url": "https://github.com/pytorch/pytorch/blob/99b641169b4086225479ddad7a8c027c1faf8f19/aten/src/ATen/native/LossNLL.cpp#L27-L28",1196 "title": "pytorch/LossNLL.cpp at 99b641169b4086225479ddad7a8c027c1faf8f19 · pytorch/pytorch · GitHub",1197 "internal": false,1198 "attachment": false,1199 "reflection": false,1200 "clicks": 2,