Skip to content

Commit 2a270fa

Browse files
committed
Make the element_wise.arrangement function accept customizable block_size parameter
1 parent b6a649d commit 2a270fa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ntops/kernels/element_wise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import ninetoothed
22

33

4-
def arrangement(*tensors):
4+
def arrangement(*tensors, block_size=ninetoothed.block_size()):
55
ndim = max(tensor.ndim for tensor in tensors)
66

77
assert all(tensor.ndim == ndim or tensor.ndim == 0 for tensor in tensors)
88

9-
block_shape = tuple(1 for _ in range(ndim - 1)) + (ninetoothed.block_size(),)
9+
block_shape = tuple(1 for _ in range(ndim - 1)) + (block_size,)
1010

1111
return tuple(
1212
tensor.tile(block_shape) if tensor.ndim != 0 else tensor for tensor in tensors

0 commit comments

Comments
 (0)