mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Fix engine check for case where grad is a subclass (#65568)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65568 Test Plan: Imported from OSS Reviewed By: soulitzer Differential Revision: D31158089 Pulled By: albanD fbshipit-source-id: 2a77df9b6340107de02a043b57a36cb7ae68df34
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e742839f0e
commit
b858993c97
@ -490,7 +490,7 @@ $6 = torch._ops.aten.add_($1, $5)''')
|
||||
return rs
|
||||
|
||||
x = NonWrapperSublass(torch.tensor([3.0, 4.0], requires_grad=True))
|
||||
y = torch.randn(2)
|
||||
y = torch.randn(2, requires_grad=True)
|
||||
z = x * y
|
||||
self.assertIsInstance(z, NonWrapperSublass)
|
||||
z.sum().backward(torch.tensor(1))
|
||||
|
Reference in New Issue
Block a user