def out_shape(self, input_shape):
    dims = list(input_shape[:self.n_dims_before])
    num_strides = [0 for i in xrange(len(self.strides))]
    neigh_flattened_dim = 1
    for (i, ds) in enumerate(self.dims_neighbourhoods):
        cur_stride = self.strides[i]
        input_dim = input_shape[(i + self.n_dims_before)]
        target_dim = (input_dim // cur_stride)
        if ((not self.ignore_border) and ((input_dim % cur_stride) != 0)):
            target_dim += 1
        num_strides[i] = target_dim
        dims.append(target_dim)
        neigh_flattened_dim *= ds
    dims.append(neigh_flattened_dim)
    return (dims, num_strides)
def out_shape(self, input_shape):
    dims = list(input_shape[:self.n_dims_before])
    num_strides = [0 for i in xrange(len(self.strides))]
    neigh_flattened_dim = 1
    for (i, ds) in enumerate(self.dims_neighbourhoods):
        cur_stride = self.strides[i]
        input_dim = input_shape[(i + self.n_dims_before)]
        target_dim = (input_dim // cur_stride)
        if ((not self.ignore_border) and ((input_dim % cur_stride) != 0)):
            target_dim += 1
        num_strides[i] = target_dim
        dims.append(target_dim)
        neigh_flattened_dim *= ds
    dims.append(neigh_flattened_dim)
    return (dims, num_strides)