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 module for processing large batches of multi-dimensional data by dividing them into smaller, manageable chunks.
You need to implement a batch data processor that can split large arrays into smaller sub-batches for distributed processing. The module should handle 1D vectors, 2D matrices, and 3D tensors, providing flexible splitting strategies along different axes.
The module must provide the following splitting capabilities:
@generates
def split_into_chunks(array, num_chunks, axis=0):
"""
Split an array into the specified number of chunks along the given axis.
Handles cases where array cannot be evenly divided.
Parameters:
- array: Input array to split
- num_chunks: int, number of chunks to create
- axis: int, axis along which to split (default: 0)
Returns:
list: List of sub-arrays
"""
def split_columns(array, num_chunks):
"""
Split a 2D array into chunks by dividing columns.
Parameters:
- array: 2D input array
- num_chunks: int, number of column chunks to create
Returns:
list: List of sub-arrays with divided columns
"""
def split_rows(array, num_chunks):
"""
Split a 2D array into chunks by dividing rows.
Parameters:
- array: 2D input array
- num_chunks: int, number of row chunks to create
Returns:
list: List of sub-arrays with divided rows
"""
def split_depth(array, num_chunks):
"""
Split a 3D array into chunks along the depth (third) dimension.
Parameters:
- array: 3D input array
- num_chunks: int, number of depth chunks to create
Returns:
list: List of sub-arrays with divided depth
"""Provides GPU-accelerated array operations and splitting functions.