def _local_grad(self, parent, d_out_d_self):
        # If self.keepdims == False then we need to
        # broadcast d_out_d_self along the summation axis
        N = float(self.A.value.size) if self.axis is None else float(self.A.shape[self.axis])
        if not self.keepdims and self.axis is not None:
            expanded_d_out_d_self = np.expand_dims(d_out_d_self, self.axis)
            return expanded_d_out_d_self * 1.0/N * np.ones(self.A.shape)
        else:
            return d_out_d_self * 1.0/N * np.ones(self.A.shape)
dataset/ETHPy150Open HIPS/Kayak/kayak/matrix_ops.py/MatMean._local_grad/original