mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Add out wrappers to some decompositions (#115437)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/115437 Approved by: https://github.com/lezcano
This commit is contained in:
committed by
PyTorch MergeBot
parent
e0c5113dec
commit
edcd968b51
@ -8847,7 +8847,7 @@ tensor([[[1.+1.j, 1.+1.j, 1.+1.j, ..., 1.+1.j, 1.+1.j, 1.+1.j],
|
||||
out = torch.empty(4, 3, 16, 16, device='meta', dtype=torch.double)
|
||||
self.assertExpectedRaisesInline(
|
||||
RuntimeError, lambda: torch._C._nn.upsample_nearest2d(x, (16, 16), out=out),
|
||||
"""Expected out tensor to have dtype float, but got double instead"""
|
||||
"""Expected out tensor to have dtype torch.float32 but got torch.float64 instead"""
|
||||
)
|
||||
|
||||
# Complain if out device mismatch
|
||||
@ -8857,7 +8857,7 @@ tensor([[[1.+1.j, 1.+1.j, 1.+1.j, ..., 1.+1.j, 1.+1.j, 1.+1.j],
|
||||
if not TEST_WITH_TORCHINDUCTOR:
|
||||
self.assertExpectedRaisesInline(
|
||||
RuntimeError, lambda: torch._C._nn.upsample_nearest2d(x, (16, 16), out=out),
|
||||
"""Expected out tensor to have device meta, but got cpu instead"""
|
||||
"""Attempting to copy from device meta to device cpu, but cross-device copies are not allowed!"""
|
||||
)
|
||||
|
||||
def test_add_meta_scalar(self):
|
||||
|
Reference in New Issue
Block a user