We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
element_wise.arrangement
1 parent b89e6f0 commit a25d837Copy full SHA for a25d837
src/ntops/kernels/element_wise.py
@@ -9,8 +9,7 @@ def arrangement(*tensors, block_size=None):
9
10
assert all(tensor.ndim == ndim or tensor.ndim == 0 for tensor in tensors)
11
12
- block_shape = tuple(1 for _ in range(ndim - 1)) + (block_size,)
13
-
14
return tuple(
15
- tensor.tile(block_shape) if tensor.ndim != 0 else tensor for tensor in tensors
+ tensor.flatten().tile((block_size,)) if tensor.ndim != 0 else tensor
+ for tensor in tensors
16
)
0 commit comments