MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_std_must_be_non_zero

Function test_std_must_be_non_zero

dali/test/python/torchvision/test_tv_normalize.py:154–167  ·  view source on GitHub ↗
(mean, std)

Source from the content-addressed store, hash-verified

152 ([0.0, 0.0, 0.0], [0.0, 1.0, 1.0]),
153)
154def test_std_must_be_non_zero(mean, std):
155 x = make_sample_tensor()
156 norm = transforms.Normalize(mean=mean, std=std)
157 with assert_raises(ValueError):
158 _ = norm(x)
159
160 with assert_raises(ValueError):
161 _ = Compose([Normalize(mean=mean, std=std)])
162
163 with assert_raises(ValueError):
164 _ = normalize(x, mean, std)
165
166 with assert_raises(ValueError):
167 _ = transforms.functional.normalize(x, mean, std)
168
169
170"""

Callers

nothing calls this directly

Calls 6

assert_raisesFunction · 0.90
ComposeClass · 0.90
NormalizeClass · 0.90
normalizeFunction · 0.90
make_sample_tensorFunction · 0.85
NormalizeMethod · 0.45

Tested by

no test coverage detected