or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/cupy-cuda101@9.6.x
tile.json

tessl/pypi-cupy-cuda101

tessl install tessl/pypi-cupy-cuda101@9.6.0

CuPy: 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%

task.mdevals/scenario-3/

Binary Image Mask Operations

A utility for performing efficient bitwise operations on binary image masks for image processing applications.

Capabilities

Bitwise AND operation

Combines two binary masks by performing element-wise AND operation, keeping only pixels that are active in both masks.

  • Given two 2D arrays [[1, 0], [1, 1]] and [[1, 1], [0, 1]], the AND operation returns [[1, 0], [0, 1]] @test

Bitwise OR operation

Combines two binary masks by performing element-wise OR operation, keeping pixels that are active in either mask.

  • Given two 2D arrays [[1, 0], [1, 1]] and [[0, 1], [0, 1]], the OR operation returns [[1, 1], [1, 1]] @test

Bitwise XOR operation

Combines two binary masks by performing element-wise XOR operation, keeping only pixels that differ between the masks.

  • Given two 2D arrays [[1, 0], [1, 1]] and [[1, 1], [0, 1]], the XOR operation returns [[0, 1], [1, 0]] @test

Left shift operation

Shifts binary values left by a specified number of bits, effectively multiplying values by powers of 2.

  • Given array [[1, 2], [3, 4]] and shift amount 2, left shift returns [[4, 8], [12, 16]] @test

Right shift operation

Shifts binary values right by a specified number of bits, effectively performing integer division by powers of 2.

  • Given array [[4, 8], [12, 16]] and shift amount 2, right shift returns [[1, 2], [3, 4]] @test

Implementation

@generates

API

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
    """
    pass

Dependencies { .dependencies }

cupy-cuda101 { .dependency }

Provides GPU-accelerated array operations including bitwise operations.

@satisfied-by