@torch.no_grad()
def sample_action(self, x: torch.Tensor) -> np.ndarray:
    self.eval()
    (mu, sigma, log_coeff, _) = self(x)
    mix = D.Categorical(logits=log_coeff)
    component: Union[(D.Normal, SquashedNormal)]
    if self.action_bound:
        component = SquashedNormal(mu, sigma, self.action_bound)
    else:
        component = D.Normal(mu, sigma)
    gmm = D.MixtureSameFamily(mix, component)
    action = gmm.sample()
    self.train()
    return action.detach().cpu().numpy()
@torch.no_grad()
def sample_action(self, x: torch.Tensor) -> np.ndarray:
    self.eval()
    (mu, sigma, log_coeff, _) = self(x)
    mix = D.Categorical(logits=log_coeff)
    component: Union[(D.Normal, SquashedNormal)]
    if self.action_bound:
        component = SquashedNormal(mu, sigma, self.action_bound)
    else:
        component = D.Normal(mu, sigma)
    gmm = D.MixtureSameFamily(mix, component)
    action = gmm.sample()
    self.train()
    return action.detach().cpu().numpy()