def METHOD_NAME(self, value):
    if self._validate_args:
        self._validate_sample(value)
    value = value.long().unsqueeze(-1)
    value, log_pmf = torch.broadcast_tensors(value, self.logits)
    value = value[..., :1]
    return log_pmf.gather(-1, value).squeeze(-1)