@@ -361,8 +361,10 @@ def std(x: array,
361
361
# https://github.com/pytorch/pytorch/issues/61492. We don't try to
362
362
# implement it here for now.
363
363
364
- # if isinstance(correction, float):
365
- # correction = int(correction)
364
+ if isinstance (correction , float ):
365
+ _correction = int (correction )
366
+ if correction != _correction :
367
+ raise NotImplementedError ("float correction in torch std() is not yet supported" )
366
368
367
369
# https://github.com/pytorch/pytorch/issues/29137
368
370
if axis == ():
@@ -372,10 +374,10 @@ def std(x: array,
372
374
if axis is None :
373
375
# torch doesn't support keepdims with axis=None
374
376
# (https://github.com/pytorch/pytorch/issues/71209)
375
- res = torch .std (x , tuple (range (x .ndim )), correction = correction , ** kwargs )
377
+ res = torch .std (x , tuple (range (x .ndim )), correction = _correction , ** kwargs )
376
378
res = _axis_none_keepdims (res , x .ndim , keepdims )
377
379
return res
378
- return torch .std (x , axis , correction = correction , keepdims = keepdims , ** kwargs )
380
+ return torch .std (x , axis , correction = _correction , keepdims = keepdims , ** kwargs )
379
381
380
382
def var (x : array ,
381
383
/ ,
0 commit comments