Skip to content

Commit 9bce442

Browse files
committed
torch.broadcast_arrays: make it return a tuple
1 parent dd6d3e8 commit 9bce442

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

array_api_compat/torch/_aliases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,9 @@ def astype(
706706
return x.to(dtype=dtype, copy=copy)
707707

708708

709-
def broadcast_arrays(*arrays: Array) -> list[Array]:
709+
def broadcast_arrays(*arrays: Array) -> tuple[Array, ...]:
710710
shape = torch.broadcast_shapes(*[a.shape for a in arrays])
711-
return [torch.broadcast_to(a, shape) for a in arrays]
711+
return tuple(torch.broadcast_to(a, shape) for a in arrays)
712712

713713
# Note that these named tuples aren't actually part of the standard namespace,
714714
# but I don't see any issue with exporting the names here regardless.

0 commit comments

Comments
 (0)