A method of generating, at a computer system comprising a neural network accelerator, gradients of a loss metric for a neural network with respect to weights of a convolution layer of the NN, the convolution layer of the NN configured to receive an input tensor (1102, 1302) of input values and a weight tensor of weights, and generate an output tensor of output values, the method comprising: performing, using a plurality of convolution engines of the neural network accelerator, a group convolution between a first y -dimensional tensor (1102, 1304) and a second z-dimensional tensor (1006, 1406) wherein z = y + 1 and the second z-dimensional tensor comprises one or more filters and each filter comprises a single channel, the first y -dimensional tensor (1102, 1304) being formed of a set of values from the input tensor, and the second z-dimensional tensor (1006, 1406) being formed of a set of values from an output gradient tensor (1002, 1402) comprising gradients of the loss metric for the NN with respect to the output values, each convolution engine of the plurality of convolution engines being dedicated hardware configured to perform convolution operations; wherein the first y -dimensional tensor (1102, 1304), the second z -dimensional tensor (1006, 1406) and the group convolution are configured to generate an output of a convolution operation between each channel of the set of values of the input tensor and each channel of the set of values of the output gradient tensor; wherein the group convolution between the first y -dimensional tensor (1102, 1304) and the second z -dimensional tensor (1006, 1406) is divided into a plurality of distinct sub-convolutions, and performing the group convolution using the plurality of convolution engines of the neural network accelerator comprises processing in parallel multiple sub-convolutions of the plurality of sub-convolutions by separate convolution engines of the plurality of convolution engines. performing, using a plurality of convolution engines of the neural network accelerator, a group convolution between a first y -dimensional tensor (1102, 1304) and a second z-dimensional tensor (1006, 1406) wherein z = y + 1 and the second z-dimensional tensor comprises one or more filters and each filter comprises a single channel, the first y -dimensional tensor (1102, 1304) being formed of a set of values from the input tensor, and the second z-dimensional tensor (1006, 1406) being formed of a set of values from an output gradient tensor (1002, 1402) comprising gradients of the loss metric for the NN with respect to the output values, each convolution engine of the plurality of convolution engines being dedicated hardware configured to perform convolution operations; wherein the first y -dimensional tensor (1102, 1304), the second z -dimensional tensor (1006, 1406) and the group convolution are configured to generate an output of a convolution operation between each channel of the set of values of the input tensor and each channel of the set of values of the output gradient tensor; wherein the group convolution between the first y -dimensional tensor (1102, 1304) and the second z -dimensional tensor (1006, 1406) is divided into a plurality of distinct sub-convolutions, and performing the group convolution using the plurality of convolution engines of the neural network accelerator comprises processing in parallel multiple sub-convolutions of the plurality of sub-convolutions by separate convolution engines of the plurality of convolution engines.