tessl install tessl/pypi-pyopencl@2025.2.0Python wrapper for OpenCL enabling GPU and parallel computing with comprehensive array operations and mathematical functions
Agent Success
Agent success rate when using this tile
86%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.28x
Baseline
Agent success rate without this tile
67%
Build a module that performs statistical normalization operations on numerical datasets using GPU acceleration. The module should standardize data by computing z-scores and handle multiple normalization transformations efficiently on the GPU.
Compute standardized scores (z-scores) for a dataset where each element is transformed using the formula: (x - mean) / standard_deviation.
Scale values to a specific range by applying the transformation: (x - min) / (max - min) * (new_max - new_min) + new_min.
Perform arithmetic operations combining multiple statistical measures.
@generates
def zscore_normalize(data: list[float]) -> list[float]:
"""
Compute z-scores for the input data.
Z-score = (x - mean) / std_dev
Parameters:
- data: List of numerical values
Returns:
- List of z-score normalized values
"""
def minmax_normalize(data: list[float], new_min: float = 0.0, new_max: float = 1.0) -> list[float]:
"""
Normalize data to specified range using min-max scaling.
Formula: (x - old_min) / (old_max - old_min) * (new_max - new_min) + new_min
Parameters:
- data: List of numerical values
- new_min: Minimum value of target range (default 0.0)
- new_max: Maximum value of target range (default 1.0)
Returns:
- List of normalized values in range [new_min, new_max]
"""
def weighted_average(data1: list[float], data2: list[float], weight1: float, weight2: float) -> list[float]:
"""
Compute element-wise weighted average of two arrays.
Formula: weight1 * data1 + weight2 * data2
Parameters:
- data1: First array of values
- data2: Second array of values (must be same length as data1)
- weight1: Weight for first array
- weight2: Weight for second array
Returns:
- List of weighted average values
"""
def squared_deviations(data: list[float]) -> list[float]:
"""
Compute squared deviations from the mean.
Formula: (x - mean)^2 for each element
Parameters:
- data: List of numerical values
Returns:
- List of squared deviations
"""Provides GPU-accelerated array operations and OpenCL context management for high-performance numerical computing.