mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[Testing] Make test_add_complex3 run on different devices (#151732)
By constructing tensor on that device, because it does not call `self.common` but rather executes test directly. Otherwise `test_add_complex3_mps` will test CPU inductor, rather than MPS one Pull Request resolved: https://github.com/pytorch/pytorch/pull/151732 Approved by: https://github.com/dcci
This commit is contained in:
parent
483e61bfec
commit
ed511cd537
|
|
@ -1369,7 +1369,11 @@ class CommonTemplate:
|
|||
b = torch.add(args[0], args[0])
|
||||
return (a, b)
|
||||
|
||||
x = torch.randn(41, dtype=torch.complex64)
|
||||
# Complex are not supported on MacOS-13
|
||||
if self.device == "mps" and MACOS_VERSION < 14.0:
|
||||
raise unittest.SkipTest("No complex on MacOS13")
|
||||
|
||||
x = torch.randn(41, dtype=torch.complex64, device=self.device)
|
||||
y = x.clone()
|
||||
# should not inplace write to the input
|
||||
fn(x)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user