diff options
5 files changed, 8 insertions, 13 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/rendering/Renderer.java b/container-search/src/main/java/com/yahoo/search/rendering/Renderer.java index a61c657b709..c9b890e64f5 100644 --- a/container-search/src/main/java/com/yahoo/search/rendering/Renderer.java +++ b/container-search/src/main/java/com/yahoo/search/rendering/Renderer.java @@ -16,7 +16,8 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; /** - * Renders a search result to a writer synchronously - the result is completely rendered when the render method returns.. + * Renders a search result to a writer synchronously + * - the result is completely rendered when the render method returns. * The renderers are cloned just before rendering, * and must therefore obey the following contract: * diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/IntermediateOperation.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/IntermediateOperation.java index 60fba264635..3b77f9527ca 100644 --- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/IntermediateOperation.java +++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/IntermediateOperation.java @@ -146,8 +146,8 @@ public abstract class IntermediateOperation { boolean verifyInputs(int expected, Function<IntermediateOperation, Optional<?>> func) { if (inputs.size() != expected) { - throw new IllegalArgumentException("Expected " + expected + " inputs " + - "for '" + name + "', got " + inputs.size()); + throw new IllegalArgumentException("Expected " + expected + " inputs for '" + + name + "', got " + inputs.size()); } return inputs.stream().map(func).allMatch(Optional::isPresent); } diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java index 131af8de065..39702690bfa 100644 --- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java +++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Switch.java @@ -23,8 +23,7 @@ public class Switch extends IntermediateOperation { } Optional<OrderedTensorType> predicate = inputs.get(1).type(); if (predicate.get().type().rank() != 0) { - throw new IllegalArgumentException("Switch in " + name + ": " + - "predicate must be a scalar"); + throw new IllegalArgumentException("Switch in " + name + ": predicate must be a scalar"); } return inputs.get(0).type().orElse(null); } @@ -33,12 +32,10 @@ public class Switch extends IntermediateOperation { protected TensorFunction lazyGetFunction() { IntermediateOperation predicateOperation = inputs().get(1); if (!predicateOperation.getConstantValue().isPresent()) { - throw new IllegalArgumentException("Switch in " + name + ": " + - "predicate must be a constant"); + throw new IllegalArgumentException("Switch in " + name + ": predicate must be a constant"); } if (port < 0 || port > 1) { - throw new IllegalArgumentException("Switch in " + name + ": " + - "choice should be boolean"); + throw new IllegalArgumentException("Switch in " + name + ": choice should be boolean"); } double predicate = predicateOperation.getConstantValue().get().asDouble(); diff --git a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/MnistImportTestCase.java b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/MnistImportTestCase.java index 42cc60608bf..6b3e9207fad 100644 --- a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/MnistImportTestCase.java +++ b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/MnistImportTestCase.java @@ -19,7 +19,6 @@ public class MnistImportTestCase { public void testMnistImport() { TestableTensorFlowModel model = new TestableTensorFlowModel("test", "src/test/models/tensorflow/mnist/saved"); ImportedModel.Signature signature = model.get().signature("serving_default"); - Assert.assertEquals("Has skipped outputs", 0, model.get().signature("serving_default").skippedOutputs().size()); diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/ScalarFunctions.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/ScalarFunctions.java index 3a66eef258d..eabeb8905f7 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/functions/ScalarFunctions.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/ScalarFunctions.java @@ -245,7 +245,7 @@ public class ScalarFunctions { @Override public double applyAsDouble(double operand) { return scale * (operand >= 0.0 ? operand : alpha * (Math.exp(operand)-1)); } @Override - public String toString() { return String.format("f(a)(%f * if(a >= 0, a, %f*(exp(a)-1)))", scale, alpha); } + public String toString() { return "f(a)(" + scale + " * if(a >= 0, a, " + alpha + " * (exp(a) - 1)))"; } } public static class Sin implements DoubleUnaryOperator { @@ -298,8 +298,6 @@ public class ScalarFunctions { } - - // Variable-length operators ----------------------------------------------------------------------------- public static class EqualElements implements Function<List<Long>, Double> { |