Esempio n. 1
0
def test_ImageScaler(tmpdir):
    input_height = 32
    input_width = 32
    channels = 3
    image = np.ones([channels, input_height, input_width]).astype(np.float32)
    scalar = 1.5
    bias = [10, 20, 30]

    model = C.image_scaler(image, scalar, bias)
    verify_no_input(model, tmpdir, 'ImageScaler_0')

    x = C.input_variable(np.shape(image))
    model = C.image_scaler(x, scalar, bias)
    verify_one_input(model, image, tmpdir, 'ImageScaler_1')
Esempio n. 2
0
def test_ImageScaler(tmpdir, dtype):
    with C.default_options(dtype = dtype):
        input_height = 32
        input_width = 32
        channels = 3
        image = np.ones([channels, input_height, input_width]).astype(dtype)
        scalar = 1.5
        bias = [10, 20, 30]

        model = C.image_scaler(image, scalar, bias);
        verify_no_input(model, tmpdir, 'ImageScaler_0')

        x = C.input_variable(np.shape(image)) 
        model = C.image_scaler(x, scalar, bias);
        verify_one_input(model, image, tmpdir, 'ImageScaler_1')
Esempio n. 3
0
def test_ImageScaler(tmpdir, dtype):
    with C.default_options(dtype = dtype):
        input_height = 32
        input_width = 32
        channels = 3
        image = np.ones([channels, input_height, input_width]).astype(dtype)
        scalar = 1.5
        bias = [10, 20, 30]

        model = C.image_scaler(image, scalar, bias);
        verify_no_input(model, tmpdir, 'ImageScaler_0')

        x = C.input_variable(np.shape(image)) 
        model = C.image_scaler(x, scalar, bias);
        verify_one_input(model, image, tmpdir, 'ImageScaler_1')