Skip to content

Commit 189973f

Browse files
authored
Merge pull request #117 from asmeurer/std-fix
Fix torch.std() when correction is an integer
2 parents 94e42df + 1c779cb commit 189973f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

array_api_compat/torch/_aliases.py

+2
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ def std(x: array,
384384
_correction = int(correction)
385385
if correction != _correction:
386386
raise NotImplementedError("float correction in torch std() is not yet supported")
387+
else:
388+
_correction = correction
387389

388390
# https://github.com/pytorch/pytorch/issues/29137
389391
if axis == ():

numpy-1-21-xfails.txt

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[_
130130
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[floor_divide(x1, x2)]
131131
array_api_tests/test_operators_and_elementwise_functions.py::test_greater[__gt__(x1, x2)]
132132
array_api_tests/test_operators_and_elementwise_functions.py::test_greater[greater(x1, x2)]
133+
array_api_tests/test_operators_and_elementwise_functions.py::test_greater_equal[greater_equal(x1, x2)]
133134
array_api_tests/test_operators_and_elementwise_functions.py::test_less[__lt__(x1, x2)]
134135
array_api_tests/test_operators_and_elementwise_functions.py::test_less[less(x1, x2)]
135136
array_api_tests/test_operators_and_elementwise_functions.py::test_less_equal[less_equal(x1, x2)]

0 commit comments

Comments
 (0)