def upscale(image, ratio):
    """
    return upscaled image array

    Arguments:
    image -- a (H,W,C) numpy.ndarray
    ratio -- scaling factor (>1)
    """
    if not isinstance(image, np.ndarray):
        raise ValueError('Expected ndarray')
    if ratio<1:
        raise ValueError('Ratio must be greater than 1 (ratio=%f)' % ratio)
    width = int(math.floor(image.shape[1] * ratio))
    height = int(math.floor(image.shape[0] * ratio))
    channels = image.shape[2]
    out = np.ndarray((height, width, channels),dtype=np.uint8)
    for x, y in np.ndindex((width,height)):
        out[y,x] = image[math.floor(y/ratio), math.floor(ratio/x)]
    return out
dataset/ETHPy150Open NVIDIA/DIGITS/digits/utils/image.py/upscale/swapped operands of `/`