A computer-implemented method for performing a matrix multiplication operation, wherein the method comprises obtaining a matrix B1, a matrix A2, and an index matrix, wherein the index matrix is based on a selection of the plurality of elements of the matrix A2 and comprises a plurality of indexes indicating locations within a matrix A1 from which the plurality of elements of the matrix A2 were selected, the matrix B1 is a matrix with k rows and n columns, the matrix A2 is a matrix with m rows and t columns, the index matrix is a matrix with m rows and t columns, the matrix A1 is a matrix with m rows and k columns, k, n, m, and t are all positive integers, and t is less than or equal to k; generating m matrices B2 based on the index matrix and the matrix 81, wherein the m matrices B2 are all matrices with t rows and n columns, the m matrices B2 are in a one-to-one correspondence with the m rows of the index matrix in sequence, t rows of each matrix B2 are in a one-to-one correspondence with t elements in a corresponding row of the index matrix in sequence, and each row of each matrix B2 is a row indicated in the matrix B1 by a corresponding element in the index matrix; and generating a matrix C based on the matrix A2 and the m matrices B2, wherein the matrix C is a product of the matrix A1 and the matrix B1, the matrix C is a matrix with m rows and n columns, the m rows of the matrix C are in a one-to-one correspondence with the m rows of the matrix A2 in sequence, the m rows of the matrix C are in a one-to-one correspondence with the m matrices B2 in sequence, and each row of the matrix C is a product of a corresponding row of the matrix A2 and a corresponding matrix B2; wherein the matrix A1 is a matrix with m rows and k columns, elements in each of the m rows of the matrix A1 are sequentially grouped into groups whose quantity is a preset value, a quantity of elements in each group is k1, a quantity of non-zero elements in each group of elements is less than or equal to k2, the preset value is k/k1, k is greater than or equal to k1 and k can be exactly divided by k1, and k1 is greater than or equal to k2 and k1 can be exactly divided by k2; wherein the matrix A2 is based on the matrix A1, wherein the m rows of the matrix A2 are in a one-to-one correspondence with the m rows of the matrix A1 in sequence, and elements in each row of the matrix A2 comprise all non-zero elements in groups that are sequentially arranged in a corresponding row of the matrix A1 and whose quantity is the preset value; and wherein the index matrix is further based on the matrix A1, wherein the m rows of the index matrix are in a one-to-one correspondence with the m rows of the matrix A2 in sequence, and elements in each row of the index matrix are column indexes, in the matrix A1, of all elements that are sequentially arranged in a corresponding row of the matrix A2. obtaining a matrix B1, a matrix A2, and an index matrix, wherein the index matrix is based on a selection of the plurality of elements of the matrix A2 and comprises a plurality of indexes indicating locations within a matrix A1 from which the plurality of elements of the matrix A2 were selected, the matrix B1 is a matrix with k rows and n columns, the matrix A2 is a matrix with m rows and t columns, the index matrix is a matrix with m rows and t columns, the matrix A1 is a matrix with m rows and k columns, k, n, m, and t are all positive integers, and t is less than or equal to k; generating m matrices B2 based on the index matrix and the matrix 81, wherein the m matrices B2 are all matrices with t rows and n columns, the m matrices B2 are in a one-to-one correspondence with the m rows of the index matrix in sequence, t rows of each matrix B2 are in a one-to-one correspondence with t elements in a corresponding row of the index matrix in sequence, and each row of each matrix B2 is a row indicated in the matrix B1 by a corresponding element in the index matrix; and generating a matrix C based on the matrix A2 and the m matrices B2, wherein the matrix C is a product of the matrix A1 and the matrix B1, the matrix C is a matrix with m rows and n columns, the m rows of the matrix C are in a one-to-one correspondence with the m rows of the matrix A2 in sequence, the m rows of the matrix C are in a one-to-one correspondence with the m matrices B2 in sequence, and each row of the matrix C is a product of a corresponding row of the matrix A2 and a corresponding matrix B2; wherein the matrix A1 is a matrix with m rows and k columns, elements in each of the m rows of the matrix A1 are sequentially grouped into groups whose quantity is a preset value, a quantity of elements in each group is k1, a quantity of non-zero elements in each group of elements is less than or equal to k2, the preset value is k/k1, k is greater than or equal to k1 and k can be exactly divided by k1, and k1 is greater than or equal to k2 and k1 can be exactly divided by k2; wherein the matrix A2 is based on the matrix A1, wherein the m rows of the matrix A2 are in a one-to-one correspondence with the m rows of the matrix A1 in sequence, and elements in each row of the matrix A2 comprise all non-zero elements in groups that are sequentially arranged in a corresponding row of the matrix A1 and whose quantity is the preset value; and wherein the index matrix is further based on the matrix A1, wherein the m rows of the index matrix are in a one-to-one correspondence with the m rows of the matrix A2 in sequence, and elements in each row of the index matrix are column indexes, in the matrix A1, of all elements that are sequentially arranged in a corresponding row of the matrix A2.