Repository: pytorch
Issue: torch.distributions.normal.Normal is not JIT supported
Labels: triage review,oncall: jit,feature,triaged

## 🐛 Bug
When trying to use `torch.distributions.normal.Normal` in a JIT function, you get `torch.jit.frontend.NotSupportedError: comprehension ifs not supported yet`.

## To Reproduce
I am writing a function and calling `torch.distributions.normal.Normal.sample()`.

Steps to reproduce the behavior:
1. Call `torch.distributions.normal.Normal` in a function tagged with `@torch.jit.script`.

```
torch.distributions.normal.Normal(torch.mean(waveform), 1).sample()
```

## Expected behavior

JIT to compile funciton

## Traceback

```
Traceback (most recent call last):
  File "test/test_functional.py", line 6, in <module>
    import torchaudio
  File "/private/home/cwillycs/audio/torchaudio/__init__.py", line 7, in <module>
    from torchaudio import transforms, datasets, kaldi_io, sox_effects, compliance, _docs
  File "/private/home/cwillycs/audio/torchaudio/transforms.py", line 6, in <module>
    from . import functional as F
  File "/private/home/cwillycs/audio/torchaudio/functional.py", line 904, in <module>
    def dither(waveform, probability_density_function="TPDF", noise_shaping=False, ns_filter=""):
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/__init__.py", line 1226, in script
    fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/__init__.py", line 1075, in _compile_and_register_class
    ast = get_jit_class_def(obj, obj.__name__)
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 148, in get_jit_class_def
    self_name=self_name) for method in methods]
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 169, in get_jit_def
    return build_def(ctx, py_ast.body[0], type_line, self_name)
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 209, in build_def
    build_stmts(ctx, body))
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 127, in build_stmts
    stmts = [build_stmt(ctx, s) for s in stmts]
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 185, in __call__
    return method(ctx, node)
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 283, in build_Assign
    rhs = build_expr(ctx, stmt.value)
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 185, in __call__
    return method(ctx, node)
  File "/private/home/cwillycs/.local/lib/python2.7/site-packages/torch/jit/frontend.py", line 681, in build_ListComp
    raise NotSupportedError(r, "comprehension ifs not supported yet")
torch.jit.frontend.NotSupportedError: comprehension ifs not supported yet:
at /private/home/cwillycs/.local/lib/python2.7/site-packages/torch/distributions/distribution.py:263:23
    def __repr__(self):
        param_names = [k for k, _ in self.arg_constraints.items() if k in self.__dict__]
                        <--- HERE
        args_string = ', '.join(['{}: {}'.format(p, self.__dict__[p]
                                if self.__dict__[p].numel() == 1
                                else self.__dict__[p].size()) for p in param_names])
        return self.__class__.__name__ + '(' + args_string + ')'
'Normal' is being compiled since it was called from 'dither'
at /private/home/cwillycs/audio/torchaudio/functional.py:952:8
        random_tensor = int(torch.randint(wave_size, [1, ]).item())
        RPDF_dither = waveform[0][random_tensor] - 0.5

        signal_scaled_RPDF_dithered = signal_scaled + RPDF_dither
        quantised_signal_scaled_RPDF_dithered = torch.round(signal_scaled_RPDF_dithered)
        quantised_signal_RPDF_dithered = quantised_signal_scaled_RPDF_dithered / down_scaling

        dithered = quantised_signal_RPDF_dithered
    elif (probability_density_function == "GPDF"):
        gaussian_dither = torch.distributions.normal.Normal(torch.mean(waveform), 1).sample()
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE

        signal_scaled_gaussian_dithered = signal_scaled + gaussian_dither
        quantised_signal_scaled_gaussian_dithered = torch.round(signal_scaled_gaussian_dithered)
        quantised_signal_gaussian_dithered = quantised_signal_scaled_gaussian_dithered / down_scaling

        dithered = quantised_signal_gaussian_dithered
    else:
        TPDF_dither = torch.bartlett_window(wave_size + 1)
```

## Additional context

Relevant to [PR #319](https://github.com/pytorch/audio/pull/319)

cc @suo