def test_std_no_axis_bkwrd(x): import mygrad as mg x = mg.Tensor(x, constant=False) mg.std(x, axis=()).backward() assert np.all(x.grad == np.zeros_like(x.data))
def test_std_no_axis_fwd(x): import mygrad as mg x = mg.Tensor(x, constant=False) o = mg.std(x, axis=()) assert np.all(o.data == np.zeros_like(x.data))
def test_std_no_axis_fwd(x): o = mg.std(x, axis=()) assert np.all(o == mg.zeros_like(x))
def test_std_no_axis_bkwrd(x): mg.std(x, axis=()).backward() assert np.all(x.grad == mg.zeros_like(x))
def test_std_ddof(x, ddof): assert np.std(x, ddof=ddof) == std(x, ddof=ddof).data