Implemented the compute function for the maxpool layer