Methods and systems, including computer programs encoded on computer storage media, are provided. One example method includes: obtaining multiple pairs of sub-tensors based on first sub-tensors from a first tensor and second sub-tensors from a second tensor; determining a spatial grid size based on a size of samples, a size of the first feature dimension, a size of the second feature dimension, a size of a dimension of each first sub-tensor corresponding to the first feature dimension, and a size of a dimension of each second sub-tensor corresponding to the second feature dimension; determining whether the spatial grid size meets a threshold; and determining whether to partition the sample along the sequence length of the sample into a plurality of segments based on whether the spatial grid size meets the threshold, where each segment is assigned to one of a plurality of computing units of a processor for parallel processing.
Full Text
What is claimed is: