summaryrefslogtreecommitdiffstats
path: root/model-integration
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2020-01-13 09:56:53 +0100
committerJon Bratseth <bratseth@verizonmedia.com>2020-01-13 09:56:53 +0100
commit02483518eb0da50c95473fd859814bec21658fad (patch)
treeeda350a3f42756bba8bdf2cf48abf26ed37e0da7 /model-integration
parent6af036ff1be58aed8806610d5769952ac0192bdc (diff)
Test validation of the blog TF model
Diffstat (limited to 'model-integration')
-rw-r--r--model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/BlogEvaluationTestCase.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/BlogEvaluationTestCase.java b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/BlogEvaluationTestCase.java
new file mode 100644
index 00000000000..3a35efed2c0
--- /dev/null
+++ b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/BlogEvaluationTestCase.java
@@ -0,0 +1,28 @@
+// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package ai.vespa.rankingexpression.importer.tensorflow;
+
+import ai.vespa.rankingexpression.importer.ImportedModel;
+import org.junit.Test;
+import org.tensorflow.SavedModelBundle;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @author bratseth
+ */
+public class BlogEvaluationTestCase {
+
+ static final String modelDir = "src/test/models/tensorflow/blog/saved";
+
+ @Test
+ public void testImport() {
+ SavedModelBundle tensorFlowModel = SavedModelBundle.load(modelDir, "serve");
+ ImportedModel model = new TensorFlowImporter().importModel("blog", modelDir, tensorFlowModel);
+
+ ImportedModel.Signature y = model.signature("serving_default.y");
+ assertNotNull(y);
+ assertEquals(0, y.inputs().size());
+ }
+
+}