mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
Fix auto exponent issue for torch.pow (#47024)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47024 Fixes https://github.com/pytorch/pytorch/issues/46936 Stack from [ghstack](https://github.com/ezyang/ghstack): * **#47024 Fix auto exponent issue for torch.pow** Test Plan: Imported from OSS Reviewed By: malfet Differential Revision: D24698027 Pulled By: anjali411 fbshipit-source-id: f23fdb65c925166243593036e08214c4f041a63d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d293413b3e
commit
8ef7ccd669
@@ -175,7 +175,7 @@ TEST(AutogradAPITests, AnomalyMode) {
|
||||
auto y = x.pow(1.5);
|
||||
auto gr =
|
||||
grad({y}, {x}, {}, /*retain_graph=*/true, /*create_backward=*/true);
|
||||
ASSERT_THROWS_WITH(grad({gr[0]}, {x});, "returned nan");
|
||||
ASSERT_THROWS_WITH(grad({gr[0]}, {x}, {torch::tensor({0.0})});, "returned nan");
|
||||
auto msgs = warnings.messages();
|
||||
ASSERT_EQ(msgs.size(), 2);
|
||||
ASSERT_TRUE(
|
||||
|
||||
Reference in New Issue
Block a user