diff options
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/tensor/functions/TensorFunctionTestCase.java')
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/tensor/functions/TensorFunctionTestCase.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/functions/TensorFunctionTestCase.java b/vespajlib/src/test/java/com/yahoo/tensor/functions/TensorFunctionTestCase.java index e37bee2d990..ff035f3aed2 100644 --- a/vespajlib/src/test/java/com/yahoo/tensor/functions/TensorFunctionTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/tensor/functions/TensorFunctionTestCase.java @@ -2,6 +2,7 @@ package com.yahoo.tensor.functions; import com.yahoo.tensor.TensorType; +import com.yahoo.tensor.evaluation.TypeContext; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -15,14 +16,14 @@ public class TensorFunctionTestCase { @Test public void testTranslation() { assertTranslated("join(tensor(x{}):{{x:1}:1.0}, reduce(tensor(x{}):{{x:1}:1.0}, sum, x), f(a,b)(a / b))", - new L1Normalize(new ConstantTensor("{{x:1}:1.0}"), "x")); + new L1Normalize<>(new ConstantTensor<>("{{x:1}:1.0}"), "x")); assertTranslated("tensor(x[2],y[3],z[4])((x==y)*(y==z))", - new Diag(new TensorType.Builder().indexed("y",3).indexed("x",2).indexed("z",4).build())); + new Diag<>(new TensorType.Builder().indexed("y",3).indexed("x",2).indexed("z",4).build())); assertTranslated("join(tensor(x{}):{{x:1}:1.0,{x:3}:5.0,{x:9}:3.0}, reduce(tensor(x{}):{{x:1}:1.0,{x:3}:5.0,{x:9}:3.0}, max, x), f(a,b)(a==b))", - new Argmax(new ConstantTensor("{ {x:1}:1, {x:3}:5, {x:9}:3 }"), "x")); + new Argmax<>(new ConstantTensor<>("{ {x:1}:1, {x:3}:5, {x:9}:3 }"), "x")); } - private void assertTranslated(String expectedTranslation, TensorFunction inputFunction) { + private void assertTranslated(String expectedTranslation, TensorFunction<TypeContext.Name> inputFunction) { assertEquals(expectedTranslation, inputFunction.toPrimitive().toString()); } |