Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ThomasHeede
Copy link

The function _log_beta_1 cannot handle the argument is_sparse=True due to incorrect data type of instantiating result = torch.zeros_like(value). I propose to add that the dtype should be the same as alpha; thus, result = torch.zeros_like(value, dtype=alpha.dtype).

The problem arises when:
result[mask] = (torch.lgamma(1 + value) + torch.lgamma(alpha) - torch.lgamma(value + alpha)), as result[mask].dtype >> torch.int64 and (torch.lgamma(1 + value) + torch.lgamma(alpha) - torch.lgamma(value + alpha)).dtype >> torch.float32

The function __log_beta_1_ cannot handle the argument _is_sparse=True_ due to incorrect data type of instantiating _result = torch.zeros_like(value)_. I propose to add that the dtype should be the same as _alpha_; thus,  _result = torch.zeros_like(value, dtype=alpha.dtype)_.

The problem arises when:
_result[mask] = (torch.lgamma(1 + value) + torch.lgamma(alpha) - torch.lgamma(value + alpha))_,
as result[mask].dtype >> torch.int64 and (torch.lgamma(1 + value) + torch.lgamma(alpha) - torch.lgamma(value + alpha)).dtype >> torch.float32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant