def backward(self, grad_act, input_act):
        input_ndim = len(self.input_shape)
        output_ndim = len(self.output_shape)

        assert grad_act.shape[-output_ndim:] == tuple(self.output_shape), 'wrong grad input shape'
        assert input_act.shape[-input_ndim:] == tuple(self.input_shape), 'wrong input shape'
        assert ((grad_act.ndim==output_ndim and input_act.ndim==input_ndim)
                or grad_act.shape[0] == input_act.shape[0]), 'wrong number of samples'
        many = (input_act.ndim > input_ndim)
        input_act = atleast(input_act, input_ndim+1)
        grad_act = atleast(grad_act, output_ndim+1)

        grad_input_act, grad_params = self._backward(grad_act, input_act)

        assert grad_input_act.shape[1:] == tuple(self.input_shape), \
            'wrong input act grad shape'
        if self.num_params() > 0:
            grad_params = grad_params.ravel()
            assert grad_params.size == self.num_params(), 'wrong param grad shape'

        return (grad_input_act if many else grad_input_act[0,...], grad_params)

    ################################################################################################
    ### METHODS TO OVERWRITE IN CHILD CLASSES
Backward propagation.  This class is mostly wraps around _backward and does some extra
dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/convnet.py/Layer.backward