Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vmap support for slogdet; fix regression from functorch 0.2.1 (#8… #86902

Merged
merged 1 commit into from
Oct 13, 2022
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
1 change: 1 addition & 0 deletions aten/src/ATen/functorch/BatchRulesDecompositions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ TORCH_LIBRARY_IMPL(aten, FuncTorchBatched, m) {
OP_DECOMPOSE(square);
OP_DECOMPOSE(numpy_T);
OP_DECOMPOSE(reshape_as);
OP_DECOMPOSE(slogdet);
OP_DECOMPOSE(t);
OP_DECOMPOSE2(result_type, Tensor);
OP_DECOMPOSE2(result_type, Scalar);
Expand Down
9 changes: 9 additions & 0 deletions functorch/test/test_vmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3538,6 +3538,15 @@ def compute_A(out):
self.opinfo_vmap_test(device, torch.float, op, check_has_batch_rule=False,
postprocess_fn=compute_A)

def test_slogdet(self, device):
# There's no OpInfo for this
def test():
B = 2
x = torch.randn(2, 5, 5, device=device)
self.vmap_outplace_test(torch.slogdet, (x,), {}, (0,))

check_vmap_fallback(self, test, torch.slogdet)

def test_fill__Tensor(self, device):
# There's no OpInfo for fill_.Tensor, so here's an extra test for it.
def test():
Expand Down