Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aten/src/ATen/native/mps/operations/Inverse.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
MPSStream* stream = getCurrentMPSStream();
info.zero_();

if (A.numel() == 0) {
return;
}

struct CachedGraph : public MPSCachedGraph
{
CachedGraph(MPSGraph *graph) : MPSCachedGraph(graph) {}
Expand Down
2 changes: 0 additions & 2 deletions test/test_mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9272,8 +9272,6 @@ class TestConsistency(TestCase):
'nonzero': [torch.bool, torch.uint8, torch.float16],
'median': [torch.float32, torch.int16, torch.int32, torch.uint8, torch.int16],
'sgn': [torch.bool],
'linalg.inv': [torch.float32],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these already enabled in ALLOWLIST ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so removing them from the blocklist is all that's needed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I will defer the approval to others

'linalg.inv_ex': [torch.float32],
'linalg.matrix_power': [torch.float32],
'nn.functional.interpolate': [torch.float32],
'resize_': [torch.bool, torch.float16, torch.float32, torch.int16, torch.int32, torch.int64, torch.uint8],
Expand Down