tessl install tessl/pypi-cupy-cuda101@9.6.0CuPy: NumPy & SciPy for GPU (CUDA 10.1 version)
Agent Success
Agent success rate when using this tile
87%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
73%
A utility for performing efficient bitwise operations on binary image masks for image processing applications.
Combines two binary masks by performing element-wise AND operation, keeping only pixels that are active in both masks.
[[1, 0], [1, 1]] and [[1, 1], [0, 1]], the AND operation returns [[1, 0], [0, 1]] @testCombines two binary masks by performing element-wise OR operation, keeping pixels that are active in either mask.
[[1, 0], [1, 1]] and [[0, 1], [0, 1]], the OR operation returns [[1, 1], [1, 1]] @testCombines two binary masks by performing element-wise XOR operation, keeping only pixels that differ between the masks.
[[1, 0], [1, 1]] and [[1, 1], [0, 1]], the XOR operation returns [[0, 1], [1, 0]] @testShifts binary values left by a specified number of bits, effectively multiplying values by powers of 2.
[[1, 2], [3, 4]] and shift amount 2, left shift returns [[4, 8], [12, 16]] @testShifts binary values right by a specified number of bits, effectively performing integer division by powers of 2.
[[4, 8], [12, 16]] and shift amount 2, right shift returns [[1, 2], [3, 4]] @test@generates
def mask_and(mask1, mask2):
"""
Performs element-wise bitwise AND operation on two binary masks.
Args:
mask1: First binary mask array
mask2: Second binary mask array
Returns:
Array with bitwise AND of the two masks
Raises:
ValueError: If mask shapes don't match
"""
pass
def mask_or(mask1, mask2):
"""
Performs element-wise bitwise OR operation on two binary masks.
Args:
mask1: First binary mask array
mask2: Second binary mask array
Returns:
Array with bitwise OR of the two masks
"""
pass
def mask_xor(mask1, mask2):
"""
Performs element-wise bitwise XOR operation on two binary masks.
Args:
mask1: First binary mask array
mask2: Second binary mask array
Returns:
Array with bitwise XOR of the two masks
"""
pass
def shift_left(array, shift_amount):
"""
Performs element-wise left shift operation on array values.
Args:
array: Input array
shift_amount: Number of bits to shift left
Returns:
Array with values shifted left
"""
pass
def shift_right(array, shift_amount):
"""
Performs element-wise right shift operation on array values.
Args:
array: Input array
shift_amount: Number of bits to shift right
Returns:
Array with values shifted right
"""
passProvides GPU-accelerated array operations including bitwise operations.
@satisfied-by