def _conv_edges(x, y, fx, fy, sx, sy, n_in, n_out, g=1):
    """Number of edges in convolution."""
    nx = (x - fx) / sx + 1
    ny = (y - fy) / sy + 1
    return (fx * fy * nx * ny * n_in * n_out) / g