Skip to content

Commit 011cae4

Browse files
authored
Merge pull request #30 from InfiniTensor/make-element-wise-block-size-configurable
Make the `element_wise.arrangement` function accept customizable `block_size` parameter
2 parents b6a649d + 2a270fa commit 011cae4

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)