Skip to content

Commit a25d837

Browse files
committed
Update element_wise.arrangement to flatten the tensors before tiling
1 parent b89e6f0 commit a25d837

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ntops/kernels/element_wise.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ def arrangement(*tensors, block_size=None):
99

1010
assert all(tensor.ndim == ndim or tensor.ndim == 0 for tensor in tensors)
1111

12-
block_shape = tuple(1 for _ in range(ndim - 1)) + (block_size,)
13-
1412
return tuple(
15-
tensor.tile(block_shape) if tensor.ndim != 0 else tensor for tensor in tensors
13+
tensor.flatten().tile((block_size,)) if tensor.ndim != 0 else tensor
14+
for tensor in tensors
1615
)

0 commit comments

Comments
 (0)