Methods and systems for receiving a request to implement a neural network comprising an average pooling layer on a hardware circuit, and in response, generating instructions that when executed by the hardware circuit, cause the hardware circuit to, during processing of a network input by the neural network, generate a layer output tensor that is equivalent to an output of the average pooling neural network layer by performing a convolution of an input tensor to the average pooling neural network layer and a kernel with a size equal to a window of the average pooling neural network layer and composed of elements that are each an identity matrix to generate a first tensor, and performing operations to cause each element of the first tensor to be divided by a number of elements in the window of the average pooling neural network layer to generate an initial output tensor.
Please help me write a proper abstract based on the patent claims. CLAIM: 1-20. (canceled) 21. A hardware circuit for processing an average pooling neural network layer of a neural network, the hardware circuit being configured to process the average pooling neural network layer by performing operations comprising: obtaining, by a matrix multiplication circuit of the hardware circuit, an input tensor to the average pooling neural network layer, wherein the matrix multiplication circuit is configured to generate a tensor corresponding to an output of the average pooling neural network layer; and generating, by the matrix multiplication circuit of the hardware circuit, the tensor corresponding to the output of the average pooling neural network layer from the input tensor to the average pooling neural network layer, the generating comprising: performing, by the matrix multiplication circuit of the hardware circuit, a convolution of the input tensor and a kernel to generate a first tensor, wherein the kernel has a size equal to a size of a window of the average pooling neural network layer and is composed of elements that are each an identity matrix; performing, by the matrix multiplication circuit of the hardware circuit, element-wise multiplication of the first tensor and a first masking tensor to generate a second tensor, wherein each element of the first masking tensor is a resealing factor that is determined based on a number of elements of the input tensor averaged to generate a corresponding element of the tensor corresponding to the output of the average pooling neural network layer; and performing, by the matrix multiplication circuit of the hardware circuit, element-wise multiplication of the second tensor and a second masking tensor to generate the tensor corresponding to the output of the average pooling neural network layer, wherein each element of the second masking tensor is an inverse of a common denominator of the elements of the first masking tensor that are each a rescaling factor that is determined based on a number of elements of the input tensor averaged to generate a corresponding element of the tensor corresponding to the output of the average pooling neural network layer. 22. The hardware circuit of claim 21, wherein the input tensor is a zero-padded version of an initial input tensor, and wherein each element of the first masking tensor is a rescaling factor that is determined based on a number of elements of the initial input tensor that are averaged to generate a corresponding element of the tensor corresponding to the output of the average pooling neural network layer. 23. The hardware circuit of claim 22, wherein the zero-padded version of the initial input tensor is a version of the initial input tensor comprising, for each row and column of the initial input tensor, one or more preceding zeros and trailing zeros, wherein the number of preceding zeros and trailing zeros is determined based at least on the size of the window of the average pooling neural network layer. 24. The hardware circuit of claim 21, wherein a bit resolution of the elements of the first tensor is higher than a bit resolution of the elements of the second tensor. 25. The hardware circuit of claim 21, wherein a size of the first masking tensor and a size of the second masking tensor are each determined based at least on a size of the input tensor. 26. The hardware circuit of claim 21, wherein each of the first masking tensor and the second masking tensor comprise one or more masking tensor fragments that are tiled to generate a masking tensor. 27. The hardware circuit of claim 21, wherein the input tensor is stored at a unified buffer of the hardware circuit and the kernel is stored at a dynamic memory of the hardware circuit, and wherein the hardware circuit is configured to enable the matrix multiplication circuit of the hardware circuit to perform the convolution of the input tensor and the kernel to generate the first tensor by: sending the input tensor from the unified buffer to the matrix multiplication circuit of the hardware circuit; and sending the kernel from the dynamic memory to the matrix multiplication circuit of the hardware circuit. 28. The hardware circuit of claim 21, wherein each of the convolution of the input tensor and the kernel to generate the first tensor, the element-wise multiplication of the first tensor and the first masking tensor to generate the second tensor, and the element-wise multiplication of the second tensor and the second masking tensor to generate the tensor corresponding to the output of the average pooling neural network layer are performed as fixed point operations. 29. The hardware circuit of claim 21, wherein, to perform the convolution of the input tensor and the kernel to generate the first tensor, the matrix multiplication circuit of the hardware circuit is configured to: receive elements of the input tensor at one or more cells of the matrix multiplication circuit of the hardware circuit; receive weights of the kernel at the one or more cells of the matrix multiplication circuit of the hardware circuit; process the received elements of the input tensor and the received weights of the kernel at the one or more cells of the matrix multiplication circuit of the hardware circuit; and output results of the processing to one or more accumulators of the matrix multiplication circuit of the hardware circuit. 30. The hardware circuit of claim 29, wherein each cell of the matrix multiplication circuit of the hardware circuit comprises: an activation register configured to receive an element of the input tensor; a weight register configured to receive a weight of the kernel; and multiplication circuitry configured to multiply the element of the input tensor and the weight of the kernel. 31. The hardware circuit of claim 21, wherein, to perform the element-wise multiplication of the first tensor and the first masking tensor to generate the second tensor, the matrix multiplication circuit of the hardware circuit is configured to: perform matrix multiplication of the first tensor and an identity matrix to obtain a first output tensor, perform matrix multiplication of the first masking tensor and an identity matrix to obtain a second output tensor; and multiply the first output tensor and the second output tensor to obtain the second tensor. 32. (canceled) 33. The hardware circuit of claim 21, wherein, to perform the element-wise multiplication of the second tensor and the second masking tensor to generate the third tensor, the matrix multiplication circuit of the hardware circuit is configured to: perform matrix multiplication of the second tensor and an identity matrix to obtain a first output tensor, perform matrix multiplication of the second masking tensor and an identity matrix to obtain a second output tensor; and multiply the first output tensor and the second output tensor to obtain the third tensor. 34. (canceled) 35. A hardware circuit for processing an average pooling neural network layer of a neural network, the hardware circuit being configured to process the average pooling neural network layer by performing operations comprising: obtaining, by a matrix multiplication circuit of the hardware circuit, an input tensor to the average pooling neural network layer, wherein the matrix multiplication circuit is configured to generate a tensor corresponding to an output of the average pooling neural network layer; and generating, by the matrix multiplication circuit of the hardware circuit, the tensor corresponding to the output of the average pooling neural network layer from the input tensor to the average pooling neural network layer, the generating comprising: performing, by the matrix multiplication circuit of the hardware circuit, a convolution of the input tensor and a kernel to generate a first tensor, wherein the kernel has a size equal to a size of a window of the average pooling neural network layer and is composed of elements that are each an identity matrix; performing, by the matrix multiplication circuit of the hardware circuit, element-wise multiplication of the first tensor and a first masking tensor to generate a second tensor, wherein each element of the first masking tensor is a least common denominator of (i) a number of elements of the input tensor averaged to generate a corner element of the tensor corresponding to the output of the average pooling neural network layer, (ii) a number of elements of the input tensor averaged to generate an edge element of the tensor corresponding to the output of the average pooling neural network layer, and (iii) a number of elements in the kernel; and performing, by the matrix multiplication circuit of the hardware circuit, element-wise multiplication of the second tensor and a second masking tensor to generate the tensor corresponding to the output of the average pooling neural network layer, wherein each element of the second masking tensor is a resealing factor that is determined based on a number of elements of the input tensor that are averaged to generate a corresponding element of the tensor corresponding to the output of the average pooling neural network layer. 36. The hardware circuit of claim 35, wherein the input tensor is a zero-padded version of an initial input tensor, and wherein each element of the second masking tensor is a resealing factor that is determined based on a number of elements of the initial input tensor that are averaged to generate a corresponding element of the tensor corresponding to the output of the average pooling neural network layer. 37. The hardware circuit of claim 36, wherein the zero-padded version of the initial input tensor is a version of the initial input tensor comprising, for each row and column of the initial input tensor, one or more preceding zeros and trailing zeros, wherein the number of preceding zeros and trailing zeros is determined based at least on the size of the window of the average pooling neural network layer. 38. The hardware circuit of claim 35, wherein a size of the first masking tensor and a size of the second masking tensor are each determined based at least on a size of the input tensor. 39. The hardware circuit of claim 35, wherein each of the convolution of the input tensor and the kernel to generate the first tensor, the element-wise multiplication of the first tensor and the first masking tensor to generate the second tensor, and the element-wise multiplication of the second tensor and the second masking tensor to generate the tensor corresponding to the output of the average pooling neural network layer are performed as fixed point operations. 40. The hardware circuit of claim 35, wherein, to perform the convolution of the input tensor and the kernel to generate the first tensor, the matrix multiplication circuit of the hardware circuit is configured to: receive elements of the input tensor at one or more cells of the matrix multiplication circuit of the hardware circuit computation circuitry; receive weights of the kernel at the one or more cells of the matrix multiplication circuit of the hardware circuit; process the received elements of the input tensor and the received weights of the kernel at the one or more cells of the matrix multiplication circuit of the hardware circuit; and output results of the processing to one or more accumulators of the matrix multiplication circuit of the hardware circuit. 41. The hardware circuit of claim 21, wherein the matrix multiplication circuit of the hardware circuit is not configured to directly process the input tensor to generate the tensor corresponding to the output of the average pooling neural network layer. 42. The hardware circuit of claim 21, wherein a size of the first masking tensor and a size of the second masking tensor are each the same as a size of the input tensor.