Skip to content

Commit

Permalink
Added rot90 batch rule (#138)
Browse files Browse the repository at this point in the history
* Added rot90 batch rule
Description:
- Added rot90 batch rule
- Enabled associated tests

Note: tests seem not be reliable to output bdim.
Tests are passing even if batching rule outputs wrong bdim

* Replaced manual batching rule with REDUCTION_BOXED_ARGS

* Removed commented xfail('rot90')
  • Loading branch information
vfdev-5 authored and zou3519 committed Oct 22, 2021
1 parent 599c5a9 commit a99a86a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions functorch/csrc/BatchRulesReduceOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ TORCH_LIBRARY_IMPL(aten, FT_BATCHED_KEY, m) {
REDUCTION_BOXED(var.correction);
REDUCTION_BOXED(var_mean.correction);
REDUCTION_BOXED(_log_softmax);
REDUCTION_BOXED_ARGS(rot90, 2);

VMAP_SUPPORT("_log_softmax_backward_data", _log_softmax_backward_batch_rule);
VMAP_SUPPORT("_softmax_backward_data", _softmax_backward_batch_rule);
Expand Down
1 change: 0 additions & 1 deletion test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ def test_vmapvjp(self, device, dtype, op):
xfail('quantile'),
xfail('renorm'),
xfail('roll'),
xfail('rot90'),
xfail('scatter_add'),
xfail('solve'),
xfail('sort'),
Expand Down
1 change: 0 additions & 1 deletion test/test_vmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3030,7 +3030,6 @@ def test_vmap_exhaustive(self, device, dtype, op):
xfail('resolve_conj'),
xfail('resolve_neg'),
xfail('roll'),
xfail('rot90'),
xfail('scatter'),
xfail('scatter_add'),
xfail('take'),
Expand Down

0 comments on commit a99a86a

Please sign in to comment.