(mean, std)
| 152 | ([0.0, 0.0, 0.0], [0.0, 1.0, 1.0]), |
| 153 | ) |
| 154 | def 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 | """ |
nothing calls this directly
no test coverage detected