{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":154020276,"defaultBranch":"master","name":"ai-pytorch","ownerLogin":"michaelhan1208","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2018-10-21T14:58:42.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/29206233?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1662885688.830763","currentOid":""},"activityList":{"items":[{"before":"c55f6973e42b8951d7c547d0ad47b02ad7142df5","after":"af831415a876079a2ff63d72ae99d03e4c11aebd","ref":"refs/heads/master","pushedAt":"2024-01-20T16:25:29.000Z","pushType":"push","commitsCount":10000,"pusher":{"login":"michaelhan1208","name":null,"path":"/michaelhan1208","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/29206233?s=80&v=4"},"commit":{"message":"fix cpp backend relu codegen with inf input (#117622)\n\n**Summary**\nFix issue: https://github.com/pytorch/pytorch/issues/117544.\nFor CPP backend, current `ReLU` will code gen to `f\"{x} * ({x}>0)\"` in `CppOverrides`. The result mismatches with eager when input has `inf`, since `inf * 0` will result to `nan` based on [IEEE_754](https://en.wikipedia.org/wiki/IEEE_754). Change the code gen to `f\"std::max({x}, decltype({x})(0))\"` to align with eager implementation as in https://github.com/pytorch/pytorch/blob/1deb75b5846c6bb39773a4f210379f983250d802/aten/src/ATen/native/cpu/TensorCompareKernel.cpp#L392\n\n**TestPlan**\n```\npython -u -m pytest test_cpu_repro.py -k test_relu_with_inf_value\n```\n\nPull Request resolved: https://github.com/pytorch/pytorch/pull/117622\nApproved by: https://github.com/jgong5, https://github.com/lezcano","shortMessageHtmlLink":"fix cpp backend relu codegen with inf input (pytorch#117622)"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAD5L-WSwA","startCursor":null,"endCursor":null}},"title":"Activity ยท michaelhan1208/ai-pytorch"}