Draws stratified samples from a uniform distribution, using settings from a context manager.
(shape, dtype=None, device=None)
| 312 | |
| 313 | |
| 314 | def stratified_with_settings(shape, dtype=None, device=None): |
| 315 | """Draws stratified samples from a uniform distribution, using settings from a context |
| 316 | manager.""" |
| 317 | if not hasattr(stratified_settings, 'disable') or stratified_settings.disable: |
| 318 | return torch.rand(shape, dtype=dtype, device=device) |
| 319 | return stratified_uniform( |
| 320 | shape, stratified_settings.group, stratified_settings.groups, dtype=dtype, device=device |
| 321 | ) |
| 322 | |
| 323 | |
| 324 | def rand_log_normal(shape, loc=0., scale=1., device='cpu', dtype=torch.float32): |
no test coverage detected