aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2018-01-18 14:05:19 +0100
committerJon Bratseth <bratseth@yahoo-inc.com>2018-01-18 14:05:19 +0100
commitf600a8876d65d76606c2cba882b36cb500ea2e20 (patch)
treef3242245f4b0b450dd4647a5d1dba34d76371dcb /config-model/src/main/java
parentce3d47348594add8a5f6663802b9e94c05be8fca (diff)
Add temporary logging
Diffstat (limited to 'config-model/src/main/java')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java
index 0dd5b4166ef..f5cba0d11a4 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java
@@ -32,6 +32,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.logging.Logger;
/**
* Replaces instances of the tensorflow(model-path, signature, output)
@@ -44,6 +45,8 @@ import java.util.Optional;
// TODO: Avoid name conflicts across models for constants
public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfileTransformContext> {
+ private static final Logger log = Logger.getLogger(TensorFlowFeatureConverter.class.getName());
+
private final TensorFlowImporter tensorFlowImporter = new TensorFlowImporter();
/** A cache of imported models indexed by model path. This avoids importing the same model multiple times. */
@@ -201,6 +204,7 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil
* Adds this expression to the application package, such that it can be read later.
*/
public void writeConverted(RankingExpression expression) {
+ log.info("Writing converted TensorFlow expression to " + arguments.expressionPath());
application.getFile(arguments.expressionPath())
.writeFile(new StringReader(expression.getRoot().toString()));
}
@@ -208,6 +212,7 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil
/** Reads the previously stored ranking expression for these arguments */
public RankingExpression readConverted() {
try {
+ log.info("Reading converted TensorFlow expression from " + arguments.expressionPath());
return new RankingExpression(application.getFile(arguments.expressionPath()).createReader());
}
catch (IOException e) {
@@ -249,10 +254,12 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil
Path constantPath = constantsPath.append(name + ".tbf");
// Remember the constant in a file we replicate in ZooKeeper
+ log.info("Writing converted TensorFlow constant information to " + arguments.rankingConstantsPath().append(name + ".constant"));
application.getFile(arguments.rankingConstantsPath().append(name + ".constant"))
.writeFile(new StringReader(name + ":" + constant.type() + ":" + constantPath));
// Write content explicitly as a file on the file system as this is distributed using file distribution
+ log.info("Writing converted TensorFlow constant to " + application.getFileReference(constantPath).getAbsolutePath());
createIfNeeded(constantsPath);
IOUtils.writeFile(application.getFileReference(constantPath), TypedBinaryFormat.encode(constant));
return constantPath;