aboutsummaryrefslogtreecommitdiffstats
path: root/model-evaluation/src/test/java/ai/vespa/models/evaluation/SmallConstantImportingTest.java
blob: d721cd6554ece357ce7306787b2b30c851dd065f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.models.evaluation;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author bratseth
 */
public class SmallConstantImportingTest {

    @Test
    public void testImportingSmallConstant() {
        ModelTester tester = new ModelTester("src/test/resources/config/smallconstant/");

        assertEquals(1, tester.models().size());

        Model model = tester.models().get("my_profile");
        tester.assertFunction("firstphase", "reduce(constant(my_tensor), sum)", model);
        assertEquals(3.0, model.evaluatorOf().evaluate().asDouble(), 0.00000000001);

    }

}