Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 253212,7 "name": "jerly-hjhzou",8 "username": "jerly-hjzhou",9 "avatar_template": "/user_avatar/discuss.pytorch.org/jerly-hjzhou/{size}/32653_2.png",10 "created_at": "2020-12-23T14:12:28.011Z",11 "cooked": "<p>The problem I met is that how can I get a binary format like 101101010010(assume it’s IEEE754 format, although it’s not) from its corresponding float type value like 0.365(this does not correspond with the binary format before)</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 5,15 "updated_at": "2020-12-23T14:21:27.090Z",16 "reply_count": 1,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 4273,20 "reads": 56,21 "readers_count": 55,22 "score": 21331.2,23 "yours": false,24 "topic_id": 106979,25 "topic_slug": "how-can-i-get-the-binary-format-of-a-float-type-tensor",26 "display_username": "jerly-hjhzou",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": 3,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 {45 "id": 2,46 "count": 147 }48 ],49 "moderator": false,50 "admin": false,51 "staff": false,52 "user_id": 40361,53 "hidden": false,54 "trust_level": 1,55 "deleted_at": null,56 "user_deleted": false,57 "edit_reason": null,58 "can_view_edit_history": true,59 "wiki": false,60 "post_url": "/t/how-can-i-get-the-binary-format-of-a-float-type-tensor/106979/1",61 "can_accept_answer": false,62 "can_unaccept_answer": false,63 "accepted_answer": false,64 "topic_accepted_answer": null,65 "can_vote": false66 },67 {68 "id": 255053,69 "name": "",70 "username": "ptrblck",71 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",72 "created_at": "2021-01-05T08:38:57.110Z",73 "cooked": "<p>You could transform the tensor to a numpy array and use <code>np.binary_repr</code> on it.</p>",74 "post_number": 2,75 "post_type": 1,76 "posts_count": 5,77 "updated_at": "2021-01-05T08:38:57.110Z",78 "reply_count": 0,79 "reply_to_post_number": null,80 "quote_count": 0,81 "incoming_link_count": 87,82 "reads": 54,83 "readers_count": 53,84 "score": 460.8,85 "yours": false,86 "topic_id": 106979,87 "topic_slug": "how-can-i-get-the-binary-format-of-a-float-type-tensor",88 "display_username": "",89 "primary_group_name": null,90 "flair_name": null,91 "flair_url": null,92 "flair_bg_color": null,93 "flair_color": null,94 "flair_group_id": null,95 "badges_granted": [],96 "version": 1,97 "can_edit": false,98 "can_delete": false,99 "can_recover": false,100 "can_see_hidden_post": false,101 "can_wiki": false,102 "read": true,103 "user_title": "",104 "bookmarked": false,105 "actions_summary": [106 {107 "id": 2,108 "count": 1109 }110 ],111 "moderator": true,112 "admin": true,113 "staff": true,114 "user_id": 3534,115 "hidden": false,116 "trust_level": 2,117 "deleted_at": null,118 "user_deleted": false,119 "edit_reason": null,120 "can_view_edit_history": true,121 "wiki": false,122 "post_url": "/t/how-can-i-get-the-binary-format-of-a-float-type-tensor/106979/2",123 "can_accept_answer": false,124 "can_unaccept_answer": false,125 "accepted_answer": false,126 "topic_accepted_answer": null127 },128 {129 "id": 339695,130 "name": "Stas Bekman",131 "username": "stas",132 "avatar_template": "/user_avatar/discuss.pytorch.org/stas/{size}/8409_2.png",133 "created_at": "2022-04-04T17:48:05.838Z",134 "cooked": "<p><code>np.binary_repr</code> only works with integers and not floats. <a href=\"https://numpy.org/doc/stable/reference/generated/numpy.binary_repr.html\" class=\"inline-onebox\" rel=\"noopener nofollow ugc\">numpy.binary_repr — NumPy v1.22 Manual</a></p>",135 "post_number": 3,136 "post_type": 1,137 "posts_count": 5,138 "updated_at": "2022-04-04T17:48:05.838Z",139 "reply_count": 0,140 "reply_to_post_number": null,141 "quote_count": 0,142 "incoming_link_count": 78,143 "reads": 52,144 "readers_count": 51,145 "score": 400.4,146 "yours": false,147 "topic_id": 106979,148 "topic_slug": "how-can-i-get-the-binary-format-of-a-float-type-tensor",149 "display_username": "Stas Bekman",150 "primary_group_name": null,151 "flair_name": null,152 "flair_url": null,153 "flair_bg_color": null,154 "flair_color": null,155 "flair_group_id": null,156 "badges_granted": [],157 "version": 1,158 "can_edit": false,159 "can_delete": false,160 "can_recover": false,161 "can_see_hidden_post": false,162 "can_wiki": false,163 "link_counts": [164 {165 "url": "https://numpy.org/doc/stable/reference/generated/numpy.binary_repr.html",166 "internal": false,167 "reflection": false,168 "title": "numpy.binary_repr — NumPy v1.22 Manual",169 "clicks": 247170 }171 ],172 "read": true,173 "user_title": null,174 "bookmarked": false,175 "actions_summary": [],176 "moderator": false,177 "admin": false,178 "staff": false,179 "user_id": 10025,180 "hidden": false,181 "trust_level": 2,182 "deleted_at": null,183 "user_deleted": false,184 "edit_reason": null,185 "can_view_edit_history": true,186 "wiki": false,187 "post_url": "/t/how-can-i-get-the-binary-format-of-a-float-type-tensor/106979/3",188 "can_accept_answer": false,189 "can_unaccept_answer": false,190 "accepted_answer": false,191 "topic_accepted_answer": null192 },193 {194 "id": 359870,195 "name": "",196 "username": "kocchop",197 "avatar_template": "/letter_avatar_proxy/v4/letter/k/f9ae1b/{size}.png",198 "created_at": "2022-08-04T01:43:42.168Z",199 "cooked": "<p>Just following up if any new ideas came forward to get the binary/hex format out of a torch float tensor.</p>\n<p>I’ve found one by on <a href=\"https://github.com/KarenUllrich/pytorch-binary-converter\" rel=\"noopener nofollow ugc\">Github</a> but it seems like manually converting the data to get the binary. Just wondering if there is any better way. For example, if I can directly read the binary from the memory address or something.</p>\n<p>Any response would be much appreciated. Thanks in advance!</p>",200 "post_number": 4,201 "post_type": 1,202 "posts_count": 5,203 "updated_at": "2022-08-04T01:47:22.580Z",204 "reply_count": 0,205 "reply_to_post_number": null,206 "quote_count": 0,207 "incoming_link_count": 46,208 "reads": 47,209 "readers_count": 46,210 "score": 264.4,211 "yours": false,212 "topic_id": 106979,213 "topic_slug": "how-can-i-get-the-binary-format-of-a-float-type-tensor",214 "display_username": "",215 "primary_group_name": null,216 "flair_name": null,217 "flair_url": null,218 "flair_bg_color": null,219 "flair_color": null,220 "flair_group_id": null,221 "badges_granted": [],222 "version": 2,223 "can_edit": false,224 "can_delete": false,225 "can_recover": false,226 "can_see_hidden_post": false,227 "can_wiki": false,228 "link_counts": [229 {230 "url": "https://github.com/KarenUllrich/pytorch-binary-converter",231 "internal": false,232 "reflection": false,233 "title": "GitHub - KarenUllrich/pytorch-binary-converter: Turning float tensors to binary tensors according to IEEE-754 standard.",234 "clicks": 247235 }236 ],237 "read": true,238 "user_title": "",239 "bookmarked": false,240 "actions_summary": [241 {242 "id": 2,243 "count": 2244 }245 ],246 "moderator": false,247 "admin": false,248 "staff": false,249 "user_id": 57523,250 "hidden": false,251 "trust_level": 1,252 "deleted_at": null,253 "user_deleted": false,254 "edit_reason": null,255 "can_view_edit_history": true,256 "wiki": false,257 "post_url": "/t/how-can-i-get-the-binary-format-of-a-float-type-tensor/106979/4",258 "can_accept_answer": false,259 "can_unaccept_answer": false,260 "accepted_answer": false,261 "topic_accepted_answer": null262 },263 {264 "id": 454247,265 "name": "Jay Thakur",266 "username": "jthakurH",267 "avatar_template": "/user_avatar/discuss.pytorch.org/jthakurh/{size}/72699_2.png",268 "created_at": "2024-09-12T10:48:37.107Z",269 "cooked": "<aside class=\"quote no-group\" data-username=\"jerly-hjzhou\" data-post=\"1\" data-topic=\"106979\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/jerly-hjzhou/48/32653_2.png\" class=\"avatar\"> jerly-hjzhou:</div>\n<blockquote>\n<p>0.365</p>\n</blockquote>\n</aside>\n<p>view tensor in int equivalent.<br>\nfor example torch.bfloat16–> torch.int16<br>\nresult = torch.tensor([100], torch.bfloat16)<br>\nhex(result.view(torch.int16).item())</p>",270 "post_number": 5,271 "post_type": 1,272 "posts_count": 5,273 "updated_at": "2024-09-12T10:48:37.107Z",274 "reply_count": 0,275 "reply_to_post_number": null,276 "quote_count": 1,277 "incoming_link_count": 11,278 "reads": 17,279 "readers_count": 16,280 "score": 58.4,281 "yours": false,282 "topic_id": 106979,283 "topic_slug": "how-can-i-get-the-binary-format-of-a-float-type-tensor",284 "display_username": "Jay Thakur",285 "primary_group_name": null,286 "flair_name": null,287 "flair_url": null,288 "flair_bg_color": null,289 "flair_color": null,290 "flair_group_id": null,291 "badges_granted": [],292 "version": 1,293 "can_edit": false,294 "can_delete": false,295 "can_recover": false,296 "can_see_hidden_post": false,297 "can_wiki": false,298 "read": true,299 "user_title": null,300 "bookmarked": false,301 "actions_summary": [],302 "moderator": false,303 "admin": false,304 "staff": false,305 "user_id": 78854,306 "hidden": false,307 "trust_level": 1,308 "deleted_at": null,309 "user_deleted": false,310 "edit_reason": null,311 "can_view_edit_history": true,312 "wiki": false,313 "post_url": "/t/how-can-i-get-the-binary-format-of-a-float-type-tensor/106979/5",314 "can_accept_answer": false,315 "can_unaccept_answer": false,316 "accepted_answer": false,317 "topic_accepted_answer": null318 }319 ],320 "stream": [321 253212,322 255053,323 339695,324 359870,325 454247326 ]327 },328 "timeline_lookup": [329 [330 1,331 1767332 ],333 [334 2,335 1754336 ],337 [338 3,339 1300340 ],341 [342 4,343 1179344 ],345 [346 5,347 408348 ]349 ],350 "suggested_topics": [351 {352 "fancy_title": "New AI TTS System with Emotion Control",353 "id": 215473,354 "title": "New AI TTS System with Emotion Control",355 "slug": "new-ai-tts-system-with-emotion-control",356 "posts_count": 1,357 "reply_count": 0,358 "highest_post_number": 1,359 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/1/b/1b5acf26473b4da5045b72b1251774ba7a160bf4_2_1024x482.png",360 "created_at": "2025-01-16T13:35:46.056Z",361 "last_posted_at": "2025-01-16T13:35:46.091Z",362 "bumped": true,363 "bumped_at": "2025-01-16T13:35:46.091Z",364 "archetype": "regular",365 "unseen": false,366 "pinned": false,367 "unpinned": null,368 "visible": true,369 "closed": false,370 "archived": false,371 "bookmarked": null,372 "liked": null,373 "tags_descriptions": {},374 "like_count": 0,375 "views": 214,376 "category_id": 1,377 "featured_link": null,378 "has_accepted_answer": false,379 "posters": [380 {381 "extras": "latest single",382 "description": "Original Poster, Most Recent Poster",383 "user": {384 "id": 82116,385 "username": "Saifs_AI",386 "name": "Saifs AI",387 "avatar_template": "/letter_avatar_proxy/v4/letter/s/3da27b/{size}.png",388 "trust_level": 0389 }390 }391 ]392 },393 {394 "fancy_title": "[Bug] Memory leak in C++ libtorch",395 "id": 214376,396 "title": "[Bug] Memory leak in C++ libtorch",397 "slug": "bug-memory-leak-in-c-libtorch",398 "posts_count": 4,399 "reply_count": 1,400 "highest_post_number": 4,401 "image_url": null,402 "created_at": "2024-12-18T23:19:15.780Z",403 "last_posted_at": "2024-12-19T09:06:49.848Z",404 "bumped": true,405 "bumped_at": "2024-12-19T09:06:49.848Z",406 "archetype": "regular",407 "unseen": false,408 "pinned": false,409 "unpinned": null,410 "visible": true,411 "closed": false,412 "archived": false,413 "bookmarked": null,414 "liked": null,415 "tags_descriptions": {},416 "like_count": 1,417 "views": 68,418 "category_id": 1,419 "featured_link": null,420 "has_accepted_answer": false,421 "posters": [422 {423 "extras": "latest",424 "description": "Original Poster, Most Recent Poster",425 "user": {426 "id": 52896,427 "username": "Theophile_Champion",428 "name": "Theophile Champion",429 "avatar_template": "/user_avatar/discuss.pytorch.org/theophile_champion/{size}/30397_2.png",430 "trust_level": 1431 }432 },433 {434 "extras": null,435 "description": "Frequent Poster",436 "user": {437 "id": 41396,438 "username": "soulitzer",439 "name": "",440 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",441 "trust_level": 2442 }443 }444 ]445 },446 {447 "fancy_title": "Tuning a network, subset of data, one non-frozen layer",448 "id": 218788,449 "title": "Tuning a network, subset of data, one non-frozen layer",450 "slug": "tuning-a-network-subset-of-data-one-non-frozen-layer",451 "posts_count": 1,452 "reply_count": 0,453 "highest_post_number": 1,454 "image_url": null,455 "created_at": "2025-04-07T05:54:35.100Z",456 "last_posted_at": "2025-04-07T05:54:35.140Z",457 "bumped": true,458 "bumped_at": "2025-04-07T05:54:35.140Z",459 "archetype": "regular",460 "unseen": false,461 "pinned": false,462 "unpinned": null,463 "visible": true,464 "closed": false,465 "archived": false,466 "bookmarked": null,467 "liked": null,468 "tags_descriptions": {},469 "like_count": 0,470 "views": 18,471 "category_id": 1,472 "featured_link": null,473 "has_accepted_answer": false,474 "posters": [475 {476 "extras": "latest single",477 "description": "Original Poster, Most Recent Poster",478 "user": {479 "id": 78333,480 "username": "emerth",481 "name": "",482 "avatar_template": "/user_avatar/discuss.pytorch.org/emerth/{size}/75379_2.png",483 "trust_level": 1484 }485 }486 ]487 },488 {489 "fancy_title": "Does `register_buffer` make a obj member or cls member?",490 "id": 220155,491 "title": "Does `register_buffer` make a obj member or cls member?",492 "slug": "does-register-buffer-make-a-obj-member-or-cls-member",493 "posts_count": 3,494 "reply_count": 1,495 "highest_post_number": 3,496 "image_url": null,497 "created_at": "2025-05-19T09:29:30.499Z",498 "last_posted_at": "2025-05-21T16:35:20.977Z",499 "bumped": true,500 "bumped_at": "2025-05-21T16:35:20.977Z",501 "archetype": "regular",502 "unseen": false,503 "pinned": false,504 "unpinned": null,505 "visible": true,506 "closed": false,507 "archived": false,508 "bookmarked": null,509 "liked": null,510 "tags_descriptions": {},511 "like_count": 0,512 "views": 56,513 "category_id": 1,514 "featured_link": null,515 "has_accepted_answer": true,516 "posters": [517 {518 "extras": "latest",519 "description": "Original Poster, Most Recent Poster",520 "user": {521 "id": 59649,522 "username": "evilroach",523 "name": "Evil Roach",524 "avatar_template": "/user_avatar/discuss.pytorch.org/evilroach/{size}/53515_2.png",525 "trust_level": 1526 }527 },528 {529 "extras": null,530 "description": "Frequent Poster, Accepted Answer",531 "user": {532 "id": 3534,533 "username": "ptrblck",534 "name": "",535 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",536 "admin": true,537 "moderator": true,538 "trust_level": 2539 }540 }541 ]542 },543 {544 "fancy_title": "Profiling what happens in thread",545 "id": 220919,546 "title": "Profiling what happens in thread",547 "slug": "profiling-what-happens-in-thread",548 "posts_count": 3,549 "reply_count": 0,550 "highest_post_number": 3,551 "image_url": "https://discuss.pytorch.org/uploads/default/optimized/3X/3/4/34b45504a210d31bebc9103a23a6383bf4e95724_2_1024x341.png",552 "created_at": "2025-06-19T13:19:33.147Z",553 "last_posted_at": "2025-06-23T08:27:42.581Z",554 "bumped": true,555 "bumped_at": "2025-06-23T08:27:42.581Z",556 "archetype": "regular",557 "unseen": false,558 "pinned": false,559 "unpinned": null,560 "visible": true,561 "closed": false,562 "archived": false,563 "bookmarked": null,564 "liked": null,565 "tags_descriptions": {},566 "like_count": 0,567 "views": 81,568 "category_id": 1,569 "featured_link": null,570 "has_accepted_answer": true,571 "posters": [572 {573 "extras": "latest single",574 "description": "Original Poster, Most Recent Poster, Accepted Answer",575 "user": {576 "id": 12347,577 "username": "Valentin_Thorey",578 "name": "Valentin Thorey",579 "avatar_template": "/user_avatar/discuss.pytorch.org/valentin_thorey/{size}/66795_2.png",580 "trust_level": 1581 }582 }583 ]584 }585 ],586 "tags_descriptions": {},587 "fancy_title": "How can I get the binary format of a float type tensor?",588 "id": 106979,589 "title": "How can I get the binary format of a float type tensor?",590 "posts_count": 5,591 "created_at": "2020-12-23T14:12:27.930Z",592 "views": 4507,593 "reply_count": 0,594 "like_count": 4,595 "last_posted_at": "2024-09-12T10:48:37.107Z",596 "visible": true,597 "closed": false,598 "archived": false,599 "has_summary": false,600 "archetype": "regular",601 "slug": "how-can-i-get-the-binary-format-of-a-float-type-tensor",602 "category_id": 1,603 "word_count": 188,604 "deleted_at": null,605 "user_id": 40361,606 "featured_link": null,607 "pinned_globally": false,608 "pinned_at": null,609 "pinned_until": null,610 "image_url": null,611 "slow_mode_seconds": 0,612 "draft": null,613 "draft_key": "topic_106979",614 "draft_sequence": null,615 "unpinned": null,616 "pinned": false,617 "current_post_number": 1,618 "highest_post_number": 5,619 "deleted_by": null,620 "actions_summary": [621 {622 "id": 4,623 "count": 0,624 "hidden": false,625 "can_act": false626 },627 {628 "id": 8,629 "count": 0,630 "hidden": false,631 "can_act": false632 },633 {634 "id": 10,635 "count": 0,636 "hidden": false,637 "can_act": false638 },639 {640 "id": 7,641 "count": 0,642 "hidden": false,643 "can_act": false644 }645 ],646 "chunk_size": 20,647 "bookmarked": false,648 "topic_timer": null,649 "message_bus_last_id": 0,650 "participant_count": 5,651 "show_read_indicator": false,652 "thumbnails": null,653 "slow_mode_enabled_until": null,654 "can_vote": false,655 "vote_count": 0,656 "user_voted": false,657 "discourse_zendesk_plugin_zendesk_id": null,658 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",659 "details": {660 "can_edit": false,661 "notification_level": 1,662 "participants": [663 {664 "id": 3534,665 "username": "ptrblck",666 "name": "",667 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",668 "post_count": 1,669 "primary_group_name": null,670 "flair_name": null,671 "flair_url": null,672 "flair_color": null,673 "flair_bg_color": null,674 "flair_group_id": null,675 "admin": true,676 "moderator": true,677 "trust_level": 2678 },679 {680 "id": 10025,681 "username": "stas",682 "name": "Stas Bekman",683 "avatar_template": "/user_avatar/discuss.pytorch.org/stas/{size}/8409_2.png",684 "post_count": 1,685 "primary_group_name": null,686 "flair_name": null,687 "flair_url": null,688 "flair_color": null,689 "flair_bg_color": null,690 "flair_group_id": null,691 "trust_level": 2692 },693 {694 "id": 40361,695 "username": "jerly-hjzhou",696 "name": "jerly-hjhzou",697 "avatar_template": "/user_avatar/discuss.pytorch.org/jerly-hjzhou/{size}/32653_2.png",698 "post_count": 1,699 "primary_group_name": null,700 "flair_name": null,701 "flair_url": null,702 "flair_color": null,703 "flair_bg_color": null,704 "flair_group_id": null,705 "trust_level": 1706 },707 {708 "id": 57523,709 "username": "kocchop",710 "name": "",711 "avatar_template": "/letter_avatar_proxy/v4/letter/k/f9ae1b/{size}.png",712 "post_count": 1,713 "primary_group_name": null,714 "flair_name": null,715 "flair_url": null,716 "flair_color": null,717 "flair_bg_color": null,718 "flair_group_id": null,719 "trust_level": 1720 },721 {722 "id": 78854,723 "username": "jthakurH",724 "name": "Jay Thakur",725 "avatar_template": "/user_avatar/discuss.pytorch.org/jthakurh/{size}/72699_2.png",726 "post_count": 1,727 "primary_group_name": null,728 "flair_name": null,729 "flair_url": null,730 "flair_color": null,731 "flair_bg_color": null,732 "flair_group_id": null,733 "trust_level": 1734 }735 ],736 "created_by": {737 "id": 40361,738 "username": "jerly-hjzhou",739 "name": "jerly-hjhzou",740 "avatar_template": "/user_avatar/discuss.pytorch.org/jerly-hjzhou/{size}/32653_2.png"741 },742 "last_poster": {743 "id": 78854,744 "username": "jthakurH",745 "name": "Jay Thakur",746 "avatar_template": "/user_avatar/discuss.pytorch.org/jthakurh/{size}/72699_2.png"747 },748 "links": [749 {750 "url": "https://github.com/KarenUllrich/pytorch-binary-converter",751 "title": "GitHub - KarenUllrich/pytorch-binary-converter: Turning float tensors to binary tensors according to IEEE-754 standard.",752 "internal": false,753 "attachment": false,754 "reflection": false,755 "clicks": 247,756 "user_id": 57523,757 "domain": "github.com",758 "root_domain": "github.com"759 },760 {761 "url": "https://numpy.org/doc/stable/reference/generated/numpy.binary_repr.html",762 "title": "numpy.binary_repr — NumPy v1.22 Manual",763 "internal": false,764 "attachment": false,765 "reflection": false,766 "clicks": 247,767 "user_id": 10025,768 "domain": "numpy.org",769 "root_domain": "numpy.org"770 }771 ]772 },773 "bookmarks": []774 },775 {776 "post_stream": {777 "posts": [778 {779 "id": 454178,780 "name": "Sanjeet Patil",781 "username": "Sanjeet_Patil",782 "avatar_template": "/user_avatar/discuss.pytorch.org/sanjeet_patil/{size}/72678_2.png",783 "created_at": "2024-09-11T15:54:38.072Z",784 "cooked": "<p>The size of tensor is [4,884736].</p>\n<p>I am doing the summation with torch.sum(dim=1)</p>\n<p>I have checked whether the tensor has float(‘-inf’) value with :-<br>\n1] torch.where(tensor == float(‘-inf’), 1, 0) → count the non_zero → output is zero<br>\n2] torch.where(tensor < -7, 1, 0) → count the non_zero → output is zero. Thus specifying the no element is lesser than -7<br>\n3] tensor[tensor == float(‘-inf’)] == 0. Still the result is -inf.</p>\n<p>Kindly suggest.</p>",785 "post_number": 1,786 "post_type": 1,787 "posts_count": 4,788 "updated_at": "2024-09-11T15:54:38.072Z",789 "reply_count": 0,790 "reply_to_post_number": null,791 "quote_count": 0,792 "incoming_link_count": 109,793 "reads": 7,794 "readers_count": 6,795 "score": 546.4,796 "yours": false,797 "topic_id": 209426,798 "topic_slug": "summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it",799 "display_username": "Sanjeet Patil",800 "primary_group_name": null,801 "flair_name": null,802 "flair_url": null,803 "flair_bg_color": null,804 "flair_color": null,805 "flair_group_id": null,806 "badges_granted": [],807 "version": 1,808 "can_edit": false,809 "can_delete": false,810 "can_recover": false,811 "can_see_hidden_post": false,812 "can_wiki": false,813 "read": true,814 "user_title": null,815 "bookmarked": false,816 "actions_summary": [],817 "moderator": false,818 "admin": false,819 "staff": false,820 "user_id": 78834,821 "hidden": false,822 "trust_level": 1,823 "deleted_at": null,824 "user_deleted": false,825 "edit_reason": null,826 "can_view_edit_history": true,827 "wiki": false,828 "post_url": "/t/summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it/209426/1",829 "can_accept_answer": false,830 "can_unaccept_answer": false,831 "accepted_answer": false,832 "topic_accepted_answer": true,833 "can_vote": false834 },835 {836 "id": 454194,837 "name": "",838 "username": "ptrblck",839 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",840 "created_at": "2024-09-11T20:55:38.268Z",841 "cooked": "<p>Could you post the <code>min()</code> and <code>max()</code> values of this tensor you are trying to reduce?</p>",842 "post_number": 2,843 "post_type": 1,844 "posts_count": 4,845 "updated_at": "2024-09-11T20:55:38.268Z",846 "reply_count": 0,847 "reply_to_post_number": null,848 "quote_count": 0,849 "incoming_link_count": 0,850 "reads": 5,851 "readers_count": 4,852 "score": 1.0,853 "yours": false,854 "topic_id": 209426,855 "topic_slug": "summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it",856 "display_username": "",857 "primary_group_name": null,858 "flair_name": null,859 "flair_url": null,860 "flair_bg_color": null,861 "flair_color": null,862 "flair_group_id": null,863 "badges_granted": [],864 "version": 1,865 "can_edit": false,866 "can_delete": false,867 "can_recover": false,868 "can_see_hidden_post": false,869 "can_wiki": false,870 "read": true,871 "user_title": "",872 "bookmarked": false,873 "actions_summary": [],874 "moderator": true,875 "admin": true,876 "staff": true,877 "user_id": 3534,878 "hidden": false,879 "trust_level": 2,880 "deleted_at": null,881 "user_deleted": false,882 "edit_reason": null,883 "can_view_edit_history": true,884 "wiki": false,885 "post_url": "/t/summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it/209426/2",886 "can_accept_answer": false,887 "can_unaccept_answer": false,888 "accepted_answer": false,889 "topic_accepted_answer": true890 },891 {892 "id": 454222,893 "name": "Sanjeet Patil",894 "username": "Sanjeet_Patil",895 "avatar_template": "/user_avatar/discuss.pytorch.org/sanjeet_patil/{size}/72678_2.png",896 "created_at": "2024-09-12T08:23:47.337Z",897 "cooked": "<p>Here are the max() and min() value of the tensor obtained with torch.max() and torch.min()<br>\nMAX_VALUE = -0.0002<br>\nMIN_VALUE = -4.9502</p>",898 "post_number": 3,899 "post_type": 1,900 "posts_count": 4,901 "updated_at": "2024-09-12T08:23:47.337Z",902 "reply_count": 0,903 "reply_to_post_number": null,904 "quote_count": 0,905 "incoming_link_count": 2,906 "reads": 3,907 "readers_count": 2,908 "score": 10.6,909 "yours": false,910 "topic_id": 209426,911 "topic_slug": "summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it",912 "display_username": "Sanjeet Patil",913 "primary_group_name": null,914 "flair_name": null,915 "flair_url": null,916 "flair_bg_color": null,917 "flair_color": null,918 "flair_group_id": null,919 "badges_granted": [],920 "version": 1,921 "can_edit": false,922 "can_delete": false,923 "can_recover": false,924 "can_see_hidden_post": false,925 "can_wiki": false,926 "read": true,927 "user_title": null,928 "bookmarked": false,929 "actions_summary": [],930 "moderator": false,931 "admin": false,932 "staff": false,933 "user_id": 78834,934 "hidden": false,935 "trust_level": 1,936 "deleted_at": null,937 "user_deleted": false,938 "edit_reason": null,939 "can_view_edit_history": true,940 "wiki": false,941 "post_url": "/t/summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it/209426/3",942 "can_accept_answer": false,943 "can_unaccept_answer": false,944 "accepted_answer": false,945 "topic_accepted_answer": true946 },947 {948 "id": 454246,949 "name": "Sanjeet Patil",950 "username": "Sanjeet_Patil",951 "avatar_template": "/user_avatar/discuss.pytorch.org/sanjeet_patil/{size}/72678_2.png",952 "created_at": "2024-09-12T10:47:55.663Z",953 "cooked": "<p>Thank you for replying.<br>\nThis issue can be closed.<br>\nIt was solved by converting the tensor, before summation, from torch.float16 to torch.float64.</p>",954 "post_number": 4,955 "post_type": 1,956 "posts_count": 4,957 "updated_at": "2024-09-12T10:47:55.663Z",958 "reply_count": 0,959 "reply_to_post_number": null,960 "quote_count": 0,961 "incoming_link_count": 0,962 "reads": 3,963 "readers_count": 2,964 "score": 0.6,965 "yours": false,966 "topic_id": 209426,967 "topic_slug": "summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it",968 "display_username": "Sanjeet Patil",969 "primary_group_name": null,970 "flair_name": null,971 "flair_url": null,972 "flair_bg_color": null,973 "flair_color": null,974 "flair_group_id": null,975 "badges_granted": [],976 "version": 1,977 "can_edit": false,978 "can_delete": false,979 "can_recover": false,980 "can_see_hidden_post": false,981 "can_wiki": false,982 "read": true,983 "user_title": null,984 "bookmarked": false,985 "actions_summary": [],986 "moderator": false,987 "admin": false,988 "staff": false,989 "user_id": 78834,990 "hidden": false,991 "trust_level": 1,992 "deleted_at": null,993 "user_deleted": false,994 "edit_reason": null,995 "can_view_edit_history": true,996 "wiki": false,997 "post_url": "/t/summation-of-a-tensor-is-giving-inf-as-output-even-though-no-element-has-inf-value-in-it/209426/4",998 "can_accept_answer": false,999 "can_unaccept_answer": false,1000 "accepted_answer": true,1001 "topic_accepted_answer": true1002 }1003 ],1004 "stream": [1005 454178,1006 454194,1007 454222,1008 4542461009 ]1010 },1011 "timeline_lookup": [1012 [1013 1,1014 4091015 ],1016 [1017 3,1018 4081019 ]1020 ],1021 "suggested_topics": [1022 {1023 "fancy_title": "Data loading time becomes unstable (jumping to high values) when dataset is large",1024 "id": 218042,1025 "title": "Data loading time becomes unstable (jumping to high values) when dataset is large",1026 "slug": "data-loading-time-becomes-unstable-jumping-to-high-values-when-dataset-is-large",1027 "posts_count": 1,1028 "reply_count": 0,1029 "highest_post_number": 1,1030 "image_url": null,1031 "created_at": "2025-03-19T22:19:46.883Z",1032 "last_posted_at": "2025-03-19T22:19:46.923Z",1033 "bumped": true,1034 "bumped_at": "2025-03-19T22:19:46.923Z",1035 "archetype": "regular",1036 "unseen": false,1037 "pinned": false,1038 "unpinned": null,1039 "visible": true,1040 "closed": false,1041 "archived": false,1042 "bookmarked": null,1043 "liked": null,1044 "tags_descriptions": {},1045 "like_count": 0,1046 "views": 29,1047 "category_id": 37,1048 "featured_link": null,1049 "has_accepted_answer": false,1050 "posters": [1051 {1052 "extras": "latest single",1053 "description": "Original Poster, Most Recent Poster",1054 "user": {1055 "id": 40319,1056 "username": "Sihe_Chen",1057 "name": "Sihe Chen",1058 "avatar_template": "/user_avatar/discuss.pytorch.org/sihe_chen/{size}/32610_2.png",1059 "trust_level": 11060 }1061 }1062 ]1063 },1064 {1065 "fancy_title": "Pytorch and Cross Entropy",1066 "id": 219822,1067 "title": "Pytorch and Cross Entropy",1068 "slug": "pytorch-and-cross-entropy",1069 "posts_count": 7,1070 "reply_count": 5,1071 "highest_post_number": 7,1072 "image_url": null,1073 "created_at": "2025-05-06T21:04:58.525Z",1074 "last_posted_at": "2025-05-07T12:47:47.953Z",1075 "bumped": true,1076 "bumped_at": "2025-05-07T12:47:47.953Z",1077 "archetype": "regular",1078 "unseen": false,1079 "pinned": false,1080 "unpinned": null,1081 "visible": true,1082 "closed": false,1083 "archived": false,1084 "bookmarked": null,1085 "liked": null,1086 "tags_descriptions": {},1087 "like_count": 1,1088 "views": 140,1089 "category_id": 37,1090 "featured_link": null,1091 "has_accepted_answer": false,1092 "posters": [1093 {1094 "extras": null,1095 "description": "Original Poster",1096 "user": {1097 "id": 84178,1098 "username": "Teodora-bo",1099 "name": "Teodora Bo",1100 "avatar_template": "/user_avatar/discuss.pytorch.org/teodora-bo/{size}/76933_2.png",1101 "trust_level": 01102 }1103 },1104 {1105 "extras": "latest",1106 "description": "Most Recent Poster",1107 "user": {1108 "id": 3534,1109 "username": "ptrblck",1110 "name": "",1111 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",1112 "admin": true,1113 "moderator": true,1114 "trust_level": 21115 }1116 }1117 ]1118 },1119 {1120 "fancy_title": "Saving and Loading a transformed dataset",1121 "id": 212173,1122 "title": "Saving and Loading a transformed dataset",1123 "slug": "saving-and-loading-a-transformed-dataset",1124 "posts_count": 1,1125 "reply_count": 0,1126 "highest_post_number": 1,1127 "image_url": null,1128 "created_at": "2024-10-27T22:07:40.764Z",1129 "last_posted_at": "2024-10-27T22:07:40.821Z",1130 "bumped": true,1131 "bumped_at": "2024-10-27T22:07:40.821Z",1132 "archetype": "regular",1133 "unseen": false,1134 "pinned": false,1135 "unpinned": null,1136 "visible": true,1137 "closed": false,1138 "archived": false,1139 "bookmarked": null,1140 "liked": null,1141 "tags_descriptions": {},1142 "like_count": 0,1143 "views": 44,1144 "category_id": 37,1145 "featured_link": null,1146 "has_accepted_answer": false,1147 "posters": [1148 {1149 "extras": "latest single",1150 "description": "Original Poster, Most Recent Poster",1151 "user": {1152 "id": 80519,1153 "username": "adamson",1154 "name": "Adam",1155 "avatar_template": "/user_avatar/discuss.pytorch.org/adamson/{size}/73283_2.png",1156 "trust_level": 01157 }1158 }1159 ]1160 },1161 {1162 "fancy_title": "Load_state_dict prevent copying",1163 "id": 216665,1164 "title": "Load_state_dict prevent copying",1165 "slug": "load-state-dict-prevent-copying",1166 "posts_count": 1,1167 "reply_count": 0,1168 "highest_post_number": 1,1169 "image_url": null,1170 "created_at": "2025-02-14T08:38:35.673Z",1171 "last_posted_at": "2025-02-14T08:38:35.714Z",1172 "bumped": true,1173 "bumped_at": "2025-02-14T08:38:35.714Z",1174 "archetype": "regular",1175 "unseen": false,1176 "pinned": false,1177 "unpinned": null,1178 "visible": true,1179 "closed": false,1180 "archived": false,1181 "bookmarked": null,1182 "liked": null,1183 "tags_descriptions": {},1184 "like_count": 0,1185 "views": 51,1186 "category_id": 37,1187 "featured_link": null,1188 "has_accepted_answer": false,1189 "posters": [1190 {1191 "extras": "latest single",1192 "description": "Original Poster, Most Recent Poster",1193 "user": {1194 "id": 82234,1195 "username": "vsnuhsn",1196 "name": null,1197 "avatar_template": "/user_avatar/discuss.pytorch.org/vsnuhsn/{size}/75406_2.png",1198 "trust_level": 11199 }1200 }