Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion dcor/_dcor_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def u_centered(a: Array, *, out: Array | None = None) -> Array:

# The diagonal is zero
xp = array_namespace(a)
out[xp.eye(dim, dtype=xp.bool)] = 0
out[xp.eye(dim, dtype=bool)] = 0

return out

Expand Down
2 changes: 1 addition & 1 deletion dcor/_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _check_valid_energy_exponent(exponent: float) -> None:
def _get_flat_upper_matrix(x: Array, k: int) -> Array:
"""Get flat upper matrix from diagonal k."""
xp = array_namespace(x)
x_mask = xp.triu(xp.ones_like(x, dtype=xp.bool), k=k)
x_mask = xp.triu(xp.ones_like(x, dtype=bool), k=k)
x_mask_flat = xp.reshape(x_mask, -1)
x_flat = xp.reshape(x, -1)

Expand Down