Skip to content

Commit a68d8d4

Browse files
ev-brpeterbell10
andauthored
Update torch_np/_wrapper.py
Co-authored-by: peterbell10 <[email protected]>
1 parent 652f003 commit a68d8d4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

torch_np/_wrapper.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -678,15 +678,9 @@ def var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=NoValue, *, where=N
678678
raise NotImplementedError
679679
if dtype is not None:
680680
raise NotImplementedError
681-
if ddof == 0:
682-
unbiased = False
683-
elif ddof == 1:
684-
unbiased = True
685-
else:
686-
raise ValueError(f"std: ddof = {ddof}")
687-
if not torch.is_floating_point:
681+
if not torch.is_floating_point(a):
688682
a = a * 1.0
689-
return torch.var(a, axis, keepdim=bool(keepdims), out=out)
683+
return torch.var(a, axis, correction=ddof, keepdim=bool(keepdims), out=out)
690684

691685

692686

0 commit comments

Comments
 (0)