Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions distrax/_src/distributions/multinomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def entropy(self) -> Array:
@staticmethod
def _entropy_scalar(
total_count: int, probs: Array, log_of_probs: Array
) -> Union[jnp.float32, jnp.float64]:
) -> Union[jnp.float32, jnp.float64]: # pyrefly: ignore[not-a-type]
"""Calculates the entropy for a Multinomial with integer `total_count`."""
# Constant factors in the entropy.
xi = jnp.arange(total_count + 1, dtype=probs.dtype)
Expand Down Expand Up @@ -230,7 +230,7 @@ def _entropy_scalar(
@staticmethod
def _entropy_scalar_with_lax(
total_count: int, probs: Array, log_of_probs: Array
) -> Union[jnp.float32, jnp.float64]:
) -> Union[jnp.float32, jnp.float64]: # pyrefly: ignore[not-a-type]
"""Like `_entropy_scalar`, but uses a lax while loop."""

dtype = probs.dtype
Expand Down
Loading