def sample_continuous_action(logit: Dict[str, torch.Tensor]) -> torch.Tensor:
    """
    **Overview**:
        The function of sampling continuous action, input is a dict with two keys ``mu`` and ``sigma`` ,
        both of them has shape = (B, action_shape), output shape = (B, action_shape).
        In this example, the distributions shapes are:
        batch_shape = (B, ), event_shape = (action_shape, ), sample_shape = ().
    """
    # Construct gaussian distribution, i.e.
    # $$X \sim \mathcal{N}(\mu,\,\sigma^{2})$$
    # Its probability density function is: $$f(x) = \frac{1}{\sigma\sqrt{2\pi}} \exp\left( -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{\!2}\,\right)$$
    # <link https://en.wikipedia.org/wiki/Normal_distribution link>
    dist = Normal(logit['mu'], logit['sigma'])
    # Reinterpret ``action_shape`` gaussian distribution into a multivariate gaussian distribution with diagonal convariance matrix.
    # Ensure each event is independent with each other.
    # <link https://pytorch.org/docs/stable/distributions.html#independent link>
    dist = Independent(dist, 1)
    # Sample one action of the shape ``action_shape`` per sample (state input) and return it.
    return dist.sample()

    **Overview**:
        The function of sampling continuous action, input is a dict with two keys ``mu`` and ``sigma`` ,
        both of them has shape = (B, action_shape), output shape = (B, action_shape).
        In this example, the distributions shapes are:
        batch_shape = (B, ), event_shape = (action_shape, ), sample_shape = ().
    
chapter2_action/continuous_tutorial.py