aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2019-11-22 15:39:12 +0100
committerGitHub <noreply@github.com>2019-11-22 15:39:12 +0100
commit5d60610b4f7618fea483f7646d685f0c0808aea0 (patch)
treea665a800826ba7c5ee6709f6d4ceee31aa33d7f5
parent345d5b2716437e3e40290073225e766350d768a8 (diff)
parent282d886c01e738b0f25e90194bdf1a14c4c31448 (diff)
Merge pull request #11383 from vespa-engine/lesters/prepare-for-tf2onnx
Lesters/prepare for tf2onnx
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/DimensionRenamer.java41
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/ModelImporter.java4
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/AttributeConverter.java69
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/GraphImporter.java91
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/OnnxImporter.java1
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TensorConverter.java58
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TypeConverter.java8
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Argument.java12
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/ExpandDims.java4
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Gemm.java183
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/IntermediateOperation.java73
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/MatMul.java2
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/OnnxConcat.java105
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reduce.java121
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Rename.java11
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reshape.java35
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Select.java3
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Squeeze.java7
-rw-r--r--model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/PyTorchImportTestCase.java22
-rw-r--r--model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/TestableModel.java122
-rw-r--r--model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/Tf2OnnxImportTestCase.java153
-rw-r--r--model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/Issue9662TestCase.java2
-rw-r--r--model-integration/src/test/models/pytorch/pytorch.onnxbin0 -> 617 bytes
-rwxr-xr-xmodel-integration/src/test/models/pytorch/pytorch_test.py66
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_A/optimized_v2/saved_model.pbtxt1368
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/optimized/saved_model.pbtxt1368
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/saved_model.pbtxt11403
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001bin0 -> 48 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.indexbin0 -> 393 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/optimized/saved_model.pbtxt959
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/saved_model.pbtxt8622
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001bin0 -> 24 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.indexbin0 -> 209 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/modelv1/saved_model.pbbin0 -> 170845 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.data-00000-of-00001bin0 -> 56124 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.indexbin0 -> 896 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/modelv2/saved_model.pbbin0 -> 194189 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.data-00000-of-00001bin0 -> 56932 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.indexbin0 -> 1046 bytes
-rw-r--r--model-integration/src/test/models/tensorflow/external/train.py52
-rw-r--r--model-integration/src/test/models/tensorflow/external/train_embed.py65
-rw-r--r--vespajlib/abi-spec.json16
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/functions/ScalarFunctions.java8
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/functions/TensorFunction.java2
44 files changed, 24961 insertions, 95 deletions
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/DimensionRenamer.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/DimensionRenamer.java
index e9be35b6f84..d22a8067bd4 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/DimensionRenamer.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/DimensionRenamer.java
@@ -121,7 +121,7 @@ public class DimensionRenamer {
List<IntermediateOperation> prioritizedOperations =
constraintsPerOperation.entrySet().stream()
.sorted(Comparator.comparingInt(entry -> - entry.getValue()))
- .map(entry -> entry.getKey())
+ .map(Map.Entry::getKey)
.collect(Collectors.toList());
List<RenameTarget> targets = new ArrayList<>();
@@ -131,8 +131,7 @@ public class DimensionRenamer {
if (inputType.isEmpty()) continue;
for (String dimensionName : inputType.get().dimensionNames()) {
RenameTarget target = new RenameTarget(operation, i, dimensionName, graph);
- if (target.rootKey != null) // TODO: Inserting renames under non-roots is not implemented
- targets.add(target);
+ targets.add(target);
}
}
}
@@ -313,17 +312,10 @@ public class DimensionRenamer {
final String dimensionName;
final IntermediateGraph graph;
- /**
- * Returns the key of this operation in the root operations of the graph,
- * or null if it is not a root operation
- */
- final String rootKey;
-
public RenameTarget(IntermediateOperation operation, int inputNumber, String dimensionName, IntermediateGraph graph) {
this.operation = operation;
this.inputNumber = inputNumber;
this.dimensionName = dimensionName;
- this.rootKey = findRootKey(operation, graph);
this.graph = graph;
}
@@ -331,42 +323,25 @@ public class DimensionRenamer {
return operation.inputs().get(inputNumber);
}
- private static String findRootKey(IntermediateOperation operation, IntermediateGraph graph) {
- for (var entry : graph.operations().entrySet()) {
- if (entry.getValue() == operation)
- return entry.getKey();
- }
- return null;
- }
-
/** Inserts a rename operation if possible. Returns whether an operation was inserted. */
private boolean insertRename(DimensionRenamer renamer) {
Rename rename = new Rename(operation.modelName(),
dimensionName,
renamer.dimensionPrefix + renamer.dimensions.size(),
- input());
-
- List<IntermediateOperation> newInputs = new ArrayList<>(operation.inputs());
- newInputs.set(inputNumber, rename);
- IntermediateOperation newOperation = operation.withInputs(newInputs);
- if (rootKey == null)
- throw new IllegalStateException("Renaming non-roots is not implemented");
- graph.put(rootKey, newOperation);
-
+ null);
+ operation.insert(rename, inputNumber);
removeConstraintsOf(operation, renamer);
rename.addDimensionNameConstraints(renamer);
- newOperation.addDimensionNameConstraints(renamer);
+ operation.addDimensionNameConstraints(renamer);
return true;
}
/** Undo what insertRenameOperation has done: Set back the original operation and remove+add constraints */
private void uninsertRename(DimensionRenamer renamer) {
- IntermediateOperation newOperation = graph.operations().get(rootKey);
- Rename rename = (Rename)newOperation.inputs().get(inputNumber);
- graph.put(rootKey, operation);
-
+ Rename rename = (Rename)operation.inputs().get(inputNumber);
+ operation.uninsert(inputNumber);
removeConstraintsOf(rename, renamer);
- removeConstraintsOf(newOperation, renamer);
+ removeConstraintsOf(operation, renamer);
operation.addDimensionNameConstraints(renamer);
}
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ModelImporter.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ModelImporter.java
index b587a9200ec..3774e64c886 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ModelImporter.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ModelImporter.java
@@ -96,7 +96,7 @@ public abstract class ModelImporter implements MlModelImporter {
for (String outputName : signature.outputs().values()) {
try {
Optional<TensorFunction> function = importExpression(graph.get(outputName), model);
- if (!function.isPresent()) {
+ if (function.isEmpty()) {
signature.skippedOutput(outputName, "No valid output function could be found.");
}
}
@@ -108,7 +108,7 @@ public abstract class ModelImporter implements MlModelImporter {
}
private static Optional<TensorFunction> importExpression(IntermediateOperation operation, ImportedModel model) {
- if (!operation.type().isPresent()) {
+ if (operation.type().isEmpty()) {
return Optional.empty();
}
if (operation.isConstant()) {
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/AttributeConverter.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/AttributeConverter.java
new file mode 100644
index 00000000000..8caa158e5be
--- /dev/null
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/AttributeConverter.java
@@ -0,0 +1,69 @@
+// 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.onnx;
+
+import ai.vespa.rankingexpression.importer.OrderedTensorType;
+import ai.vespa.rankingexpression.importer.operations.IntermediateOperation;
+import com.yahoo.searchlib.rankingexpression.evaluation.DoubleValue;
+import com.yahoo.searchlib.rankingexpression.evaluation.StringValue;
+import com.yahoo.searchlib.rankingexpression.evaluation.Value;
+import onnx.Onnx;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * Converts Onnx node attributes to Vespa attribute values.
+ *
+ * @author lesters
+ */
+class AttributeConverter implements IntermediateOperation.AttributeMap {
+
+ private final Onnx.NodeProto node;
+
+ private AttributeConverter(Onnx.NodeProto node) {
+ this.node = node;
+ }
+
+ static AttributeConverter convert(Onnx.NodeProto node) {
+ return new AttributeConverter(node);
+ }
+
+ @Override
+ public Optional<Value> get(String name) {
+ for (Onnx.AttributeProto attr : node.getAttributeList()) {
+ if (attr.getName().equals(name)) {
+ switch (attr.getType()) {
+ case INT: return Optional.of(DoubleValue.frozen(attr.getI()));
+ case FLOAT: return Optional.of(DoubleValue.frozen(attr.getF()));
+ case STRING: return Optional.of(StringValue.frozen(attr.getS().toString()));
+ default:
+ return Optional.empty();
+ }
+ }
+ }
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<Value> get(String name, OrderedTensorType type) {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional<List<Value>> getList(String name) {
+ for (Onnx.AttributeProto attr : node.getAttributeList()) {
+ if (attr.getName().equals(name)) {
+ switch (attr.getType()) {
+ case INTS: return Optional.of(attr.getIntsList().stream().map(DoubleValue::new).collect(Collectors.toList()));
+ case FLOATS: return Optional.of(attr.getFloatsList().stream().map(DoubleValue::new).collect(Collectors.toList()));
+ case STRINGS: return Optional.of(attr.getStringsList().stream().map((s) -> StringValue.frozen(s.toString())).collect(Collectors.toList()));
+ default:
+ return Optional.empty();
+ }
+ }
+ }
+ return Optional.empty();
+ }
+
+}
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/GraphImporter.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/GraphImporter.java
index 714953fbd45..280fe354149 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/GraphImporter.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/GraphImporter.java
@@ -2,11 +2,16 @@
package ai.vespa.rankingexpression.importer.onnx;
+import ai.vespa.rankingexpression.importer.operations.Gemm;
+import ai.vespa.rankingexpression.importer.operations.OnnxConcat;
+import ai.vespa.rankingexpression.importer.operations.Reduce;
+import ai.vespa.rankingexpression.importer.operations.Select;
+import ai.vespa.rankingexpression.importer.operations.Softmax;
+import ai.vespa.rankingexpression.importer.operations.Squeeze;
import com.yahoo.searchlib.rankingexpression.evaluation.TensorValue;
import ai.vespa.rankingexpression.importer.IntermediateGraph;
import ai.vespa.rankingexpression.importer.OrderedTensorType;
import ai.vespa.rankingexpression.importer.operations.Argument;
-import ai.vespa.rankingexpression.importer.operations.ConcatV2;
import ai.vespa.rankingexpression.importer.operations.Constant;
import ai.vespa.rankingexpression.importer.operations.Identity;
import ai.vespa.rankingexpression.importer.operations.IntermediateOperation;
@@ -36,6 +41,7 @@ class GraphImporter {
IntermediateGraph graph) {
String modelName = graph.name();
String nodeName = getNodeName(node);
+ AttributeConverter attributes = AttributeConverter.convert(node);
switch (node.getOpType().toLowerCase()) {
case "abs": return new Map(modelName, nodeName, inputs, ScalarFunctions.abs());
@@ -44,13 +50,14 @@ class GraphImporter {
case "asin": return new Map(modelName, nodeName, inputs, ScalarFunctions.asin());
case "atan": return new Map(modelName, nodeName, inputs, ScalarFunctions.atan());
case "ceil": return new Map(modelName, nodeName, inputs, ScalarFunctions.ceil());
- case "concat": return new ConcatV2(modelName, nodeName, inputs);
+ case "concat": return new OnnxConcat(modelName, nodeName, inputs, attributes);
case "cos": return new Map(modelName, nodeName, inputs, ScalarFunctions.cos());
case "div": return new Join(modelName, nodeName, inputs, ScalarFunctions.divide());
case "elu": return new Map(modelName, nodeName, inputs, ScalarFunctions.elu());
case "equal": return new Join(modelName, nodeName, inputs, ScalarFunctions.equal());
case "exp": return new Map(modelName, nodeName, inputs, ScalarFunctions.exp());
case "floor": return new Map(modelName, nodeName, inputs, ScalarFunctions.floor());
+ case "gemm": return new Gemm(modelName, nodeName, inputs, attributes);
case "greater": return new Join(modelName, nodeName, inputs, ScalarFunctions.greater());
case "identity": return new Identity(modelName, nodeName, inputs);
case "less": return new Join(modelName, nodeName, inputs, ScalarFunctions.less());
@@ -63,15 +70,21 @@ class GraphImporter {
case "neg": return new Map(modelName, nodeName, inputs, ScalarFunctions.neg());
case "pow": return new Join(modelName, nodeName, inputs, ScalarFunctions.pow());
case "reshape": return new Reshape(modelName, nodeName, inputs);
+ case "reducesum": return new Reduce(modelName, nodeName, inputs, attributes, com.yahoo.tensor.functions.Reduce.Aggregator.sum);
+ case "reducemean": return new Reduce(modelName, nodeName, inputs, attributes, com.yahoo.tensor.functions.Reduce.Aggregator.avg);
case "reciprocal": return new Map(modelName, nodeName, inputs, ScalarFunctions.reciprocal());
case "relu": return new Map(modelName, nodeName, inputs, ScalarFunctions.relu());
case "selu": return new Map(modelName, nodeName, inputs, ScalarFunctions.selu());
+ case "leakyrelu": return new Map(modelName, nodeName, inputs, ScalarFunctions.leakyrelu());
case "shape": return new Shape(modelName, nodeName, inputs);
- case "sin": return new Map(modelName, nodeName, inputs, ScalarFunctions.sin());
- case "sqrt": return new Map(modelName, nodeName, inputs, ScalarFunctions.sqrt());
case "sigmoid": return new Map(modelName, nodeName, inputs, ScalarFunctions.sigmoid());
+ case "sin": return new Map(modelName, nodeName, inputs, ScalarFunctions.sin());
+ case "softmax": return new Softmax(modelName, nodeName, inputs);
case "sub": return new Join(modelName, nodeName, inputs, ScalarFunctions.subtract());
+ case "squeeze": return new Squeeze(modelName, nodeName, inputs, attributes);
+ case "sqrt": return new Map(modelName, nodeName, inputs, ScalarFunctions.sqrt());
case "square": return new Map(modelName, nodeName, inputs, ScalarFunctions.square());
+ case "where": return new Select(modelName, nodeName, inputs);
case "tan": return new Map(modelName, nodeName, inputs, ScalarFunctions.tan());
case "tanh": return new Map(modelName, nodeName, inputs, ScalarFunctions.tanh());
}
@@ -125,16 +138,25 @@ class GraphImporter {
List<IntermediateOperation> inputs = importOperationInputs(node, onnxGraph, intermediateGraph);
operation = mapOperation(node, inputs, intermediateGraph);
+ // propagate constant values if all inputs are constant
+ if (operation.isConstant()) {
+ operation.setConstantValueFunction(operation::evaluateAsConstant);
+ }
+
if (isOutputNode(name, onnxGraph)) {
intermediateGraph.outputs(intermediateGraph.defaultSignature())
- .put(IntermediateOperation.namePartOf(name), operation.vespaName());
+ .put(IntermediateOperation.namePartOf(name), operation.name());
}
}
- intermediateGraph.put(operation.vespaName(), operation);
+ intermediateGraph.put(operation.name(), operation);
return operation;
}
+ // Rules for initializers in ONNX:
+ // When an initializer has the same name as a graph input, it specifies a default value for that input.
+ // When an initializer has a name different from all graph inputs, it specifies a constant value.
+
private static boolean isArgumentTensor(String name, Onnx.GraphProto graph) {
Onnx.ValueInfoProto value = getArgumentTensor(name, graph);
Onnx.TensorProto tensor = getConstantTensor(name, graph);
@@ -142,9 +164,7 @@ class GraphImporter {
}
private static boolean isConstantTensor(String name, Onnx.GraphProto graph) {
- Onnx.ValueInfoProto value = getArgumentTensor(name, graph);
- Onnx.TensorProto tensor = getConstantTensor(name, graph);
- return value != null && tensor != null;
+ return getConstantTensor(name, graph) != null;
}
private static Onnx.ValueInfoProto getArgumentTensor(String name, Onnx.GraphProto graph) {
@@ -191,46 +211,43 @@ class GraphImporter {
}
private static void verifyOutputTypes(Onnx.GraphProto onnxGraph, IntermediateGraph intermediateGraph) {
- for (String outputName : intermediateGraph.outputs(intermediateGraph.defaultSignature()).values()) {
- IntermediateOperation operation = intermediateGraph.get(outputName);
- Onnx.ValueInfoProto onnxNode = getOutputNode(outputName, onnxGraph);
+ for (java.util.Map.Entry<String, String> output : intermediateGraph.outputs(intermediateGraph.defaultSignature()).entrySet()) {
+ IntermediateOperation operation = intermediateGraph.get(output.getValue());
+ Onnx.ValueInfoProto onnxNode = getOutputNode(output.getKey(), onnxGraph);
OrderedTensorType type = operation.type().orElseThrow(
- () -> new IllegalArgumentException("Output of '" + outputName + "' has no type."));
+ () -> new IllegalArgumentException("Output of '" + output.getValue() + "' has no type."));
TypeConverter.verifyType(onnxNode.getType(), type);
}
}
private static Onnx.NodeProto getNodeFromGraph(String nodeName, Onnx.GraphProto graph) {
- Optional<Onnx.NodeProto> node;
- if (nodeName.contains(":")) {
- node = getNodeFromGraphOutputs(nodeName, graph);
- } else {
- node = getNodeFromGraphNames(nodeName, graph);
- if (node.isEmpty()) {
- node = getNodeFromGraphOutputs(nodeName, graph);
- }
- }
- return node.orElseThrow(() -> new IllegalArgumentException("Node '" + nodeName + "' not found in ONNX graph"));
+ Optional<Onnx.NodeProto> node = getNodeFromGraphNames(nodeName, graph);
+ if (node.isPresent())
+ return node.get();
+
+ node = getNodeFromGraphOutputs(nodeName, graph);
+ if (node.isPresent())
+ return node.get();
+
+ node = getNodeFromGraphInputs(nodeName, graph);
+ if (node.isPresent())
+ return node.get();
+
+ throw new IllegalArgumentException("Node '" + nodeName + "' not found in ONNX graph");
}
private static Optional<Onnx.NodeProto> getNodeFromGraphOutputs(String nodeName, Onnx.GraphProto graph) {
- for (Onnx.NodeProto node : graph.getNodeList()) {
- for (String outputName : node.getOutputList()) {
- if (outputName.equals(nodeName)) {
- return Optional.of(node);
- }
- }
- }
- return Optional.empty();
+ return graph.getNodeList().stream().filter(node ->
+ node.getOutputList().stream().anyMatch(name -> name.equals(nodeName))).findFirst();
+ }
+
+ private static Optional<Onnx.NodeProto> getNodeFromGraphInputs(String nodeName, Onnx.GraphProto graph) {
+ return graph.getNodeList().stream().filter(node ->
+ node.getInputList().stream().anyMatch(name -> name.equals(nodeName))).findFirst();
}
private static Optional<Onnx.NodeProto> getNodeFromGraphNames(String nodeName, Onnx.GraphProto graph) {
- for (Onnx.NodeProto node : graph.getNodeList()) {
- if (node.getName().equals(nodeName)) {
- return Optional.of(node);
- }
- }
- return Optional.empty();
+ return graph.getNodeList().stream().filter(node -> node.getName().equals(nodeName)).findFirst();
}
private static String getNodeName(Onnx.NodeProto node) {
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/OnnxImporter.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/OnnxImporter.java
index 0a8a797a847..b1c5dc8a0d8 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/OnnxImporter.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/OnnxImporter.java
@@ -30,6 +30,7 @@ public class OnnxImporter extends ModelImporter {
public ImportedModel importModel(String modelName, String modelPath) {
try (FileInputStream inputStream = new FileInputStream(modelPath)) {
Onnx.ModelProto model = Onnx.ModelProto.parseFrom(inputStream);
+ // long version = model.getOpsetImport(0).getVersion(); // opset version
IntermediateGraph graph = GraphImporter.importGraph(modelName, model);
return convertIntermediateGraphToModel(graph, modelPath);
} catch (IOException e) {
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TensorConverter.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TensorConverter.java
index f3d87d89c27..69d18d0ffcb 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TensorConverter.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TensorConverter.java
@@ -10,7 +10,10 @@ import onnx.Onnx;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
+import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
/**
* Converts Onnx tensors into Vespa tensors.
@@ -31,11 +34,16 @@ class TensorConverter {
private static Values readValuesOf(Onnx.TensorProto tensorProto) {
if (tensorProto.hasRawData()) {
switch (tensorProto.getDataType()) {
+ case BOOL: return new RawBoolValues(tensorProto);
case FLOAT: return new RawFloatValues(tensorProto);
+ case DOUBLE: return new RawDoubleValues(tensorProto);
+ case INT64: return new RawLongValues(tensorProto);
}
} else {
switch (tensorProto.getDataType()) {
case FLOAT: return new FloatValues(tensorProto);
+ case DOUBLE: return new DoubleValues(tensorProto);
+ case INT64: return new LongValues(tensorProto);
}
}
throw new IllegalArgumentException("Cannot convert a tensor with elements of type " +
@@ -55,6 +63,17 @@ class TensorConverter {
}
}
+ private static class RawBoolValues extends RawValues {
+ private final IntBuffer values;
+ private final int size;
+ RawBoolValues(Onnx.TensorProto tensorProto) {
+ values = bytes(tensorProto).asIntBuffer();
+ size = values.remaining();
+ }
+ @Override double get(int i) { return values.get(i); }
+ @Override int size() { return size; }
+ }
+
private static class RawFloatValues extends RawValues {
private final FloatBuffer values;
private final int size;
@@ -66,6 +85,28 @@ class TensorConverter {
@Override int size() { return size; }
}
+ private static class RawDoubleValues extends RawValues {
+ private final DoubleBuffer values;
+ private final int size;
+ RawDoubleValues(Onnx.TensorProto tensorProto) {
+ values = bytes(tensorProto).asDoubleBuffer();
+ size = values.remaining();
+ }
+ @Override double get(int i) { return values.get(i); }
+ @Override int size() { return size; }
+ }
+
+ private static class RawLongValues extends RawValues {
+ private final LongBuffer values;
+ private final int size;
+ RawLongValues(Onnx.TensorProto tensorProto) {
+ values = bytes(tensorProto).asLongBuffer();
+ size = values.remaining();
+ }
+ @Override double get(int i) { return values.get(i); }
+ @Override int size() { return size; }
+ }
+
private static class FloatValues extends Values {
private final Onnx.TensorProto tensorProto;
FloatValues(Onnx.TensorProto tensorProto) {
@@ -75,5 +116,22 @@ class TensorConverter {
@Override int size() { return tensorProto.getFloatDataCount(); }
}
+ private static class DoubleValues extends Values {
+ private final Onnx.TensorProto tensorProto;
+ DoubleValues(Onnx.TensorProto tensorProto) {
+ this.tensorProto = tensorProto;
+ }
+ @Override double get(int i) { return tensorProto.getDoubleData(i); }
+ @Override int size() { return tensorProto.getDoubleDataCount(); }
+ }
+
+ private static class LongValues extends Values {
+ private final Onnx.TensorProto tensorProto;
+ LongValues(Onnx.TensorProto tensorProto) {
+ this.tensorProto = tensorProto;
+ }
+ @Override double get(int i) { return tensorProto.getInt64Data(i); }
+ @Override int size() { return tensorProto.getInt64DataCount(); }
+ }
}
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TypeConverter.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TypeConverter.java
index 98ff8ca735f..7c8038cea66 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TypeConverter.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/onnx/TypeConverter.java
@@ -23,7 +23,8 @@ class TypeConverter {
int vespaIndex = type.dimensionMap(onnxIndex);
Onnx.TensorShapeProto.Dimension onnxDimension = shape.getDim(onnxIndex);
TensorType.Dimension vespaDimension = type.type().dimensions().get(vespaIndex);
- if (onnxDimension.getDimValue() != vespaDimension.size().orElse(-1L)) {
+ long onnxDimensionSize = onnxDimension.getDimValue() == 0 ? 1 : onnxDimension.getDimValue();
+ if (onnxDimensionSize != vespaDimension.size().orElse(-1L)) {
throw new IllegalArgumentException("Onnx dimensions of does not match Vespa dimensions");
}
}
@@ -37,8 +38,9 @@ class TypeConverter {
for (int i = 0; i < shape.getDimCount(); ++ i) {
String dimensionName = dimensionPrefix + i;
Onnx.TensorShapeProto.Dimension onnxDimension = shape.getDim(i);
- if (onnxDimension.getDimValue() >= 0) {
- builder.add(TensorType.Dimension.indexed(dimensionName, onnxDimension.getDimValue()));
+ long onnxDimensionSize = onnxDimension.getDimValue() == 0 ? 1 : onnxDimension.getDimValue();
+ if (onnxDimensionSize >= 0) {
+ builder.add(TensorType.Dimension.indexed(dimensionName, onnxDimensionSize));
} else {
builder.add(TensorType.Dimension.indexed(dimensionName));
}
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Argument.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Argument.java
index dad4508bc61..f68372ce4dd 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Argument.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Argument.java
@@ -3,7 +3,6 @@ package ai.vespa.rankingexpression.importer.operations;
import ai.vespa.rankingexpression.importer.OrderedTensorType;
import ai.vespa.rankingexpression.importer.DimensionRenamer;
-import com.yahoo.tensor.TensorType;
import com.yahoo.tensor.evaluation.VariableTensor;
import com.yahoo.tensor.functions.Rename;
import com.yahoo.tensor.functions.TensorFunction;
@@ -39,7 +38,16 @@ public class Argument extends IntermediateOperation {
@Override
public void addDimensionNameConstraints(DimensionRenamer renamer) {
- addConstraintsFrom(type, renamer);
+ for (int i = 0; i < type.dimensions().size(); i++) {
+ renamer.addDimension(type.dimensions().get(i).name());
+
+ // Each dimension is distinct and ordered correctly:
+ for (int j = i + 1; j < type.dimensions().size(); j++) {
+ renamer.addConstraint(type.dimensions().get(i).name(), type.dimensions().get(j).name(),
+ DimensionRenamer.Constraint.lessThan(false),
+ this);
+ }
+ }
}
@Override
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/ExpandDims.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/ExpandDims.java
index e6cc96d48ad..3487d889338 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/ExpandDims.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/ExpandDims.java
@@ -82,9 +82,7 @@ public class ExpandDims extends IntermediateOperation {
@Override
public void addDimensionNameConstraints(DimensionRenamer renamer) {
- for (TensorType.Dimension dimension : type.type().dimensions()) {
- renamer.addDimension(dimension.name());
- }
+ addConstraintsFrom(type, renamer);
}
@Override
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Gemm.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Gemm.java
new file mode 100644
index 00000000000..f091ae165d1
--- /dev/null
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Gemm.java
@@ -0,0 +1,183 @@
+// 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.operations;
+
+import ai.vespa.rankingexpression.importer.DimensionRenamer;
+import ai.vespa.rankingexpression.importer.OrderedTensorType;
+import com.yahoo.searchlib.rankingexpression.evaluation.DoubleValue;
+import com.yahoo.searchlib.rankingexpression.rule.ArithmeticNode;
+import com.yahoo.searchlib.rankingexpression.rule.ArithmeticOperator;
+import com.yahoo.searchlib.rankingexpression.rule.ConstantNode;
+import com.yahoo.searchlib.rankingexpression.rule.TensorFunctionNode;
+import com.yahoo.tensor.TensorType;
+import com.yahoo.tensor.functions.ScalarFunctions;
+import com.yahoo.tensor.functions.TensorFunction;
+import com.yahoo.text.ExpressionFormatter;
+
+import java.util.List;
+import java.util.Optional;
+
+public class Gemm extends IntermediateOperation {
+
+ private final AttributeMap attributeMap;
+ private final float alpha, beta;
+ private final int transposeA, transposeB;
+
+ private final static DoubleValue zero = DoubleValue.frozen(0.0);
+ private final static DoubleValue one = DoubleValue.frozen(1.0);
+
+ public Gemm(String modelName, String nodeName, List<IntermediateOperation> inputs, AttributeMap attributeMap) {
+ super(modelName, nodeName, inputs);
+ this.attributeMap = attributeMap;
+ this.alpha = (float) attributeMap.get("alpha").orElse(one).asDouble();
+ this.beta = (float) attributeMap.get("beta").orElse(one).asDouble();
+ this.transposeA = (int) attributeMap.get("transA").orElse(zero).asDouble();
+ this.transposeB = (int) attributeMap.get("transB").orElse(zero).asDouble();
+ }
+
+ @Override
+ protected OrderedTensorType lazyGetType() {
+ if ( ! check2or3InputsPresent()) return null;
+
+ OrderedTensorType.Builder typeBuilder = new OrderedTensorType.Builder(resultValueType());
+
+ TensorType.Dimension dimA = inputs.get(0).type().get().dimensions().get(transposeA);
+ TensorType.Dimension dimB = inputs.get(1).type().get().dimensions().get(1 - transposeB);
+
+ typeBuilder.add(dimA);
+ typeBuilder.add(dimB);
+ OrderedTensorType result = typeBuilder.build();
+
+ // Input tensor C. The shape of C should be unidirectional "broadcastable" to (dimA, dimB).
+ if (inputs.size() == 3) {
+ List<TensorType.Dimension> cDimensions = inputs.get(2).type().get().dimensions();
+ if (cDimensions.size() == 2) {
+ TensorType.Dimension dimC0 = cDimensions.get(0);
+ TensorType.Dimension dimC1 = cDimensions.get(1);
+
+ if ( ! (dimA.size().get().equals(dimC0.size().get()) || dimC0.size().get() == 1) ) {
+ throw new IllegalArgumentException("GEMM: type of optional input C " + inputs.get(2).type().get() +
+ " is not compatible or not broadcastable to " + result.type());
+ }
+ if ( ! (dimB.size().get().equals(dimC1.size().get()) || dimC1.size().get() == 1) ) {
+ throw new IllegalArgumentException("GEMM: type of optional input C " + inputs.get(2).type().get() +
+ " is not compatible or not broadcastable to " + result.type());
+ }
+
+ } else if (cDimensions.size() == 1) {
+ TensorType.Dimension dimC0 = cDimensions.get(0);
+ if ( ! (dimB.size().get().equals(dimC0.size().get()) || dimC0.size().get() == 1) ) {
+ throw new IllegalArgumentException("GEMM: type of optional input C " + inputs.get(2).type().get() +
+ " is not compatible or not broadcastable to " + result.type());
+ }
+ } else {
+ throw new IllegalArgumentException("GEMM: optional input C has no dimensions.");
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ protected TensorFunction lazyGetFunction() {
+ if ( ! check2or3InputsPresent()) return null;
+
+ OrderedTensorType aType = inputs.get(0).type().get();
+ OrderedTensorType bType = inputs.get(1).type().get();
+ if (aType.type().rank() != 2 || bType.type().rank() != 2)
+ throw new IllegalArgumentException("Tensors in Gemm must have rank of exactly 2");
+
+ Optional<TensorFunction> aFunction = inputs.get(0).function();
+ Optional<TensorFunction> bFunction = inputs.get(1).function();
+ if (aFunction.isEmpty() || bFunction.isEmpty()) {
+ return null;
+ }
+
+ String joinDimension = aType.dimensions().get(1).name(); // TODO: check wrt transpose!
+
+ TensorFunction AxB = new com.yahoo.tensor.functions.Matmul(aFunction.get(), bFunction.get(), joinDimension);
+ TensorFunction alphaxAxB = new TensorFunctionNode.ExpressionTensorFunction(
+ new ArithmeticNode(
+ new TensorFunctionNode(AxB),
+ ArithmeticOperator.MULTIPLY,
+ new ConstantNode(new DoubleValue(alpha))));
+
+ if (inputs.size() == 3) {
+ Optional<TensorFunction> cFunction = inputs.get(2).function();
+ TensorFunction betaxC = new TensorFunctionNode.ExpressionTensorFunction(
+ new ArithmeticNode(
+ new TensorFunctionNode(cFunction.get()),
+ ArithmeticOperator.MULTIPLY,
+ new ConstantNode(new DoubleValue(beta))));
+ return new com.yahoo.tensor.functions.Join(alphaxAxB, betaxC, ScalarFunctions.add());
+ }
+
+ return alphaxAxB;
+ }
+
+ private boolean check2or3InputsPresent() {
+ if (inputs.size() != 2 && inputs.size() != 3) {
+ throw new IllegalArgumentException("Expected 2 or 3 inputs for '" + name + "', got " + inputs.size());
+ }
+ return inputs.stream().map(IntermediateOperation::type).allMatch(Optional::isPresent);
+ }
+
+ @Override
+ public void addDimensionNameConstraints(DimensionRenamer renamer) {
+ if ( ! check2or3InputsPresent()) return;
+
+ List<TensorType.Dimension> aDimensions = inputs.get(0).type().get().dimensions();
+ List<TensorType.Dimension> bDimensions = inputs.get(1).type().get().dimensions();
+
+ assertTwoDimensions(aDimensions, inputs.get(0), "first argument");
+ assertTwoDimensions(bDimensions, inputs.get(1), "second argument");
+
+ String aDim0 = aDimensions.get(transposeA).name();
+ String aDim1 = aDimensions.get(1 - transposeA).name();
+ String bDim0 = bDimensions.get(transposeB).name();
+ String bDim1 = bDimensions.get(1 - transposeB).name();
+
+ // The second dimension of a should have the same name as the first dimension of b
+ renamer.addConstraint(aDim1, bDim0, DimensionRenamer.Constraint.equal(false), this);
+
+ // The first dimension of a should have a different name than the second dimension of b
+ renamer.addConstraint(aDim0, bDim1, DimensionRenamer.Constraint.lessThan(false), this);
+
+ // If c is given, should be unidirectionally broadcastable to tensor a * b:
+ // Tensor A and B both have exactly the same shape.
+ // Tensor A and B all have the same number of dimensions and the length of each dimensions is either a common length or B's length is 1.
+ // Tensor B has too few dimensions, and B can have its shapes prepended with a dimension of length 1 to satisfy property 2.
+ if (inputs.size() == 3) {
+ List<TensorType.Dimension> cDimensions = inputs.get(2).type().get().dimensions();
+
+ if (cDimensions.size() == 2) {
+ String cDim0 = cDimensions.get(0).name();
+ String cDim1 = cDimensions.get(1).name();
+ renamer.addConstraint(aDim0, cDim0, DimensionRenamer.Constraint.equal(false), this);
+ renamer.addConstraint(bDim1, cDim1, DimensionRenamer.Constraint.equal(false), this);
+ } else if (cDimensions.size() == 1) {
+ String cDim0 = cDimensions.get(0).name();
+ renamer.addConstraint(bDim1, cDim0, DimensionRenamer.Constraint.equal(false), this);
+ }
+ }
+
+ // For efficiency, the dimensions to join over should be innermost - soft constraint
+ renamer.addConstraint(aDim0, aDim1, DimensionRenamer.Constraint.lessThan(true), this);
+ renamer.addConstraint(bDim0, bDim1, DimensionRenamer.Constraint.greaterThan(true), this);
+ }
+
+ private void assertTwoDimensions(List<TensorType.Dimension> dimensions, IntermediateOperation supplier, String inputDescription) {
+ if (dimensions.size() >= 2) return;
+ throw new IllegalArgumentException("Expected 2 dimensions in the " + inputDescription + " to " + this +
+ " but got just " + dimensions + " from\n" +
+ ExpressionFormatter.inTwoColumnMode(70, 50).format(supplier.toFullString()));
+ }
+
+ @Override
+ public Gemm withInputs(List<IntermediateOperation> inputs) {
+ return new Gemm(modelName(), name(), inputs, attributeMap);
+ }
+
+ @Override
+ public String operationName() { return "Gemm"; }
+
+}
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 87a3f1a8e66..bd302afa5c7 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
@@ -5,6 +5,10 @@ package ai.vespa.rankingexpression.importer.operations;
import ai.vespa.rankingexpression.importer.DimensionRenamer;
import ai.vespa.rankingexpression.importer.OrderedTensorType;
import com.yahoo.searchlib.rankingexpression.Reference;
+import com.yahoo.searchlib.rankingexpression.evaluation.Context;
+import com.yahoo.searchlib.rankingexpression.evaluation.DoubleValue;
+import com.yahoo.searchlib.rankingexpression.evaluation.MapContext;
+import com.yahoo.searchlib.rankingexpression.evaluation.TensorValue;
import com.yahoo.searchlib.rankingexpression.evaluation.Value;
import com.yahoo.searchlib.rankingexpression.rule.ExpressionNode;
import com.yahoo.searchlib.rankingexpression.rule.ReferenceNode;
@@ -51,7 +55,7 @@ public abstract class IntermediateOperation {
IntermediateOperation(String modelName, String name, List<IntermediateOperation> inputs) {
this.name = name;
this.modelName = modelName;
- this.inputs = Collections.unmodifiableList(inputs);
+ this.inputs = new ArrayList<>(inputs);
this.inputs.forEach(i -> i.outputs.add(this));
}
@@ -178,6 +182,73 @@ public abstract class IntermediateOperation {
return verifyInputs(expected, IntermediateOperation::function);
}
+ /** Recursively evaluates this operation's constant value to avoid doing it run-time. */
+ public Value evaluateAsConstant(OrderedTensorType type) {
+ if ( ! isConstant() ) {
+ throw new IllegalArgumentException("Attempted to evaluate non-constant operation as a constant.");
+ }
+ Value val = evaluateAsConstant(new MapContext(DoubleValue.NaN));
+ if ( ! val.asTensor().type().equals(type.type()) ) {
+ throw new IllegalArgumentException("Constant evaluation in " + name + " resulted in wrong type. " +
+ "Expected: " + type.type() + " Got: " + val.asTensor().type());
+ }
+ return val;
+ }
+
+ private Value evaluateAsConstant(Context context) {
+ String constantName = "constant(" + vespaName() + ")";
+ Value result = context.get(constantName);
+ if (result == DoubleValue.NaN) {
+ if (inputs.size() == 0) {
+ if (getConstantValue().isEmpty()) {
+ throw new IllegalArgumentException("Error in evaluating constant for " + name);
+ }
+ result = getConstantValue().get();
+ } else {
+ inputs.forEach(i -> i.evaluateAsConstant(context));
+ result = new TensorValue(lazyGetFunction().evaluate(context));
+ }
+ context.put(constantName, result);
+ }
+ return result;
+ }
+
+ /** Insert an operation between an input and this one */
+ public void insert(IntermediateOperation operationToInsert, int inputNumber) {
+ if ( operationToInsert.inputs.size() > 0 ) {
+ throw new IllegalArgumentException("Operation to insert to '" + name + "' has " +
+ "existing inputs which is not supported.");
+ }
+ IntermediateOperation previousInputOperation = inputs.get(inputNumber);
+ int outputNumber = findOutputNumber(previousInputOperation, this);
+ if (outputNumber == -1) {
+ throw new IllegalArgumentException("Input '" + previousInputOperation.name + "' to '" +
+ name + "' does not have '" + name + "' as output.");
+ }
+ previousInputOperation.outputs.set(outputNumber, operationToInsert);
+ operationToInsert.inputs.add(previousInputOperation);
+ operationToInsert.outputs.add(this);
+ inputs.set(inputNumber, operationToInsert);
+ }
+
+ /** Remove an operation between an input and this one */
+ public void uninsert(int inputNumber) {
+ IntermediateOperation operationToRemove = inputs.get(inputNumber);
+ IntermediateOperation newInputOperation = operationToRemove.inputs.get(0);
+ int outputNumber = findOutputNumber(newInputOperation, operationToRemove);
+ newInputOperation.outputs.set(outputNumber, this);
+ inputs.set(inputNumber, newInputOperation);
+ }
+
+ private int findOutputNumber(IntermediateOperation output, IntermediateOperation op) {
+ for (int i = 0; i < output.outputs.size(); ++i) {
+ if (output.outputs.get(i).equals(op)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
/**
* Returns the largest value type among the input value types.
* This should only be called after it has been verified that input types are available.
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/MatMul.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/MatMul.java
index 434261c6077..6849e64641e 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/MatMul.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/MatMul.java
@@ -73,8 +73,6 @@ public class MatMul extends IntermediateOperation {
private void assertTwoDimensions(List<TensorType.Dimension> dimensions, IntermediateOperation supplier, String inputDescription) {
if (dimensions.size() >= 2) return;
-
-
throw new IllegalArgumentException("Expected 2 dimensions in the " + inputDescription + " to " + this +
" but got just " + dimensions + " from\n" +
ExpressionFormatter.inTwoColumnMode(70, 50).format(supplier.toFullString()));
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/OnnxConcat.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/OnnxConcat.java
new file mode 100644
index 00000000000..ded76db60fe
--- /dev/null
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/OnnxConcat.java
@@ -0,0 +1,105 @@
+// 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.operations;
+
+import ai.vespa.rankingexpression.importer.DimensionRenamer;
+import ai.vespa.rankingexpression.importer.OrderedTensorType;
+import com.yahoo.tensor.TensorType;
+import com.yahoo.tensor.functions.TensorFunction;
+
+import java.util.List;
+import java.util.Optional;
+
+public class OnnxConcat extends IntermediateOperation {
+
+ private final AttributeMap attributeMap;
+ private String concatDimensionName;
+ private int concatDimensionIndex;
+
+ public OnnxConcat(String modelName, String nodeName, List<IntermediateOperation> inputs, AttributeMap attributeMap) {
+ super(modelName, nodeName, inputs);
+ this.attributeMap = attributeMap;
+ if (attributeMap.get("axis").isEmpty())
+ throw new IllegalArgumentException("OnnxConcat in " + name + ": Required attribute 'axis' is missing.");
+ this.concatDimensionIndex = (int) attributeMap.get("axis").get().asDouble();
+ }
+
+ @Override
+ protected OrderedTensorType lazyGetType() {
+ if ( ! inputs.stream().map(IntermediateOperation::type).allMatch(Optional::isPresent)) return null;
+
+ OrderedTensorType aType = inputs.get(0).type().get();
+ long concatDimSize = aType.dimensions().get(concatDimensionIndex).size().orElse(-1L);
+
+ for (int i = 1; i < inputs.size(); ++i) {
+ OrderedTensorType bType = inputs.get(i).type().get();
+ if (bType.rank() != aType.rank())
+ throw new IllegalArgumentException("OnnxConcat in " + name + ": Inputs must have the same rank.");
+
+ for (int j = 0; j < aType.rank(); ++j) {
+ long dimSizeA = aType.dimensions().get(j).size().orElse(-1L);
+ long dimSizeB = bType.dimensions().get(j).size().orElse(-1L);
+ if (j == concatDimensionIndex) {
+ concatDimSize += dimSizeB;
+ } else if (dimSizeA != dimSizeB) {
+ throw new IllegalArgumentException("OnnxConcat in " + name + ": " +
+ "input dimension " + j + " differs in input tensors.");
+ }
+ }
+ }
+
+ OrderedTensorType.Builder typeBuilder = new OrderedTensorType.Builder(resultValueType());
+ int dimensionIndex = 0;
+ for (TensorType.Dimension dimension : aType.dimensions()) {
+ if (dimensionIndex == concatDimensionIndex) {
+ concatDimensionName = dimension.name();
+ typeBuilder.add(TensorType.Dimension.indexed(concatDimensionName, concatDimSize));
+ } else {
+ typeBuilder.add(dimension);
+ }
+ dimensionIndex++;
+ }
+ return typeBuilder.build();
+ }
+
+ @Override
+ protected TensorFunction lazyGetFunction() {
+ if (!inputs.stream().map(IntermediateOperation::function).allMatch(Optional::isPresent)) {
+ return null;
+ }
+ TensorFunction result = inputs.get(0).function().get();
+ for (int i = 1; i < inputs.size(); ++i) {
+ TensorFunction b = inputs.get(i).function().get();
+ result = new com.yahoo.tensor.functions.Concat(result, b, concatDimensionName);
+ }
+ return result;
+ }
+
+ @Override
+ public void addDimensionNameConstraints(DimensionRenamer renamer) {
+ if (!inputs.stream().map(IntermediateOperation::type).allMatch(Optional::isPresent)) {
+ return;
+ }
+ OrderedTensorType a = inputs.get(0).type().get();
+ for (int i = 1; i < inputs.size(); ++i) {
+ OrderedTensorType b = inputs.get(i).type().get();
+ String bDim = b.dimensions().get(concatDimensionIndex).name();
+ String aDim = a.dimensions().get(concatDimensionIndex).name();
+ renamer.addConstraint(aDim, bDim, DimensionRenamer.Constraint.equal(false), this);
+ }
+ }
+
+ @Override
+ public void renameDimensions(DimensionRenamer renamer) {
+ super.renameDimensions(renamer);
+ concatDimensionName = renamer.dimensionNameOf(concatDimensionName).orElse(concatDimensionName);
+ }
+
+ @Override
+ public OnnxConcat withInputs(List<IntermediateOperation> inputs) {
+ return new OnnxConcat(modelName(), name(), inputs, attributeMap);
+ }
+
+ @Override
+ public String operationName() { return "ConcatV2"; }
+
+}
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reduce.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reduce.java
new file mode 100644
index 00000000000..1b2d9ac090e
--- /dev/null
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reduce.java
@@ -0,0 +1,121 @@
+// 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.operations;
+
+import ai.vespa.rankingexpression.importer.DimensionRenamer;
+import ai.vespa.rankingexpression.importer.OrderedTensorType;
+import com.yahoo.searchlib.rankingexpression.evaluation.DoubleValue;
+import com.yahoo.searchlib.rankingexpression.evaluation.Value;
+import com.yahoo.searchlib.rankingexpression.rule.ConstantNode;
+import com.yahoo.searchlib.rankingexpression.rule.ExpressionNode;
+import com.yahoo.searchlib.rankingexpression.rule.GeneratorLambdaFunctionNode;
+import com.yahoo.tensor.TensorType;
+import com.yahoo.tensor.functions.Generate;
+import com.yahoo.tensor.functions.ScalarFunctions;
+import com.yahoo.tensor.functions.TensorFunction;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * ONNX Reduce[Sum/Mean/etc] operation
+ */
+public class Reduce extends IntermediateOperation {
+
+ private final AttributeMap attributeMap;
+ private final com.yahoo.tensor.functions.Reduce.Aggregator aggregator;
+
+ private List<String> reduceDimensions;
+
+ public Reduce(String modelName, String nodeName,
+ List<IntermediateOperation> inputs,
+ AttributeMap attributeMap,
+ com.yahoo.tensor.functions.Reduce.Aggregator aggregator) {
+ super(modelName, nodeName, inputs);
+ this.attributeMap = attributeMap;
+ this.aggregator = aggregator;
+ }
+
+ @Override
+ protected OrderedTensorType lazyGetType() {
+ if ( ! allInputTypesPresent(1)) return null;
+
+ OrderedTensorType inputType = inputs.get(0).type().get();
+
+ reduceDimensions = inputType.dimensionNames(); // default is to reduce all dimensions
+ if (attributeMap.getList("axes").isPresent()) {
+ reduceDimensions = new ArrayList<>();
+ for (Value i : attributeMap.getList("axes").get()) {
+ int dimensionIndex = (int) i.asDouble();
+ if (dimensionIndex < 0) {
+ dimensionIndex = inputType.dimensions().size() - dimensionIndex;
+ }
+ reduceDimensions.add(inputType.dimensions().get(dimensionIndex).name());
+ }
+ }
+ return reducedType(inputType, shouldKeepDimensions());
+ }
+
+ @Override
+ protected TensorFunction lazyGetFunction() {
+ if ( ! allInputTypesPresent(1)) return null;
+
+ TensorFunction inputFunction = inputs.get(0).function().get();
+ TensorFunction output = new com.yahoo.tensor.functions.Reduce(inputFunction, aggregator, reduceDimensions);
+ if (shouldKeepDimensions()) {
+ // multiply with a generated tensor created from the reduced dimensions
+ TensorType.Builder typeBuilder = new TensorType.Builder(resultValueType());
+ for (String name : reduceDimensions) {
+ typeBuilder.indexed(name, 1);
+ }
+ TensorType generatedType = typeBuilder.build();
+ ExpressionNode generatedExpression = new ConstantNode(new DoubleValue(1));
+ Generate generatedFunction = new Generate(generatedType,
+ new GeneratorLambdaFunctionNode(generatedType, generatedExpression).asLongListToDoubleOperator());
+ output = new com.yahoo.tensor.functions.Join(output, generatedFunction, ScalarFunctions.multiply());
+ }
+ return output;
+ }
+
+ @Override
+ public void renameDimensions(DimensionRenamer renamer) {
+ super.renameDimensions(renamer);
+ List<String> renamedDimensions = new ArrayList<>(reduceDimensions.size());
+ for (String name : reduceDimensions) {
+ Optional<String> newName = renamer.dimensionNameOf(name);
+ if (newName.isEmpty()) {
+ return; // presumably, already renamed
+ }
+ renamedDimensions.add(newName.get());
+ }
+ reduceDimensions = renamedDimensions;
+ }
+
+ @Override
+ public Reduce withInputs(List<IntermediateOperation> inputs) {
+ return new Reduce(modelName(), name(), inputs, attributeMap, aggregator);
+ }
+
+ @Override
+ public String operationName() { return "Reduce"; }
+
+ private boolean shouldKeepDimensions() {
+ Optional<Value> keepDims = attributeMap.get("keepdims");
+ return keepDims.isPresent() && keepDims.get().asBoolean();
+ }
+
+ private OrderedTensorType reducedType(OrderedTensorType inputType, boolean keepDimensions) {
+ OrderedTensorType.Builder builder = new OrderedTensorType.Builder(resultValueType());
+ for (TensorType.Dimension dimension: inputType.type().dimensions()) {
+ if ( ! reduceDimensions.contains(dimension.name())) {
+ builder.add(dimension);
+ } else if (keepDimensions) {
+ builder.add(TensorType.Dimension.indexed(dimension.name(), 1L));
+ }
+ }
+ return builder.build();
+ }
+
+
+
+}
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Rename.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Rename.java
index abc431233be..e040ae62149 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Rename.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Rename.java
@@ -6,6 +6,7 @@ import ai.vespa.rankingexpression.importer.OrderedTensorType;
import com.yahoo.tensor.TensorType;
import com.yahoo.tensor.functions.TensorFunction;
+import java.util.Collections;
import java.util.List;
/**
@@ -15,10 +16,10 @@ import java.util.List;
*/
public class Rename extends IntermediateOperation {
- private final String from, to;
+ private String from, to;
public Rename(String modelName, String from, String to, IntermediateOperation input) {
- super(modelName, "rename", List.of(input));
+ super(modelName, "rename", input != null ? List.of(input) : Collections.emptyList());
this.from = from;
this.to = to;
}
@@ -52,6 +53,12 @@ public class Rename extends IntermediateOperation {
renamer.addDimension(to);
}
+ public void renameDimensions(DimensionRenamer renamer) {
+ type = type.rename(renamer);
+ from = renamer.dimensionNameOf(from).orElse(from);
+ to = renamer.dimensionNameOf(to).orElse(to);
+ }
+
@Override
public Rename withInputs(List<IntermediateOperation> inputs) {
if (inputs.size() != 1)
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reshape.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reshape.java
index a210ed13f5d..c7accd00619 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reshape.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Reshape.java
@@ -8,6 +8,7 @@ import com.yahoo.searchlib.rankingexpression.rule.ArithmeticNode;
import com.yahoo.searchlib.rankingexpression.rule.ArithmeticOperator;
import com.yahoo.searchlib.rankingexpression.rule.ComparisonNode;
import com.yahoo.searchlib.rankingexpression.rule.ConstantNode;
+import com.yahoo.searchlib.rankingexpression.rule.EmbracedNode;
import com.yahoo.searchlib.rankingexpression.rule.ExpressionNode;
import com.yahoo.searchlib.rankingexpression.rule.GeneratorLambdaFunctionNode;
import com.yahoo.searchlib.rankingexpression.rule.ReferenceNode;
@@ -16,6 +17,7 @@ import com.yahoo.tensor.Tensor;
import com.yahoo.tensor.TensorType;
import com.yahoo.tensor.functions.Generate;
import com.yahoo.tensor.functions.Reduce;
+import com.yahoo.tensor.functions.Rename;
import com.yahoo.tensor.functions.ScalarFunctions;
import com.yahoo.tensor.functions.TensorFunction;
@@ -35,7 +37,7 @@ public class Reshape extends IntermediateOperation {
if ( ! allInputTypesPresent(2)) return null;
IntermediateOperation newShape = inputs.get(1);
- if ( ! newShape.getConstantValue().isPresent())
+ if (newShape.getConstantValue().isEmpty())
throw new IllegalArgumentException("Reshape in " + name + ": Shape input must be a constant.");
Tensor shape = newShape.getConstantValue().get().asTensor();
@@ -69,9 +71,7 @@ public class Reshape extends IntermediateOperation {
@Override
public void addDimensionNameConstraints(DimensionRenamer renamer) {
- for (TensorType.Dimension dimension : type.type().dimensions()) {
- renamer.addDimension(dimension.name());
- }
+ addConstraintsFrom(type, renamer);
}
@Override
@@ -89,17 +89,40 @@ public class Reshape extends IntermediateOperation {
// the new shape. We have to introduce temporary dimension names and rename back if dimension names
// in the new and old tensor type overlap.
+ List<String> from = new ArrayList<>();
+ List<String> to = new ArrayList<>();
+ boolean dimensionNamesOverlap = dimensionNamesOverlap(inputType, outputType);
+ if (dimensionNamesOverlap) {
+ TensorType.Builder builder = new TensorType.Builder(outputType.valueType());
+ for (int i = 0; i < outputType.rank(); ++i) {
+ TensorType.Dimension dim = outputType.dimensions().get(i);
+ from.add(dim.name());
+ to.add("temp_" + dim.name());
+ builder.dimension(dim.withName("temp_" + dim.name()));
+ }
+ outputType = builder.build();
+ }
+
ExpressionNode unrollFrom = unrollTensorExpression(inputType);
ExpressionNode unrollTo = unrollTensorExpression(outputType);
- ExpressionNode transformExpression = new ComparisonNode(unrollFrom, TruthOperator.EQUAL, unrollTo);
+ ExpressionNode transformExpression = new ComparisonNode(unrollFrom, TruthOperator.EQUAL, new EmbracedNode(unrollTo));
TensorType transformationType = new TensorType.Builder(inputType, outputType).build();
Generate transformTensor = new Generate(transformationType,
new GeneratorLambdaFunctionNode(transformationType, transformExpression).asLongListToDoubleOperator());
- return new Reduce(new com.yahoo.tensor.functions.Join(inputFunction, transformTensor, ScalarFunctions.multiply()),
+ TensorFunction result = new Reduce(new com.yahoo.tensor.functions.Join(inputFunction, transformTensor, ScalarFunctions.multiply()),
Reduce.Aggregator.sum,
inputType.dimensions().stream().map(TensorType.Dimension::name).collect(Collectors.toList()));
+
+ if (dimensionNamesOverlap) {
+ result = new Rename(result, to, from);
+ }
+ return result;
+ }
+
+ private static boolean dimensionNamesOverlap(TensorType a, TensorType b) {
+ return a.dimensionNames().stream().anyMatch(d -> b.dimension(d).isPresent());
}
private static ExpressionNode unrollTensorExpression(TensorType type) {
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Select.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Select.java
index 35a1b6e2b0e..8696d0f1858 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Select.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Select.java
@@ -51,6 +51,9 @@ public class Select extends IntermediateOperation {
if (condition.type().rank() == 1 && dimensionSize(condition.type().dimensions().get(0)) == 1) {
return condition.cellIterator().next().getValue().intValue() == 0 ? b : a;
}
+ if (condition.type().rank() == 2 && dimensionSize(condition.type().dimensions().get(0)) == 1 && dimensionSize(condition.type().dimensions().get(1)) == 1) {
+ return condition.cellIterator().next().getValue().intValue() == 0 ? b : a;
+ }
}
// The task is to select cells from 'x' or 'y' based on 'condition'.
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Squeeze.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Squeeze.java
index 56d9b542093..a9e3fc6a43a 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Squeeze.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/operations/Squeeze.java
@@ -31,7 +31,10 @@ public class Squeeze extends IntermediateOperation {
squeezeDimensions = new ArrayList<>();
Optional<List<Value>> squeezeDimsAttr = attributeMap.getList("squeeze_dims");
- if ( ! squeezeDimsAttr.isPresent()) {
+ if (squeezeDimsAttr.isEmpty()) {
+ squeezeDimsAttr = attributeMap.getList("axes"); // ONNX
+ }
+ if (squeezeDimsAttr.isEmpty()) {
squeezeDimensions = inputType.type().dimensions().stream().
filter(dim -> OrderedTensorType.dimensionSize(dim) == 1).
map(TensorType.Dimension::name).
@@ -62,7 +65,7 @@ public class Squeeze extends IntermediateOperation {
List<String> renamedDimensions = new ArrayList<>(squeezeDimensions.size());
for (String name : squeezeDimensions) {
Optional<String> newName = renamer.dimensionNameOf(name);
- if (!newName.isPresent()) {
+ if (newName.isEmpty()) {
return; // presumably, already renamed
}
renamedDimensions.add(newName.get());
diff --git a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/PyTorchImportTestCase.java b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/PyTorchImportTestCase.java
new file mode 100644
index 00000000000..f03c629df78
--- /dev/null
+++ b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/PyTorchImportTestCase.java
@@ -0,0 +1,22 @@
+// 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.onnx;
+
+import ai.vespa.rankingexpression.importer.ImportedModel;
+import com.yahoo.tensor.Tensor;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author lesters
+ */
+public class PyTorchImportTestCase extends TestableModel {
+
+ @Test
+ public void testPyTorchExport() {
+ ImportedModel model = new OnnxImporter().importModel("test", "src/test/models/pytorch/pytorch.onnx");
+ Tensor onnxResult = evaluateVespa(model, "output", model.inputs());
+ assertEquals(Tensor.from("tensor(d0[1],d1[2]):[[0.28258783057229725, -0.0685615853647904]]"), onnxResult);
+ }
+
+}
diff --git a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/TestableModel.java b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/TestableModel.java
new file mode 100644
index 00000000000..c5355ebdf6f
--- /dev/null
+++ b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/TestableModel.java
@@ -0,0 +1,122 @@
+// 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.onnx;
+
+import ai.vespa.rankingexpression.importer.ImportedModel;
+import ai.vespa.rankingexpression.importer.tensorflow.TensorConverter;
+import com.yahoo.searchlib.rankingexpression.RankingExpression;
+import com.yahoo.searchlib.rankingexpression.evaluation.Context;
+import com.yahoo.searchlib.rankingexpression.evaluation.ContextIndex;
+import com.yahoo.searchlib.rankingexpression.evaluation.ExpressionOptimizer;
+import com.yahoo.searchlib.rankingexpression.evaluation.MapContext;
+import com.yahoo.searchlib.rankingexpression.evaluation.TensorValue;
+import com.yahoo.searchlib.rankingexpression.rule.CompositeNode;
+import com.yahoo.searchlib.rankingexpression.rule.ExpressionNode;
+import com.yahoo.searchlib.rankingexpression.rule.ReferenceNode;
+import com.yahoo.tensor.Tensor;
+import com.yahoo.tensor.TensorType;
+import org.tensorflow.SavedModelBundle;
+import org.tensorflow.Session;
+
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+
+public class TestableModel {
+
+ Tensor evaluateVespa(ImportedModel model, String operationName, Map<String, TensorType> inputs) {
+ Context context = contextFrom(model);
+ for (Map.Entry<String, TensorType> entry : inputs.entrySet()) {
+ Tensor argument = vespaInputArgument(1, entry.getValue().dimensions().get(1).size().get().intValue());
+ context.put(entry.getKey(), new TensorValue(argument));
+ }
+ model.functions().forEach((k, v) -> evaluateFunction(context, model, k));
+ RankingExpression expression = model.expressions().get(operationName);
+ ExpressionOptimizer optimizer = new ExpressionOptimizer();
+ optimizer.optimize(expression, (ContextIndex)context);
+ return expression.evaluate(context).asTensor();
+ }
+
+ Tensor evaluateTF(SavedModelBundle tensorFlowModel, String operationName, Map<String, TensorType> inputs) {
+ Session.Runner runner = tensorFlowModel.session().runner();
+ for (Map.Entry<String, TensorType> entry : inputs.entrySet()) {
+ try {
+ runner.feed(entry.getKey(), tensorFlowFloatInputArgument(1, entry.getValue().dimensions().get(1).size().get().intValue()));
+ } catch (Exception e) {
+ runner.feed(entry.getKey(), tensorFlowDoubleInputArgument(1, entry.getValue().dimensions().get(1).size().get().intValue()));
+ }
+ }
+ List<org.tensorflow.Tensor<?>> results = runner.fetch(operationName).run();
+ assertEquals(1, results.size());
+ return TensorConverter.toVespaTensor(results.get(0));
+ }
+
+ private org.tensorflow.Tensor<?> tensorFlowFloatInputArgument(int d0Size, int d1Size) {
+ FloatBuffer fb1 = FloatBuffer.allocate(d0Size * d1Size);
+ int i = 0;
+ for (int d0 = 0; d0 < d0Size; d0++)
+ for (int d1 = 0; d1 < d1Size; ++d1)
+ fb1.put(i++, (float)(d1 * 1.0 / d1Size));
+ return org.tensorflow.Tensor.create(new long[]{ d0Size, d1Size }, fb1);
+ }
+
+ private org.tensorflow.Tensor<?> tensorFlowDoubleInputArgument(int d0Size, int d1Size) {
+ DoubleBuffer fb1 = DoubleBuffer.allocate(d0Size * d1Size);
+ int i = 0;
+ for (int d0 = 0; d0 < d0Size; d0++)
+ for (int d1 = 0; d1 < d1Size; ++d1)
+ fb1.put(i++, (float)(d1 * 1.0 / d1Size));
+ return org.tensorflow.Tensor.create(new long[]{ d0Size, d1Size }, fb1);
+ }
+
+ private Tensor vespaInputArgument(int d0Size, int d1Size) {
+ Tensor.Builder b = Tensor.Builder.of(new TensorType.Builder().indexed("d0", d0Size).indexed("d1", d1Size).build());
+ for (int d0 = 0; d0 < d0Size; d0++)
+ for (int d1 = 0; d1 < d1Size; d1++)
+ b.cell(d1 * 1.0 / d1Size, d0, d1);
+ return b.build();
+ }
+
+ private void evaluateFunction(Context context, ImportedModel model, String functionName) {
+ if (!context.names().contains(functionName)) {
+ RankingExpression e = RankingExpression.from(model.functions().get(functionName));
+ evaluateFunctionDependencies(context, model, e.getRoot());
+ context.put(functionName, new TensorValue(e.evaluate(context).asTensor()));
+ }
+ }
+
+ private void evaluateFunctionDependencies(Context context, ImportedModel model, ExpressionNode node) {
+ if (node instanceof ReferenceNode) {
+ String name = node.toString();
+ if (model.functions().containsKey(name)) {
+ evaluateFunction(context, model, name);
+ }
+ }
+ else if (node instanceof CompositeNode) {
+ for (ExpressionNode child : ((CompositeNode)node).children()) {
+ evaluateFunctionDependencies(context, model, child);
+ }
+ }
+ }
+
+ static Context contextFrom(ImportedModel result) {
+ TestableModelContext context = new TestableModelContext();
+ result.largeConstants().forEach((name, tensor) -> context.put("constant(" + name + ")", new TensorValue(Tensor.from(tensor))));
+ result.smallConstants().forEach((name, tensor) -> context.put("constant(" + name + ")", new TensorValue(Tensor.from(tensor))));
+ return context;
+ }
+
+ private static class TestableModelContext extends MapContext implements ContextIndex {
+ @Override
+ public int size() {
+ return bindings().size();
+ }
+ @Override
+ public int getIndex(String name) {
+ throw new UnsupportedOperationException(this + " does not support index lookup by name");
+ }
+ }
+
+}
diff --git a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/Tf2OnnxImportTestCase.java b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/Tf2OnnxImportTestCase.java
new file mode 100644
index 00000000000..4250fee4d20
--- /dev/null
+++ b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/Tf2OnnxImportTestCase.java
@@ -0,0 +1,153 @@
+// 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.onnx;
+
+import ai.vespa.rankingexpression.importer.ImportedModel;
+import ai.vespa.rankingexpression.importer.tensorflow.TensorFlowImporter;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.yahoo.collections.Pair;
+import com.yahoo.system.ProcessExecuter;
+import com.yahoo.tensor.Tensor;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.tensorflow.SavedModelBundle;
+
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Tries to convert a set of TensorFlow models to ONNX using the tf2onnx tool,
+ * and asserts that the result when evaluated on TensorFlow, the imported
+ * TensorFlow model and the imported ONNX model are equal.
+ *
+ * Requires the tf2onnx tool to be installed so the test itself should be ignored.
+ *
+ * @author lesters
+ */
+public class Tf2OnnxImportTestCase extends TestableModel {
+
+ @Rule
+ public TemporaryFolder testFolder = new TemporaryFolder();
+
+ @Test
+ @Ignore
+ public void testOnnxConversionAndImport() {
+ Report report = new Report();
+ for (int i = 11; i < 12; ++i) {
+ testModelsWithOpset(report, i);
+ }
+ System.out.println(report);
+ }
+
+ private void testModelsWithOpset(Report report, int opset) {
+ String [] models = {
+ "tensorflow/mnist/saved/",
+ "tensorflow/mnist_softmax/saved/",
+ "tensorflow/9662/",
+ "tensorflow/regression/test1/",
+ "tensorflow/regression/test2/",
+ "tensorflow/softmax/saved/",
+ "tensorflow/blog/saved/",
+ "tensorflow/batch_norm/saved/",
+ "tensorflow/dropout/saved/",
+ "tensorflow/external/Model_A/optimized_v2/",
+ "tensorflow/external/Model_B/factorization_machine_v1/export/optimized/",
+ "tensorflow/external/Model_B/factorization_machine_v1/export/standard/",
+ "tensorflow/external/Model_C/factorization_machine_v1/export/optimized/",
+ "tensorflow/external/Model_C/factorization_machine_v1/export/standard/",
+ "tensorflow/external/modelv1/",
+ "tensorflow/external/modelv2/"
+ };
+ for (String model : models) {
+ try {
+ testModelWithOpset(report, opset, "src/test/models/" + model);
+ } catch (Exception e) {
+ report.add(model, opset, false, "Exception: " + e.getMessage());
+ }
+ }
+ }
+
+ private boolean testModelWithOpset(Report report, int opset, String tfModel) throws IOException {
+ String onnxModel = Paths.get(testFolder.getRoot().getAbsolutePath(), "converted.onnx").toString();
+
+ var res = tf2onnxConvert(tfModel, onnxModel, opset);
+ if (res.getFirst() != 0) {
+ return reportAndFail(report, opset, tfModel, "tf2onnx conversion failed: " + res.getSecond());
+ }
+
+ SavedModelBundle tensorFlowModel = SavedModelBundle.load(tfModel, "serve");
+ ImportedModel model = new TensorFlowImporter().importModel("test", tfModel, tensorFlowModel);
+ ImportedModel onnxImportedModel = new OnnxImporter().importModel("test", onnxModel);
+
+ if (model.signature("serving_default").skippedOutputs().size() > 0) {
+ return reportAndFail(report, opset, tfModel, "Failed to import model from TensorFlow due to skipped outputs");
+ }
+ if (onnxImportedModel.signature("default").skippedOutputs().size() > 0) {
+ return reportAndFail(report, opset, tfModel, "Failed to import model from ONNX due to skipped outputs");
+ }
+
+ ImportedModel.Signature sig = model.signatures().values().iterator().next();
+ String output = sig.outputs().values().iterator().next();
+ String onnxOutput = onnxImportedModel.signatures().values().iterator().next().outputs().values().iterator().next();
+
+ Tensor tfResult = evaluateTF(tensorFlowModel, output, model.inputs());
+ Tensor vespaResult = evaluateVespa(model, output, model.inputs());
+ Tensor onnxResult = evaluateVespa(onnxImportedModel, onnxOutput, model.inputs());
+
+ if ( ! tfResult.equals(vespaResult) ) {
+ return reportAndFail(report, opset, tfModel, "Diff between tf and imported tf evaluation:\n\t" + tfResult + "\n\t" + vespaResult);
+ }
+ if ( ! vespaResult.equals(onnxResult) ) {
+ return reportAndFail(report, opset, tfModel, "Diff between imported tf eval and onnx eval:\n\t" + vespaResult + "\n\t" + onnxResult);
+ }
+
+ return reportAndSucceed(report, opset, tfModel, "Ok");
+ }
+
+ private Pair<Integer, String> tf2onnxConvert(String savedModel, String output, int opset) throws IOException {
+ ProcessExecuter executer = new ProcessExecuter();
+ String job = "python3 -m tf2onnx.convert --saved-model " + savedModel + " --output " + output + " --opset " + opset;
+ return executer.exec(job);
+ }
+
+ private static class Report {
+ final ObjectMapper mapper = new ObjectMapper();
+ final Map<String, ArrayNode> results = new HashMap<>();
+
+ public boolean add(String model, int opset, boolean ok, String desc) {
+ ObjectNode obj = mapper.createObjectNode().
+ put("opset", opset).
+ put("ok", ok).
+ put("desc", desc);
+ results.computeIfAbsent(model, r -> mapper.createArrayNode()).add(obj);
+ return ok;
+ }
+
+ public String toString() {
+ ArrayNode array = mapper.createArrayNode();
+ results.forEach((key, value) -> array.add(mapper.createObjectNode().
+ put("model", key).
+ set("tests", value)));
+ try {
+ return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(array);
+ } catch (JsonProcessingException e) {
+ return e.getMessage();
+ }
+ }
+ }
+
+ private static boolean reportAndFail(Report report, int opset, String model, String desc) {
+ return report.add(model, opset, false, desc);
+ }
+
+ private static boolean reportAndSucceed(Report report, int opset, String model, String desc) {
+ return report.add(model, opset, true, desc);
+ }
+
+}
diff --git a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/Issue9662TestCase.java b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/Issue9662TestCase.java
index ca172440ec7..25b36535b50 100644
--- a/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/Issue9662TestCase.java
+++ b/model-integration/src/test/java/ai/vespa/rankingexpression/importer/tensorflow/Issue9662TestCase.java
@@ -22,7 +22,7 @@ public class Issue9662TestCase {
ImportedMlFunction output = signature.outputFunction("output", "output");
assertNotNull(output);
- model.assertEqualResultSum("input_embedding_user_guid", "dense_out/MatMul", 0.0001);
+ model.assertEqualResultSum("input_embedding_user_guid", "dense_out/Sigmoid", 0.0001);
}
}
diff --git a/model-integration/src/test/models/pytorch/pytorch.onnx b/model-integration/src/test/models/pytorch/pytorch.onnx
new file mode 100644
index 00000000000..c940265b58b
--- /dev/null
+++ b/model-integration/src/test/models/pytorch/pytorch.onnx
Binary files differ
diff --git a/model-integration/src/test/models/pytorch/pytorch_test.py b/model-integration/src/test/models/pytorch/pytorch_test.py
new file mode 100755
index 00000000000..d2adb6c8974
--- /dev/null
+++ b/model-integration/src/test/models/pytorch/pytorch_test.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+
+import torch
+
+# ref: https://pytorch.org/tutorials/beginner/pytorch_with_examples.html
+
+# N is batch size; D_in is input dimension;
+# H is hidden dimension; D_out is output dimension.
+N, D_in, H, D_out = 1, 10, 5, 2
+
+# Create random Tensors to hold inputs and outputs
+x = torch.randn(N, D_in)
+y = torch.randn(N, D_out)
+
+# Use the nn package to define our model as a sequence of layers. nn.Sequential
+# is a Module which contains other Modules, and applies them in sequence to
+# produce its output. Each Linear Module computes output from input using a
+# linear function, and holds internal Tensors for its weight and bias.
+model = torch.nn.Sequential(
+ torch.nn.Linear(D_in, H),
+ torch.nn.ReLU(),
+ torch.nn.Linear(H, D_out),
+)
+
+# The nn package also contains definitions of popular loss functions; in this
+# case we will use Mean Squared Error (MSE) as our loss function.
+loss_fn = torch.nn.MSELoss(reduction='sum')
+
+learning_rate = 1e-4
+for t in range(500):
+ # Forward pass: compute predicted y by passing x to the model. Module objects
+ # override the __call__ operator so you can call them like functions. When
+ # doing so you pass a Tensor of input data to the Module and it produces
+ # a Tensor of output data.
+ y_pred = model(x)
+
+ # Compute and print loss. We pass Tensors containing the predicted and true
+ # values of y, and the loss function returns a Tensor containing the
+ # loss.
+ loss = loss_fn(y_pred, y)
+ if t % 100 == 99:
+ print(t, loss.item())
+
+ # Zero the gradients before running the backward pass.
+ model.zero_grad()
+
+ # Backward pass: compute gradient of the loss with respect to all the learnable
+ # parameters of the model. Internally, the parameters of each Module are stored
+ # in Tensors with requires_grad=True, so this call will compute gradients for
+ # all learnable parameters in the model.
+ loss.backward()
+
+ # Update the weights using gradient descent. Each parameter is a Tensor, so
+ # we can access its gradients like we did before.
+ with torch.no_grad():
+ for param in model.parameters():
+ param -= learning_rate * param.grad
+
+
+torch.onnx.export(model, x, "pytorch.onnx", verbose=True, opset_version=7, input_names=["input"], output_names=["output"])
+
+test_input = torch.tensor([ [i/D_in for i in range(D_in)] ])
+print(model(test_input)) # for Vespa validation
+
+
+
diff --git a/model-integration/src/test/models/tensorflow/external/Model_A/optimized_v2/saved_model.pbtxt b/model-integration/src/test/models/tensorflow/external/Model_A/optimized_v2/saved_model.pbtxt
new file mode 100644
index 00000000000..d2dc51ac328
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_A/optimized_v2/saved_model.pbtxt
@@ -0,0 +1,1368 @@
+saved_model_schema_version: 1
+meta_graphs {
+ meta_info_def {
+ stripped_op_list {
+ op {
+ name: "Add"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ type: DT_STRING
+ }
+ }
+ }
+ }
+ op {
+ name: "BiasAdd"
+ input_arg {
+ name: "value"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "bias"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "data_format"
+ type: "string"
+ default_value {
+ s: "NHWC"
+ }
+ allowed_values {
+ list {
+ s: "NHWC"
+ s: "NCHW"
+ }
+ }
+ }
+ }
+ op {
+ name: "Const"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "value"
+ type: "tensor"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ }
+ op {
+ name: "ExpandDims"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dim"
+ type_attr: "Tdim"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tdim"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "MatMul"
+ input_arg {
+ name: "a"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "b"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "product"
+ type_attr: "T"
+ }
+ attr {
+ name: "transpose_a"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "transpose_b"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Maximum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Mul"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Placeholder"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ default_value {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ op {
+ name: "PlaceholderWithDefault"
+ input_arg {
+ name: "input"
+ type_attr: "dtype"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ }
+ }
+ op {
+ name: "Rsqrt"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sigmoid"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Square"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sum"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ }
+ tags: "serve"
+ tensorflow_version: "1.13.1"
+ tensorflow_git_version: "b\'v1.13.1-0-g6612da8951\'"
+ }
+ graph_def {
+ node {
+ name: "keras_learning_phase/input"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_BOOL
+ tensor_shape {
+ }
+ bool_val: false
+ }
+ }
+ }
+ }
+ node {
+ name: "keras_learning_phase"
+ op: "PlaceholderWithDefault"
+ input: "keras_learning_phase/input"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 9.999999960041972e-13
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ float_val: -1.049525499343872
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_mean"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul/_0__cf__0"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.9995003938674927
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/sub/_1__cf__1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_user_guid"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Square"
+ op: "Square"
+ input: "input_embedding_user_guid"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize_1/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize_1/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize_1/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1"
+ op: "Mul"
+ input: "input_embedding_user_guid"
+ input: "dot_0/l2_normalize_1/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_product_slug"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Square"
+ op: "Square"
+ input: "input_embedding_product_slug"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize"
+ op: "Mul"
+ input: "input_embedding_product_slug"
+ input: "dot_0/l2_normalize/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Mul"
+ op: "Mul"
+ input: "dot_0/l2_normalize"
+ input: "dot_0/l2_normalize_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Sum"
+ op: "Sum"
+ input: "dot_0/Mul"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dot_0/ExpandDims"
+ op: "ExpandDims"
+ input: "dot_0/Sum"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul_1"
+ op: "Mul"
+ input: "dot_0/ExpandDims"
+ input: "batch_norm/batchnorm/mul/_0__cf__0"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/add_1"
+ op: "Add"
+ input: "batch_norm/batchnorm/mul_1"
+ input: "batch_norm/batchnorm/sub/_1__cf__1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/MatMul"
+ op: "MatMul"
+ input: "batch_norm/batchnorm/add_1"
+ input: "dense_out/kernel"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "transpose_a"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "transpose_b"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dense_out/BiasAdd"
+ op: "BiasAdd"
+ input: "dense_out/MatMul"
+ input: "batch_norm/moving_mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+ }
+ node {
+ name: "dense_out/Sigmoid"
+ op: "Sigmoid"
+ input: "dense_out/BiasAdd"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ versions {
+ }
+ }
+ signature_def {
+ key: "serving_default"
+ value {
+ inputs {
+ key: "input_embedding_product_slug"
+ value {
+ name: "input_embedding_product_slug:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ inputs {
+ key: "input_embedding_user_guid"
+ value {
+ name: "input_embedding_user_guid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ outputs {
+ key: "output"
+ value {
+ name: "dense_out/Sigmoid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ method_name: "tensorflow/serving/predict"
+ }
+ }
+}
diff --git a/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/optimized/saved_model.pbtxt b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/optimized/saved_model.pbtxt
new file mode 100644
index 00000000000..102428b2cf2
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/optimized/saved_model.pbtxt
@@ -0,0 +1,1368 @@
+saved_model_schema_version: 1
+meta_graphs {
+ meta_info_def {
+ stripped_op_list {
+ op {
+ name: "Add"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ type: DT_STRING
+ }
+ }
+ }
+ }
+ op {
+ name: "BiasAdd"
+ input_arg {
+ name: "value"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "bias"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "data_format"
+ type: "string"
+ default_value {
+ s: "NHWC"
+ }
+ allowed_values {
+ list {
+ s: "NHWC"
+ s: "NCHW"
+ }
+ }
+ }
+ }
+ op {
+ name: "Const"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "value"
+ type: "tensor"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ }
+ op {
+ name: "ExpandDims"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dim"
+ type_attr: "Tdim"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tdim"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "MatMul"
+ input_arg {
+ name: "a"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "b"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "product"
+ type_attr: "T"
+ }
+ attr {
+ name: "transpose_a"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "transpose_b"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Maximum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Mul"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Placeholder"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ default_value {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ op {
+ name: "PlaceholderWithDefault"
+ input_arg {
+ name: "input"
+ type_attr: "dtype"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ }
+ }
+ op {
+ name: "Rsqrt"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sigmoid"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Square"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sum"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ }
+ tags: "serve"
+ tensorflow_version: "1.13.1"
+ tensorflow_git_version: "b\'v1.13.1-0-g6612da8951\'"
+ }
+ graph_def {
+ node {
+ name: "keras_learning_phase/input"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_BOOL
+ tensor_shape {
+ }
+ bool_val: false
+ }
+ }
+ }
+ }
+ node {
+ name: "keras_learning_phase"
+ op: "PlaceholderWithDefault"
+ input: "keras_learning_phase/input"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 9.999999960041972e-13
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ float_val: -1.278536081314087
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_mean"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul/_0__cf__2"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.9995003938674927
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/sub/_1__cf__3"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_user_guid"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Square"
+ op: "Square"
+ input: "input_embedding_user_guid"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize_1/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize_1/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize_1/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1"
+ op: "Mul"
+ input: "input_embedding_user_guid"
+ input: "dot_0/l2_normalize_1/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_product_slug"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Square"
+ op: "Square"
+ input: "input_embedding_product_slug"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize"
+ op: "Mul"
+ input: "input_embedding_product_slug"
+ input: "dot_0/l2_normalize/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Mul"
+ op: "Mul"
+ input: "dot_0/l2_normalize"
+ input: "dot_0/l2_normalize_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Sum"
+ op: "Sum"
+ input: "dot_0/Mul"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dot_0/ExpandDims"
+ op: "ExpandDims"
+ input: "dot_0/Sum"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul_1"
+ op: "Mul"
+ input: "dot_0/ExpandDims"
+ input: "batch_norm/batchnorm/mul/_0__cf__2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/add_1"
+ op: "Add"
+ input: "batch_norm/batchnorm/mul_1"
+ input: "batch_norm/batchnorm/sub/_1__cf__3"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/MatMul"
+ op: "MatMul"
+ input: "batch_norm/batchnorm/add_1"
+ input: "dense_out/kernel"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "transpose_a"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "transpose_b"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dense_out/BiasAdd"
+ op: "BiasAdd"
+ input: "dense_out/MatMul"
+ input: "batch_norm/moving_mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+ }
+ node {
+ name: "dense_out/Sigmoid"
+ op: "Sigmoid"
+ input: "dense_out/BiasAdd"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ versions {
+ }
+ }
+ signature_def {
+ key: "serving_default"
+ value {
+ inputs {
+ key: "input_embedding_product_slug"
+ value {
+ name: "input_embedding_product_slug:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ inputs {
+ key: "input_embedding_user_guid"
+ value {
+ name: "input_embedding_user_guid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ outputs {
+ key: "output"
+ value {
+ name: "dense_out/Sigmoid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ method_name: "tensorflow/serving/predict"
+ }
+ }
+}
diff --git a/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/saved_model.pbtxt b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/saved_model.pbtxt
new file mode 100644
index 00000000000..50aee0ebcf7
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/saved_model.pbtxt
@@ -0,0 +1,11403 @@
+saved_model_schema_version: 1
+meta_graphs {
+ meta_info_def {
+ stripped_op_list {
+ op {
+ name: "Abs"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Add"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ type: DT_STRING
+ }
+ }
+ }
+ }
+ op {
+ name: "Assert"
+ input_arg {
+ name: "condition"
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "data"
+ type_list_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "summarize"
+ type: "int"
+ default_value {
+ i: 3
+ }
+ }
+ is_stateful: true
+ }
+ op {
+ name: "AssignAddVariableOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ input_arg {
+ name: "value"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "AssignVariableOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ input_arg {
+ name: "value"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "BiasAdd"
+ input_arg {
+ name: "value"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "bias"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "data_format"
+ type: "string"
+ default_value {
+ s: "NHWC"
+ }
+ allowed_values {
+ list {
+ s: "NHWC"
+ s: "NCHW"
+ }
+ }
+ }
+ }
+ op {
+ name: "Cast"
+ input_arg {
+ name: "x"
+ type_attr: "SrcT"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "DstT"
+ }
+ attr {
+ name: "SrcT"
+ type: "type"
+ }
+ attr {
+ name: "DstT"
+ type: "type"
+ }
+ attr {
+ name: "Truncate"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ }
+ op {
+ name: "ConcatV2"
+ input_arg {
+ name: "values"
+ type_attr: "T"
+ number_attr: "N"
+ }
+ input_arg {
+ name: "axis"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 2
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Const"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "value"
+ type: "tensor"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ }
+ op {
+ name: "DenseToDenseSetOperation"
+ input_arg {
+ name: "set1"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "set2"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "result_indices"
+ type: DT_INT64
+ }
+ output_arg {
+ name: "result_values"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "result_shape"
+ type: DT_INT64
+ }
+ attr {
+ name: "set_operation"
+ type: "string"
+ }
+ attr {
+ name: "validate_indices"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_UINT16
+ type: DT_STRING
+ }
+ }
+ }
+ }
+ op {
+ name: "DivNoNan"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ }
+ op {
+ name: "Equal"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_QUINT8
+ type: DT_QINT8
+ type: DT_QINT32
+ type: DT_STRING
+ type: DT_BOOL
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Exp"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "ExpandDims"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dim"
+ type_attr: "Tdim"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tdim"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Fill"
+ input_arg {
+ name: "dims"
+ type_attr: "index_type"
+ }
+ input_arg {
+ name: "value"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "index_type"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Greater"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_INT64
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ }
+ op {
+ name: "GreaterEqual"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_INT64
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Identity"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ op {
+ name: "Log"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Log1p"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "MatMul"
+ input_arg {
+ name: "a"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "b"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "product"
+ type_attr: "T"
+ }
+ attr {
+ name: "transpose_a"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "transpose_b"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Maximum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Mean"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Merge"
+ input_arg {
+ name: "inputs"
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "value_index"
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ }
+ op {
+ name: "MergeV2Checkpoints"
+ input_arg {
+ name: "checkpoint_prefixes"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "destination_prefix"
+ type: DT_STRING
+ }
+ attr {
+ name: "delete_old_dirs"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ is_stateful: true
+ }
+ op {
+ name: "Minimum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Mul"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Neg"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "NoOp"
+ }
+ op {
+ name: "Pack"
+ input_arg {
+ name: "values"
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "axis"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ }
+ }
+ op {
+ name: "Placeholder"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ default_value {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ op {
+ name: "PlaceholderWithDefault"
+ input_arg {
+ name: "input"
+ type_attr: "dtype"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ }
+ }
+ op {
+ name: "ReadVariableOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ output_arg {
+ name: "value"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "RealDiv"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "RestoreV2"
+ input_arg {
+ name: "prefix"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_names"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shape_and_slices"
+ type: DT_STRING
+ }
+ output_arg {
+ name: "tensors"
+ type_list_attr: "dtypes"
+ }
+ attr {
+ name: "dtypes"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ is_stateful: true
+ }
+ op {
+ name: "Rsqrt"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "SaveV2"
+ input_arg {
+ name: "prefix"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_names"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shape_and_slices"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensors"
+ type_list_attr: "dtypes"
+ }
+ attr {
+ name: "dtypes"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ is_stateful: true
+ }
+ op {
+ name: "Select"
+ input_arg {
+ name: "condition"
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "t"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "e"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ op {
+ name: "Shape"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "out_type"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "out_type"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "ShardedFilename"
+ input_arg {
+ name: "basename"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shard"
+ type: DT_INT32
+ }
+ input_arg {
+ name: "num_shards"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "filename"
+ type: DT_STRING
+ }
+ }
+ op {
+ name: "Sigmoid"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Size"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "out_type"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "out_type"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Square"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "StringJoin"
+ input_arg {
+ name: "inputs"
+ type: DT_STRING
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ type: DT_STRING
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "separator"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ }
+ }
+ op {
+ name: "Sub"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sum"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Switch"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "pred"
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "output_false"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_true"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ op {
+ name: "TruncatedNormal"
+ input_arg {
+ name: "shape"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_HALF
+ type: DT_BFLOAT16
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_stateful: true
+ }
+ op {
+ name: "VarHandleOp"
+ output_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "VarIsInitializedOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ output_arg {
+ name: "is_initialized"
+ type: DT_BOOL
+ }
+ is_stateful: true
+ }
+ op {
+ name: "ZerosLike"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ }
+ tags: "serve"
+ tensorflow_version: "1.13.1"
+ tensorflow_git_version: "b\'v1.13.1-0-g6612da8951\'"
+ }
+ graph_def {
+ node {
+ name: "keras_learning_phase/input"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_BOOL
+ tensor_shape {
+ }
+ bool_val: false
+ }
+ }
+ }
+ }
+ node {
+ name: "keras_learning_phase"
+ op: "PlaceholderWithDefault"
+ input: "keras_learning_phase/input"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_product_slug"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_user_guid"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Square"
+ op: "Square"
+ input: "input_embedding_product_slug"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 9.999999960041972e-13
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize"
+ op: "Mul"
+ input: "input_embedding_product_slug"
+ input: "dot_0/l2_normalize/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Square"
+ op: "Square"
+ input: "input_embedding_user_guid"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize_1/Square"
+ input: "dot_0/l2_normalize_1/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Maximum/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 9.999999960041972e-13
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize_1/Sum"
+ input: "dot_0/l2_normalize_1/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize_1/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1"
+ op: "Mul"
+ input: "input_embedding_user_guid"
+ input: "dot_0/l2_normalize_1/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Mul"
+ op: "Mul"
+ input: "dot_0/l2_normalize"
+ input: "dot_0/l2_normalize_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Sum"
+ op: "Sum"
+ input: "dot_0/Mul"
+ input: "dot_0/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dot_0/ExpandDims/dim"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/ExpandDims"
+ op: "ExpandDims"
+ input: "dot_0/Sum"
+ input: "dot_0/ExpandDims/dim"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/gamma/Initializer/ones"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/gamma"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/gamma"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/gamma"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "batch_norm/gamma"
+ }
+ }
+ }
+ node {
+ name: "batch_norm/gamma/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/gamma"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/gamma/Assign"
+ op: "AssignVariableOp"
+ input: "batch_norm/gamma"
+ input: "batch_norm/gamma/Initializer/ones"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/gamma"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/gamma/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "batch_norm/gamma"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/gamma"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/beta/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/beta"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/beta"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/beta"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "batch_norm/beta"
+ }
+ }
+ }
+ node {
+ name: "batch_norm/beta/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/beta"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/beta/Assign"
+ op: "AssignVariableOp"
+ input: "batch_norm/beta"
+ input: "batch_norm/beta/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/beta"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/beta/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "batch_norm/beta"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/beta"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_mean/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_mean"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_mean"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_mean"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "batch_norm/moving_mean"
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_mean/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/moving_mean"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_mean/Assign"
+ op: "AssignVariableOp"
+ input: "batch_norm/moving_mean"
+ input: "batch_norm/moving_mean/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_mean"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_mean/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "batch_norm/moving_mean"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_mean"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_variance/Initializer/ones"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_variance"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_variance"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_variance"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "batch_norm/moving_variance"
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_variance/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/moving_variance"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_variance/Assign"
+ op: "AssignVariableOp"
+ input: "batch_norm/moving_variance"
+ input: "batch_norm/moving_variance/Initializer/ones"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_variance"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/moving_variance/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "batch_norm/moving_variance"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@batch_norm/moving_variance"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "batch_norm/moving_variance"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/add/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0010000000474974513
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/add"
+ op: "Add"
+ input: "batch_norm/batchnorm/ReadVariableOp"
+ input: "batch_norm/batchnorm/add/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/Rsqrt"
+ op: "Rsqrt"
+ input: "batch_norm/batchnorm/add"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "batch_norm/gamma"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul"
+ op: "Mul"
+ input: "batch_norm/batchnorm/Rsqrt"
+ input: "batch_norm/batchnorm/mul/ReadVariableOp"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul_1"
+ op: "Mul"
+ input: "dot_0/ExpandDims"
+ input: "batch_norm/batchnorm/mul"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "batch_norm/moving_mean"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/mul_2"
+ op: "Mul"
+ input: "batch_norm/batchnorm/ReadVariableOp_1"
+ input: "batch_norm/batchnorm/mul"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/ReadVariableOp_2"
+ op: "ReadVariableOp"
+ input: "batch_norm/beta"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/sub"
+ op: "Sub"
+ input: "batch_norm/batchnorm/ReadVariableOp_2"
+ input: "batch_norm/batchnorm/mul_2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "batch_norm/batchnorm/add_1"
+ op: "Add"
+ input: "batch_norm/batchnorm/mul_1"
+ input: "batch_norm/batchnorm/sub"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Initializer/truncated_normal/shape"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ }
+ tensor_content: "\001\000\000\000\001\000\000\000"
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Initializer/truncated_normal/mean"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Initializer/truncated_normal/stddev"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.607744812965393
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Initializer/truncated_normal/TruncatedNormal"
+ op: "TruncatedNormal"
+ input: "dense_out/kernel/Initializer/truncated_normal/shape"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "seed"
+ value {
+ i: 0
+ }
+ }
+ attr {
+ key: "seed2"
+ value {
+ i: 0
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Initializer/truncated_normal/mul"
+ op: "Mul"
+ input: "dense_out/kernel/Initializer/truncated_normal/TruncatedNormal"
+ input: "dense_out/kernel/Initializer/truncated_normal/stddev"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Initializer/truncated_normal"
+ op: "Add"
+ input: "dense_out/kernel/Initializer/truncated_normal/mul"
+ input: "dense_out/kernel/Initializer/truncated_normal/mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "dense_out/kernel"
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "dense_out/kernel"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Assign"
+ op: "AssignVariableOp"
+ input: "dense_out/kernel"
+ input: "dense_out/kernel/Initializer/truncated_normal"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "dense_out/kernel/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "dense_out/kernel"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/kernel"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "dense_out/bias/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/bias"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/bias"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/bias"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "dense_out/bias"
+ }
+ }
+ }
+ node {
+ name: "dense_out/bias/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "dense_out/bias"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out/bias/Assign"
+ op: "AssignVariableOp"
+ input: "dense_out/bias"
+ input: "dense_out/bias/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/bias"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "dense_out/bias/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "dense_out/bias"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@dense_out/bias"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "dense_out/MatMul/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "dense_out/kernel"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "dense_out/MatMul"
+ op: "MatMul"
+ input: "batch_norm/batchnorm/add_1"
+ input: "dense_out/MatMul/ReadVariableOp"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "transpose_a"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "transpose_b"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dense_out/BiasAdd/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "dense_out/bias"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "dense_out/BiasAdd"
+ op: "BiasAdd"
+ input: "dense_out/MatMul"
+ input: "dense_out/BiasAdd/ReadVariableOp"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "data_format"
+ value {
+ s: "NHWC"
+ }
+ }
+ }
+ node {
+ name: "dense_out/Sigmoid"
+ op: "Sigmoid"
+ input: "dense_out/BiasAdd"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT64
+ tensor_shape {
+ }
+ int64_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/iterations"
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/iterations"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/iterations"
+ input: "Adam/iterations/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/iterations"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0010000000474974513
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/lr"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/lr"
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/lr"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/lr"
+ input: "Adam/lr/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/lr"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.8999999761581421
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/beta_1"
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/beta_1"
+ input: "Adam/beta_1/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/beta_1"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.9990000128746033
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/beta_2"
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_2"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/beta_2"
+ input: "Adam/beta_2/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/beta_2"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/decay"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/decay"
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/decay"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/decay"
+ input: "Adam/decay/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/decay"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "dense_out_target"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "dense_out_sample_weights"
+ op: "PlaceholderWithDefault"
+ input: "Const_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "total/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "total"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "total"
+ }
+ }
+ }
+ node {
+ name: "total/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "total"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "total/Assign"
+ op: "AssignVariableOp"
+ input: "total"
+ input: "total/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "total/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "count"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "count"
+ }
+ }
+ }
+ node {
+ name: "count/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "count"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "count/Assign"
+ op: "AssignVariableOp"
+ input: "count"
+ input: "count/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "count"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "total_1/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "total_1"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "total_1"
+ }
+ }
+ }
+ node {
+ name: "total_1/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "total_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "total_1/Assign"
+ op: "AssignVariableOp"
+ input: "total_1"
+ input: "total_1/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "total_1/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total_1"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count_1/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "count_1"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "count_1"
+ }
+ }
+ }
+ node {
+ name: "count_1/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "count_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "count_1/Assign"
+ op: "AssignVariableOp"
+ input: "count_1"
+ input: "count_1/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count_1/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "count_1"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0000000116860974e-07
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/sub/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/sub"
+ op: "Sub"
+ input: "loss/dense_out_loss/sub/x"
+ input: "loss/dense_out_loss/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/clip_by_value/Minimum"
+ op: "Minimum"
+ input: "dense_out/Sigmoid"
+ input: "loss/dense_out_loss/sub"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/clip_by_value"
+ op: "Maximum"
+ input: "loss/dense_out_loss/clip_by_value/Minimum"
+ input: "loss/dense_out_loss/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/sub_1/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/sub_1"
+ op: "Sub"
+ input: "loss/dense_out_loss/sub_1/x"
+ input: "loss/dense_out_loss/clip_by_value"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/truediv"
+ op: "RealDiv"
+ input: "loss/dense_out_loss/clip_by_value"
+ input: "loss/dense_out_loss/sub_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Log"
+ op: "Log"
+ input: "loss/dense_out_loss/truediv"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/zeros_like"
+ op: "ZerosLike"
+ input: "loss/dense_out_loss/Log"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/GreaterEqual"
+ op: "GreaterEqual"
+ input: "loss/dense_out_loss/Log"
+ input: "loss/dense_out_loss/logistic_loss/zeros_like"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/Select"
+ op: "Select"
+ input: "loss/dense_out_loss/logistic_loss/GreaterEqual"
+ input: "loss/dense_out_loss/Log"
+ input: "loss/dense_out_loss/logistic_loss/zeros_like"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/Neg"
+ op: "Neg"
+ input: "loss/dense_out_loss/Log"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/Select_1"
+ op: "Select"
+ input: "loss/dense_out_loss/logistic_loss/GreaterEqual"
+ input: "loss/dense_out_loss/logistic_loss/Neg"
+ input: "loss/dense_out_loss/Log"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/mul"
+ op: "Mul"
+ input: "loss/dense_out_loss/Log"
+ input: "dense_out_target"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/sub"
+ op: "Sub"
+ input: "loss/dense_out_loss/logistic_loss/Select"
+ input: "loss/dense_out_loss/logistic_loss/mul"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/Exp"
+ op: "Exp"
+ input: "loss/dense_out_loss/logistic_loss/Select_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss/Log1p"
+ op: "Log1p"
+ input: "loss/dense_out_loss/logistic_loss/Exp"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/logistic_loss"
+ op: "Add"
+ input: "loss/dense_out_loss/logistic_loss/sub"
+ input: "loss/dense_out_loss/logistic_loss/Log1p"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Mean/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Mean"
+ op: "Mean"
+ input: "loss/dense_out_loss/logistic_loss"
+ input: "loss/dense_out_loss/Mean/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ op: "Shape"
+ input: "dense_out_sample_weights"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ op: "Shape"
+ input: "loss/dense_out_loss/Mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/rank"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ op: "Equal"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar/x"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_t"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_f"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ op: "Equal"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/rank"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/rank"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims"
+ op: "ExpandDims"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ }
+ tensor_content: "\001\000\000\000\001\000\000\000"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like"
+ op: "Fill"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "index_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat"
+ op: "ConcatV2"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1"
+ op: "ExpandDims"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:1"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation"
+ op: "DenseToDenseSetOperation"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 2
+ }
+ }
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ shape {
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "set_operation"
+ value {
+ s: "a-b"
+ }
+ }
+ attr {
+ key: "validate_indices"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims"
+ op: "Size"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims"
+ op: "Equal"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge"
+ op: "Merge"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ op: "Merge"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:1"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights can not be broadcast to values."
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/Const_2"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "dense_out_sample_weights:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/Const_3"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "values.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/Const_4"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "loss/dense_out_loss/Mean:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/Const_5"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "is_scalar="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Switch"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Switch:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Switch"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/NoOp"
+ op: "NoOp"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/NoOp"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_0"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights can not be broadcast to values."
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_1"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_2"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "dense_out_sample_weights:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_4"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "values.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_5"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "loss/dense_out_loss/Mean:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_7"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "is_scalar="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert"
+ op: "Assert"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_0"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_1"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_2"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_4"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_5"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_7"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3"
+ attr {
+ key: "T"
+ value {
+ list {
+ type: DT_STRING
+ type: DT_STRING
+ type: DT_STRING
+ type: DT_INT32
+ type: DT_STRING
+ type: DT_STRING
+ type: DT_INT32
+ type: DT_STRING
+ type: DT_BOOL
+ }
+ }
+ }
+ attr {
+ key: "summarize"
+ value {
+ i: 3
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3"
+ op: "Switch"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency_1"
+ op: "Identity"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Merge"
+ op: "Merge"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency_1"
+ input: "loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/ones_like/Shape"
+ op: "Shape"
+ input: "loss/dense_out_loss/Mean"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Merge"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/ones_like/Const"
+ op: "Const"
+ input: "^loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Merge"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights/ones_like"
+ op: "Fill"
+ input: "loss/dense_out_loss/broadcast_weights/ones_like/Shape"
+ input: "loss/dense_out_loss/broadcast_weights/ones_like/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "index_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/broadcast_weights"
+ op: "Mul"
+ input: "dense_out_sample_weights"
+ input: "loss/dense_out_loss/broadcast_weights/ones_like"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Mul"
+ op: "Mul"
+ input: "loss/dense_out_loss/Mean"
+ input: "loss/dense_out_loss/broadcast_weights"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Sum"
+ op: "Sum"
+ input: "loss/dense_out_loss/Mul"
+ input: "loss/dense_out_loss/Const_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Const_2"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Sum_1"
+ op: "Sum"
+ input: "loss/dense_out_loss/broadcast_weights"
+ input: "loss/dense_out_loss/Const_2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/div_no_nan"
+ op: "DivNoNan"
+ input: "loss/dense_out_loss/Sum"
+ input: "loss/dense_out_loss/Sum_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Const_3"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/dense_out_loss/Mean_1"
+ op: "Mean"
+ input: "loss/dense_out_loss/div_no_nan"
+ input: "loss/dense_out_loss/Const_3"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/mul/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/mul"
+ op: "Mul"
+ input: "loss/mul/x"
+ input: "loss/dense_out_loss/Mean_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/Square/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "dense_out/kernel"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/Square"
+ op: "Square"
+ input: "loss/kernel/Regularizer/Square/ReadVariableOp"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/mul/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.10000000149011612
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/mul"
+ op: "Mul"
+ input: "loss/kernel/Regularizer/mul/x"
+ input: "loss/kernel/Regularizer/Square"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ }
+ tensor_content: "\000\000\000\000\001\000\000\000"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/Sum"
+ op: "Sum"
+ input: "loss/kernel/Regularizer/mul"
+ input: "loss/kernel/Regularizer/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/add/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/kernel/Regularizer/add"
+ op: "Add"
+ input: "loss/kernel/Regularizer/add/x"
+ input: "loss/kernel/Regularizer/Sum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/add"
+ op: "Add"
+ input: "loss/mul"
+ input: "loss/kernel/Regularizer/add"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.5
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Greater"
+ op: "Greater"
+ input: "dense_out/Sigmoid"
+ input: "metrics/acc/Cast/x"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_1"
+ op: "Cast"
+ input: "metrics/acc/Greater"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Equal"
+ op: "Equal"
+ input: "dense_out_target"
+ input: "metrics/acc/Cast_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_2"
+ op: "Cast"
+ input: "metrics/acc/Equal"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean"
+ op: "Mean"
+ input: "metrics/acc/Cast_2"
+ input: "metrics/acc/Mean/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Size"
+ op: "Size"
+ input: "metrics/acc/Mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_3"
+ op: "Cast"
+ input: "metrics/acc/Size"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Sum"
+ op: "Sum"
+ input: "metrics/acc/Mean"
+ input: "metrics/acc/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/AssignAddVariableOp"
+ op: "AssignAddVariableOp"
+ input: "total"
+ input: "metrics/acc/Sum"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total"
+ input: "^metrics/acc/AssignAddVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/AssignAddVariableOp_1"
+ op: "AssignAddVariableOp"
+ input: "count"
+ input: "metrics/acc/Cast_3"
+ input: "^metrics/acc/ReadVariableOp"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count"
+ input: "^metrics/acc/AssignAddVariableOp_1"
+ input: "^metrics/acc/ReadVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/div_no_nan/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total"
+ input: "^metrics/acc/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/div_no_nan/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count"
+ input: "^metrics/acc/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/div_no_nan"
+ op: "DivNoNan"
+ input: "metrics/acc/div_no_nan/ReadVariableOp"
+ input: "metrics/acc/div_no_nan/ReadVariableOp_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_4/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.5
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Greater_1"
+ op: "Greater"
+ input: "dense_out/Sigmoid"
+ input: "metrics/acc/Cast_4/x"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_5"
+ op: "Cast"
+ input: "metrics/acc/Greater_1"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Equal_1"
+ op: "Equal"
+ input: "dense_out_target"
+ input: "metrics/acc/Cast_5"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_6"
+ op: "Cast"
+ input: "metrics/acc/Equal_1"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean_1/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean_1"
+ op: "Mean"
+ input: "metrics/acc/Cast_6"
+ input: "metrics/acc/Mean_1/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean_2"
+ op: "Mean"
+ input: "metrics/acc/Mean_1"
+ input: "metrics/acc/Const_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/sub"
+ op: "Sub"
+ input: "dense_out/Sigmoid"
+ input: "dense_out_target"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Abs"
+ op: "Abs"
+ input: "metrics/mean_absolute_error/sub"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean"
+ op: "Mean"
+ input: "metrics/mean_absolute_error/Abs"
+ input: "metrics/mean_absolute_error/Mean/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Size"
+ op: "Size"
+ input: "metrics/mean_absolute_error/Mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Cast"
+ op: "Cast"
+ input: "metrics/mean_absolute_error/Size"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Sum"
+ op: "Sum"
+ input: "metrics/mean_absolute_error/Mean"
+ input: "metrics/mean_absolute_error/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/AssignAddVariableOp"
+ op: "AssignAddVariableOp"
+ input: "total_1"
+ input: "metrics/mean_absolute_error/Sum"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total_1"
+ input: "^metrics/mean_absolute_error/AssignAddVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/AssignAddVariableOp_1"
+ op: "AssignAddVariableOp"
+ input: "count_1"
+ input: "metrics/mean_absolute_error/Cast"
+ input: "^metrics/mean_absolute_error/ReadVariableOp"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count_1"
+ input: "^metrics/mean_absolute_error/AssignAddVariableOp_1"
+ input: "^metrics/mean_absolute_error/ReadVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total_1"
+ input: "^metrics/mean_absolute_error/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count_1"
+ input: "^metrics/mean_absolute_error/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/div_no_nan"
+ op: "DivNoNan"
+ input: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp"
+ input: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/sub_1"
+ op: "Sub"
+ input: "dense_out/Sigmoid"
+ input: "dense_out_target"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Abs_1"
+ op: "Abs"
+ input: "metrics/mean_absolute_error/sub_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean_1/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean_1"
+ op: "Mean"
+ input: "metrics/mean_absolute_error/Abs_1"
+ input: "metrics/mean_absolute_error/Mean_1/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean_2"
+ op: "Mean"
+ input: "metrics/mean_absolute_error/Mean_1"
+ input: "metrics/mean_absolute_error/Const_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "Placeholder"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "AssignVariableOp"
+ op: "AssignVariableOp"
+ input: "batch_norm/gamma"
+ input: "Placeholder"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "batch_norm/gamma"
+ input: "^AssignVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Placeholder_1"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "AssignVariableOp_1"
+ op: "AssignVariableOp"
+ input: "batch_norm/beta"
+ input: "Placeholder_1"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "batch_norm/beta"
+ input: "^AssignVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Placeholder_2"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "AssignVariableOp_2"
+ op: "AssignVariableOp"
+ input: "batch_norm/moving_mean"
+ input: "Placeholder_2"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "ReadVariableOp_2"
+ op: "ReadVariableOp"
+ input: "batch_norm/moving_mean"
+ input: "^AssignVariableOp_2"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Placeholder_3"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "AssignVariableOp_3"
+ op: "AssignVariableOp"
+ input: "batch_norm/moving_variance"
+ input: "Placeholder_3"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "ReadVariableOp_3"
+ op: "ReadVariableOp"
+ input: "batch_norm/moving_variance"
+ input: "^AssignVariableOp_3"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Placeholder_4"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "AssignVariableOp_4"
+ op: "AssignVariableOp"
+ input: "dense_out/kernel"
+ input: "Placeholder_4"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "ReadVariableOp_4"
+ op: "ReadVariableOp"
+ input: "dense_out/kernel"
+ input: "^AssignVariableOp_4"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Placeholder_5"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "AssignVariableOp_5"
+ op: "AssignVariableOp"
+ input: "dense_out/bias"
+ input: "Placeholder_5"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "ReadVariableOp_5"
+ op: "ReadVariableOp"
+ input: "dense_out/bias"
+ input: "^AssignVariableOp_5"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_2"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_1"
+ op: "VarIsInitializedOp"
+ input: "count_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_2"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/gamma"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_3"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/moving_variance"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_4"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/beta"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_5"
+ op: "VarIsInitializedOp"
+ input: "dense_out/kernel"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_6"
+ op: "VarIsInitializedOp"
+ input: "Adam/iterations"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_7"
+ op: "VarIsInitializedOp"
+ input: "total_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_8"
+ op: "VarIsInitializedOp"
+ input: "total"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_9"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_10"
+ op: "VarIsInitializedOp"
+ input: "Adam/lr"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_11"
+ op: "VarIsInitializedOp"
+ input: "batch_norm/moving_mean"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_12"
+ op: "VarIsInitializedOp"
+ input: "dense_out/bias"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_13"
+ op: "VarIsInitializedOp"
+ input: "count"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_14"
+ op: "VarIsInitializedOp"
+ input: "Adam/decay"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "init"
+ op: "NoOp"
+ input: "^Adam/beta_1/Assign"
+ input: "^Adam/beta_2/Assign"
+ input: "^Adam/decay/Assign"
+ input: "^Adam/iterations/Assign"
+ input: "^Adam/lr/Assign"
+ input: "^batch_norm/beta/Assign"
+ input: "^batch_norm/gamma/Assign"
+ input: "^batch_norm/moving_mean/Assign"
+ input: "^batch_norm/moving_variance/Assign"
+ input: "^count/Assign"
+ input: "^count_1/Assign"
+ input: "^dense_out/bias/Assign"
+ input: "^dense_out/kernel/Assign"
+ input: "^total/Assign"
+ input: "^total_1/Assign"
+ }
+ node {
+ name: "init_1"
+ op: "NoOp"
+ input: "^Adam/beta_1/Assign"
+ input: "^Adam/beta_2/Assign"
+ input: "^Adam/decay/Assign"
+ input: "^Adam/iterations/Assign"
+ input: "^Adam/lr/Assign"
+ input: "^batch_norm/beta/Assign"
+ input: "^batch_norm/gamma/Assign"
+ input: "^batch_norm/moving_mean/Assign"
+ input: "^batch_norm/moving_variance/Assign"
+ input: "^dense_out/bias/Assign"
+ input: "^dense_out/kernel/Assign"
+ }
+ node {
+ name: "init_2"
+ op: "NoOp"
+ }
+ node {
+ name: "group_deps"
+ op: "NoOp"
+ input: "^init_1"
+ input: "^init_2"
+ }
+ node {
+ name: "save/filename/input"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "model"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/filename"
+ op: "PlaceholderWithDefault"
+ input: "save/filename/input"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "save/Const"
+ op: "PlaceholderWithDefault"
+ input: "save/filename"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "save/StringJoin/inputs_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "_temp_7f2179765c0043bba293f5b2b9e7ba06/part"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/StringJoin"
+ op: "StringJoin"
+ input: "save/Const"
+ input: "save/StringJoin/inputs_1"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "separator"
+ value {
+ s: ""
+ }
+ }
+ }
+ node {
+ name: "save/num_shards"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "save/ShardedFilename/shard"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "save/ShardedFilename"
+ op: "ShardedFilename"
+ input: "save/StringJoin"
+ input: "save/ShardedFilename/shard"
+ input: "save/num_shards"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/SaveV2/tensor_names"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 11
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 11
+ }
+ }
+ string_val: "Adam/beta_1"
+ string_val: "Adam/beta_2"
+ string_val: "Adam/decay"
+ string_val: "Adam/iterations"
+ string_val: "Adam/lr"
+ string_val: "batch_norm/beta"
+ string_val: "batch_norm/gamma"
+ string_val: "batch_norm/moving_mean"
+ string_val: "batch_norm/moving_variance"
+ string_val: "dense_out/bias"
+ string_val: "dense_out/kernel"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/SaveV2/shape_and_slices"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 11
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 11
+ }
+ }
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ }
+ }
+ }
+ }
+ node {
+ name: "save/SaveV2"
+ op: "SaveV2"
+ input: "save/ShardedFilename"
+ input: "save/SaveV2/tensor_names"
+ input: "save/SaveV2/shape_and_slices"
+ input: "Adam/beta_1/Read/ReadVariableOp"
+ input: "Adam/beta_2/Read/ReadVariableOp"
+ input: "Adam/decay/Read/ReadVariableOp"
+ input: "Adam/iterations/Read/ReadVariableOp"
+ input: "Adam/lr/Read/ReadVariableOp"
+ input: "batch_norm/beta/Read/ReadVariableOp"
+ input: "batch_norm/gamma/Read/ReadVariableOp"
+ input: "batch_norm/moving_mean/Read/ReadVariableOp"
+ input: "batch_norm/moving_variance/Read/ReadVariableOp"
+ input: "dense_out/bias/Read/ReadVariableOp"
+ input: "dense_out/kernel/Read/ReadVariableOp"
+ device: "/device:CPU:0"
+ attr {
+ key: "dtypes"
+ value {
+ list {
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_INT64
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ }
+ }
+ }
+ }
+ node {
+ name: "save/control_dependency"
+ op: "Identity"
+ input: "save/ShardedFilename"
+ input: "^save/SaveV2"
+ device: "/device:CPU:0"
+ attr {
+ key: "T"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@save/ShardedFilename"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/MergeV2Checkpoints/checkpoint_prefixes"
+ op: "Pack"
+ input: "save/ShardedFilename"
+ input: "^save/control_dependency"
+ device: "/device:CPU:0"
+ attr {
+ key: "N"
+ value {
+ i: 1
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "axis"
+ value {
+ i: 0
+ }
+ }
+ }
+ node {
+ name: "save/MergeV2Checkpoints"
+ op: "MergeV2Checkpoints"
+ input: "save/MergeV2Checkpoints/checkpoint_prefixes"
+ input: "save/Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "delete_old_dirs"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "save/Identity"
+ op: "Identity"
+ input: "save/Const"
+ input: "^save/MergeV2Checkpoints"
+ input: "^save/control_dependency"
+ device: "/device:CPU:0"
+ attr {
+ key: "T"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/RestoreV2/tensor_names"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 11
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 11
+ }
+ }
+ string_val: "Adam/beta_1"
+ string_val: "Adam/beta_2"
+ string_val: "Adam/decay"
+ string_val: "Adam/iterations"
+ string_val: "Adam/lr"
+ string_val: "batch_norm/beta"
+ string_val: "batch_norm/gamma"
+ string_val: "batch_norm/moving_mean"
+ string_val: "batch_norm/moving_variance"
+ string_val: "dense_out/bias"
+ string_val: "dense_out/kernel"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/RestoreV2/shape_and_slices"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 11
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 11
+ }
+ }
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ }
+ }
+ }
+ }
+ node {
+ name: "save/RestoreV2"
+ op: "RestoreV2"
+ input: "save/Const"
+ input: "save/RestoreV2/tensor_names"
+ input: "save/RestoreV2/shape_and_slices"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtypes"
+ value {
+ list {
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_INT64
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ }
+ }
+ }
+ }
+ node {
+ name: "save/Identity_1"
+ op: "Identity"
+ input: "save/RestoreV2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp"
+ op: "AssignVariableOp"
+ input: "Adam/beta_1"
+ input: "save/Identity_1"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_2"
+ op: "Identity"
+ input: "save/RestoreV2:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_1"
+ op: "AssignVariableOp"
+ input: "Adam/beta_2"
+ input: "save/Identity_2"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_3"
+ op: "Identity"
+ input: "save/RestoreV2:2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_2"
+ op: "AssignVariableOp"
+ input: "Adam/decay"
+ input: "save/Identity_3"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_4"
+ op: "Identity"
+ input: "save/RestoreV2:3"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT64
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_3"
+ op: "AssignVariableOp"
+ input: "Adam/iterations"
+ input: "save/Identity_4"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ }
+ node {
+ name: "save/Identity_5"
+ op: "Identity"
+ input: "save/RestoreV2:4"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_4"
+ op: "AssignVariableOp"
+ input: "Adam/lr"
+ input: "save/Identity_5"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_6"
+ op: "Identity"
+ input: "save/RestoreV2:5"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_5"
+ op: "AssignVariableOp"
+ input: "batch_norm/beta"
+ input: "save/Identity_6"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_7"
+ op: "Identity"
+ input: "save/RestoreV2:6"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_6"
+ op: "AssignVariableOp"
+ input: "batch_norm/gamma"
+ input: "save/Identity_7"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_8"
+ op: "Identity"
+ input: "save/RestoreV2:7"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_7"
+ op: "AssignVariableOp"
+ input: "batch_norm/moving_mean"
+ input: "save/Identity_8"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_9"
+ op: "Identity"
+ input: "save/RestoreV2:8"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_8"
+ op: "AssignVariableOp"
+ input: "batch_norm/moving_variance"
+ input: "save/Identity_9"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_10"
+ op: "Identity"
+ input: "save/RestoreV2:9"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_9"
+ op: "AssignVariableOp"
+ input: "dense_out/bias"
+ input: "save/Identity_10"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_11"
+ op: "Identity"
+ input: "save/RestoreV2:10"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_10"
+ op: "AssignVariableOp"
+ input: "dense_out/kernel"
+ input: "save/Identity_11"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/restore_shard"
+ op: "NoOp"
+ input: "^save/AssignVariableOp"
+ input: "^save/AssignVariableOp_1"
+ input: "^save/AssignVariableOp_10"
+ input: "^save/AssignVariableOp_2"
+ input: "^save/AssignVariableOp_3"
+ input: "^save/AssignVariableOp_4"
+ input: "^save/AssignVariableOp_5"
+ input: "^save/AssignVariableOp_6"
+ input: "^save/AssignVariableOp_7"
+ input: "^save/AssignVariableOp_8"
+ input: "^save/AssignVariableOp_9"
+ }
+ node {
+ name: "save/restore_all"
+ op: "NoOp"
+ input: "^save/restore_shard"
+ }
+ versions {
+ producer: 27
+ }
+ }
+ saver_def {
+ filename_tensor_name: "save/Const:0"
+ save_tensor_name: "save/Identity:0"
+ restore_op_name: "save/restore_all"
+ max_to_keep: 5
+ sharded: true
+ keep_checkpoint_every_n_hours: 10000.0
+ version: V2
+ }
+ collection_def {
+ key: "cond_context"
+ value {
+ bytes_list {
+ value: "\nSloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/cond_text\022Sloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\032Tloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_t:0 \001*\355\005\nFloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\nTloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:0\nTloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:1\nSloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\nTloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_t:0\022\236\001\nFloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\022Tloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:1\022\252\001\nSloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\022Sloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0"
+ value: "\nUloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/cond_text_1\022Sloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\032Tloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_f:0*\270*\nkloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge:0\nkloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge:1\nlloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch:0\nlloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch:1\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:0\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:1\n\217\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:0\n\217\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:1\n\217\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:2\n\210\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\n\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1\n\205\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim:0\n\201\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims:0\n\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\n\214\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:1\n\207\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim:0\n\203\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1:0\n\202\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis:0\n}loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat:0\n\207\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims:0\n\206\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const:0\n\206\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape:0\n\200\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like:0\nxloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x:0\nvloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims:0\nyloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch:0\n{loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1:0\nrloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank:0\nmloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f:0\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t:0\nSloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\nTloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_f:0\nHloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/rank:0\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/rank:0\nJloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\326\001\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\022\210\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\022\310\001\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/rank:0\022{loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1:0\022\252\001\nSloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\022Sloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\022\305\001\nHloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/rank:0\022yloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch:0\022\331\001\nJloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:02\267#\n\264#\nmloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/cond_text\022mloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\032nloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t:0 \001*\341 \n\217\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:0\n\217\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:1\n\217\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:2\n\210\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\n\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1\n\205\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim:0\n\201\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims:0\n\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\n\214\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:1\n\207\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim:0\n\203\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1:0\n\202\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis:0\n}loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat:0\n\207\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims:0\n\206\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const:0\n\206\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape:0\n\200\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like:0\nxloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x:0\nvloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims:0\nmloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t:0\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\nJloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\232\002\n\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\022\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\022\333\001\nJloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\214\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:1\022\330\001\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\022\212\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1\022\226\002\n\210\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\022\210\001loss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\022\336\001\nmloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\022mloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:02\321\n\n\316\n\noloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/cond_text_1\022mloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\032nloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f:0*\373\007\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:0\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:1\nrloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank:0\nmloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\nnloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f:0\022\336\001\nmloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\022mloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\022\344\001\nrloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank:0\022nloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:0"
+ value: "\nPloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/cond_text\022Ploss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\032Qloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t:0 \001*\251\003\n[loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency:0\nPloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\nQloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t:0\022\244\001\nPloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\022Ploss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0"
+ value: "\nRloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/cond_text_1\022Ploss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\032Qloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f:0*\367\021\nVloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch:0\nXloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1:0\nXloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2:0\nXloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3:0\nVloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_0:0\nVloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_1:0\nVloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_2:0\nVloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_4:0\nVloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_5:0\nVloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_7:0\n]loss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency_1:0\nPloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\nQloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f:0\nFloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\nQloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge:0\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\nJloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\244\001\nPloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\022Ploss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\022\246\001\nJloss/dense_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022Xloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1:0\022\245\001\nIloss/dense_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\022Xloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2:0\022\242\001\nFloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\022Xloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3:0\022\253\001\nQloss/dense_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge:0\022Vloss/dense_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch:0"
+ }
+ }
+ }
+ collection_def {
+ key: "trainable_variables"
+ value {
+ bytes_list {
+ value: "\n\022batch_norm/gamma:0\022\027batch_norm/gamma/Assign\032&batch_norm/gamma/Read/ReadVariableOp:0(\0012#batch_norm/gamma/Initializer/ones:08\001"
+ value: "\n\021batch_norm/beta:0\022\026batch_norm/beta/Assign\032%batch_norm/beta/Read/ReadVariableOp:0(\0012#batch_norm/beta/Initializer/zeros:08\001"
+ value: "\n\022dense_out/kernel:0\022\027dense_out/kernel/Assign\032&dense_out/kernel/Read/ReadVariableOp:0(\0012/dense_out/kernel/Initializer/truncated_normal:08\001"
+ value: "\n\020dense_out/bias:0\022\025dense_out/bias/Assign\032$dense_out/bias/Read/ReadVariableOp:0(\0012\"dense_out/bias/Initializer/zeros:08\001"
+ value: "\n\021Adam/iterations:0\022\026Adam/iterations/Assign\032%Adam/iterations/Read/ReadVariableOp:0(\0012+Adam/iterations/Initializer/initial_value:08\001"
+ value: "\n\tAdam/lr:0\022\016Adam/lr/Assign\032\035Adam/lr/Read/ReadVariableOp:0(\0012#Adam/lr/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_1:0\022\022Adam/beta_1/Assign\032!Adam/beta_1/Read/ReadVariableOp:0(\0012\'Adam/beta_1/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_2:0\022\022Adam/beta_2/Assign\032!Adam/beta_2/Read/ReadVariableOp:0(\0012\'Adam/beta_2/Initializer/initial_value:08\001"
+ value: "\n\014Adam/decay:0\022\021Adam/decay/Assign\032 Adam/decay/Read/ReadVariableOp:0(\0012&Adam/decay/Initializer/initial_value:08\001"
+ }
+ }
+ }
+ collection_def {
+ key: "variables"
+ value {
+ bytes_list {
+ value: "\n\022batch_norm/gamma:0\022\027batch_norm/gamma/Assign\032&batch_norm/gamma/Read/ReadVariableOp:0(\0012#batch_norm/gamma/Initializer/ones:08\001"
+ value: "\n\021batch_norm/beta:0\022\026batch_norm/beta/Assign\032%batch_norm/beta/Read/ReadVariableOp:0(\0012#batch_norm/beta/Initializer/zeros:08\001"
+ value: "\n\030batch_norm/moving_mean:0\022\035batch_norm/moving_mean/Assign\032,batch_norm/moving_mean/Read/ReadVariableOp:0(\0012*batch_norm/moving_mean/Initializer/zeros:0"
+ value: "\n\034batch_norm/moving_variance:0\022!batch_norm/moving_variance/Assign\0320batch_norm/moving_variance/Read/ReadVariableOp:0(\0012-batch_norm/moving_variance/Initializer/ones:0"
+ value: "\n\022dense_out/kernel:0\022\027dense_out/kernel/Assign\032&dense_out/kernel/Read/ReadVariableOp:0(\0012/dense_out/kernel/Initializer/truncated_normal:08\001"
+ value: "\n\020dense_out/bias:0\022\025dense_out/bias/Assign\032$dense_out/bias/Read/ReadVariableOp:0(\0012\"dense_out/bias/Initializer/zeros:08\001"
+ value: "\n\021Adam/iterations:0\022\026Adam/iterations/Assign\032%Adam/iterations/Read/ReadVariableOp:0(\0012+Adam/iterations/Initializer/initial_value:08\001"
+ value: "\n\tAdam/lr:0\022\016Adam/lr/Assign\032\035Adam/lr/Read/ReadVariableOp:0(\0012#Adam/lr/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_1:0\022\022Adam/beta_1/Assign\032!Adam/beta_1/Read/ReadVariableOp:0(\0012\'Adam/beta_1/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_2:0\022\022Adam/beta_2/Assign\032!Adam/beta_2/Read/ReadVariableOp:0(\0012\'Adam/beta_2/Initializer/initial_value:08\001"
+ value: "\n\014Adam/decay:0\022\021Adam/decay/Assign\032 Adam/decay/Read/ReadVariableOp:0(\0012&Adam/decay/Initializer/initial_value:08\001"
+ }
+ }
+ }
+ signature_def {
+ key: "serving_default"
+ value {
+ inputs {
+ key: "input_embedding_product_slug"
+ value {
+ name: "input_embedding_product_slug:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ inputs {
+ key: "input_embedding_user_guid"
+ value {
+ name: "input_embedding_user_guid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ outputs {
+ key: "output"
+ value {
+ name: "dense_out/Sigmoid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ method_name: "tensorflow/serving/predict"
+ }
+ }
+}
diff --git a/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001 b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001
new file mode 100644
index 00000000000..9997691bd2c
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.index b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.index
new file mode 100644
index 00000000000..98e80e982a9
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_B/factorization_machine_v1/export/standard/variables/variables.index
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/optimized/saved_model.pbtxt b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/optimized/saved_model.pbtxt
new file mode 100644
index 00000000000..4678d78fe68
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/optimized/saved_model.pbtxt
@@ -0,0 +1,959 @@
+saved_model_schema_version: 1
+meta_graphs {
+ meta_info_def {
+ stripped_op_list {
+ op {
+ name: "Const"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "value"
+ type: "tensor"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ }
+ op {
+ name: "ExpandDims"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dim"
+ type_attr: "Tdim"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tdim"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Maximum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Mul"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Placeholder"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ default_value {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ op {
+ name: "PlaceholderWithDefault"
+ input_arg {
+ name: "input"
+ type_attr: "dtype"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ }
+ }
+ op {
+ name: "Rsqrt"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sigmoid"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Square"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sum"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ }
+ tags: "serve"
+ tensorflow_version: "1.13.1"
+ tensorflow_git_version: "b\'v1.13.1-0-g6612da8951\'"
+ }
+ graph_def {
+ node {
+ name: "keras_learning_phase/input"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_BOOL
+ tensor_shape {
+ }
+ bool_val: false
+ }
+ }
+ }
+ }
+ node {
+ name: "keras_learning_phase"
+ op: "PlaceholderWithDefault"
+ input: "keras_learning_phase/input"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 9.999999960041972e-13
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_user_guid"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Square"
+ op: "Square"
+ input: "input_embedding_user_guid"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize"
+ op: "Mul"
+ input: "input_embedding_user_guid"
+ input: "dot_0/l2_normalize/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_product_slug"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Square"
+ op: "Square"
+ input: "input_embedding_product_slug"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize_1/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize_1/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize_1/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1"
+ op: "Mul"
+ input: "input_embedding_product_slug"
+ input: "dot_0/l2_normalize_1/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Mul"
+ op: "Mul"
+ input: "dot_0/l2_normalize"
+ input: "dot_0/l2_normalize_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Sum"
+ op: "Sum"
+ input: "dot_0/Mul"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dot_0/ExpandDims"
+ op: "ExpandDims"
+ input: "dot_0/Sum"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "sigmoid_out/Sigmoid"
+ op: "Sigmoid"
+ input: "dot_0/ExpandDims"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ versions {
+ }
+ }
+ signature_def {
+ key: "serving_default"
+ value {
+ inputs {
+ key: "input_embedding_product_slug"
+ value {
+ name: "input_embedding_product_slug:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ inputs {
+ key: "input_embedding_user_guid"
+ value {
+ name: "input_embedding_user_guid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ outputs {
+ key: "output"
+ value {
+ name: "sigmoid_out/Sigmoid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ method_name: "tensorflow/serving/predict"
+ }
+ }
+}
diff --git a/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/saved_model.pbtxt b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/saved_model.pbtxt
new file mode 100644
index 00000000000..cad3db9d898
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/saved_model.pbtxt
@@ -0,0 +1,8622 @@
+saved_model_schema_version: 1
+meta_graphs {
+ meta_info_def {
+ stripped_op_list {
+ op {
+ name: "Abs"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Add"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ type: DT_STRING
+ }
+ }
+ }
+ }
+ op {
+ name: "Assert"
+ input_arg {
+ name: "condition"
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "data"
+ type_list_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "summarize"
+ type: "int"
+ default_value {
+ i: 3
+ }
+ }
+ is_stateful: true
+ }
+ op {
+ name: "AssignAddVariableOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ input_arg {
+ name: "value"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "AssignVariableOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ input_arg {
+ name: "value"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "Cast"
+ input_arg {
+ name: "x"
+ type_attr: "SrcT"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "DstT"
+ }
+ attr {
+ name: "SrcT"
+ type: "type"
+ }
+ attr {
+ name: "DstT"
+ type: "type"
+ }
+ attr {
+ name: "Truncate"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ }
+ op {
+ name: "ConcatV2"
+ input_arg {
+ name: "values"
+ type_attr: "T"
+ number_attr: "N"
+ }
+ input_arg {
+ name: "axis"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 2
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Const"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "value"
+ type: "tensor"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ }
+ op {
+ name: "DenseToDenseSetOperation"
+ input_arg {
+ name: "set1"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "set2"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "result_indices"
+ type: DT_INT64
+ }
+ output_arg {
+ name: "result_values"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "result_shape"
+ type: DT_INT64
+ }
+ attr {
+ name: "set_operation"
+ type: "string"
+ }
+ attr {
+ name: "validate_indices"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_UINT16
+ type: DT_STRING
+ }
+ }
+ }
+ }
+ op {
+ name: "DivNoNan"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ }
+ op {
+ name: "Equal"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_QUINT8
+ type: DT_QINT8
+ type: DT_QINT32
+ type: DT_STRING
+ type: DT_BOOL
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Exp"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "ExpandDims"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dim"
+ type_attr: "Tdim"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tdim"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Fill"
+ input_arg {
+ name: "dims"
+ type_attr: "index_type"
+ }
+ input_arg {
+ name: "value"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "index_type"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Greater"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_INT64
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ }
+ op {
+ name: "GreaterEqual"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_INT64
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Identity"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ op {
+ name: "Log"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Log1p"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Maximum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Mean"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Merge"
+ input_arg {
+ name: "inputs"
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "value_index"
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ }
+ op {
+ name: "MergeV2Checkpoints"
+ input_arg {
+ name: "checkpoint_prefixes"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "destination_prefix"
+ type: DT_STRING
+ }
+ attr {
+ name: "delete_old_dirs"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ is_stateful: true
+ }
+ op {
+ name: "Minimum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Mul"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ is_commutative: true
+ }
+ op {
+ name: "Neg"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "NoOp"
+ }
+ op {
+ name: "Pack"
+ input_arg {
+ name: "values"
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "axis"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ }
+ }
+ op {
+ name: "Placeholder"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ default_value {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ op {
+ name: "PlaceholderWithDefault"
+ input_arg {
+ name: "input"
+ type_attr: "dtype"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ }
+ }
+ op {
+ name: "ReadVariableOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ output_arg {
+ name: "value"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "RealDiv"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "RestoreV2"
+ input_arg {
+ name: "prefix"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_names"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shape_and_slices"
+ type: DT_STRING
+ }
+ output_arg {
+ name: "tensors"
+ type_list_attr: "dtypes"
+ }
+ attr {
+ name: "dtypes"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ is_stateful: true
+ }
+ op {
+ name: "Rsqrt"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "SaveV2"
+ input_arg {
+ name: "prefix"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_names"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shape_and_slices"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensors"
+ type_list_attr: "dtypes"
+ }
+ attr {
+ name: "dtypes"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ is_stateful: true
+ }
+ op {
+ name: "Select"
+ input_arg {
+ name: "condition"
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "t"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "e"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ op {
+ name: "Shape"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "out_type"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "out_type"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "ShardedFilename"
+ input_arg {
+ name: "basename"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shard"
+ type: DT_INT32
+ }
+ input_arg {
+ name: "num_shards"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "filename"
+ type: DT_STRING
+ }
+ }
+ op {
+ name: "Sigmoid"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Size"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "out_type"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "out_type"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Square"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "StringJoin"
+ input_arg {
+ name: "inputs"
+ type: DT_STRING
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ type: DT_STRING
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "separator"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ }
+ }
+ op {
+ name: "Sub"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_BFLOAT16
+ type: DT_HALF
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_UINT16
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_COMPLEX128
+ }
+ }
+ }
+ }
+ op {
+ name: "Sum"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ type_attr: "Tidx"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_INT64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ type: DT_BFLOAT16
+ type: DT_UINT16
+ type: DT_COMPLEX128
+ type: DT_HALF
+ type: DT_UINT32
+ type: DT_UINT64
+ }
+ }
+ }
+ attr {
+ name: "Tidx"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
+ name: "Switch"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "pred"
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "output_false"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_true"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ op {
+ name: "VarHandleOp"
+ output_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ }
+ is_stateful: true
+ }
+ op {
+ name: "VarIsInitializedOp"
+ input_arg {
+ name: "resource"
+ type: DT_RESOURCE
+ }
+ output_arg {
+ name: "is_initialized"
+ type: DT_BOOL
+ }
+ is_stateful: true
+ }
+ op {
+ name: "ZerosLike"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ }
+ }
+ tags: "serve"
+ tensorflow_version: "1.13.1"
+ tensorflow_git_version: "b\'v1.13.1-0-g6612da8951\'"
+ }
+ graph_def {
+ node {
+ name: "keras_learning_phase/input"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_BOOL
+ tensor_shape {
+ }
+ bool_val: false
+ }
+ }
+ }
+ }
+ node {
+ name: "keras_learning_phase"
+ op: "PlaceholderWithDefault"
+ input: "keras_learning_phase/input"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_user_guid"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "input_embedding_product_slug"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Square"
+ op: "Square"
+ input: "input_embedding_user_guid"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize/Square"
+ input: "dot_0/l2_normalize/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 9.999999960041972e-13
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize/Sum"
+ input: "dot_0/l2_normalize/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize"
+ op: "Mul"
+ input: "input_embedding_user_guid"
+ input: "dot_0/l2_normalize/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Square"
+ op: "Square"
+ input: "input_embedding_product_slug"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Sum"
+ op: "Sum"
+ input: "dot_0/l2_normalize_1/Square"
+ input: "dot_0/l2_normalize_1/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Maximum/y"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 9.999999960041972e-13
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Maximum"
+ op: "Maximum"
+ input: "dot_0/l2_normalize_1/Sum"
+ input: "dot_0/l2_normalize_1/Maximum/y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1/Rsqrt"
+ op: "Rsqrt"
+ input: "dot_0/l2_normalize_1/Maximum"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/l2_normalize_1"
+ op: "Mul"
+ input: "input_embedding_product_slug"
+ input: "dot_0/l2_normalize_1/Rsqrt"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Mul"
+ op: "Mul"
+ input: "dot_0/l2_normalize"
+ input: "dot_0/l2_normalize_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Sum/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/Sum"
+ op: "Sum"
+ input: "dot_0/Mul"
+ input: "dot_0/Sum/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "dot_0/ExpandDims/dim"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "dot_0/ExpandDims"
+ op: "ExpandDims"
+ input: "dot_0/Sum"
+ input: "dot_0/ExpandDims/dim"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "sigmoid_out/Sigmoid"
+ op: "Sigmoid"
+ input: "dot_0/ExpandDims"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT64
+ tensor_shape {
+ }
+ int64_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/iterations"
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/iterations"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/iterations"
+ input: "Adam/iterations/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ }
+ node {
+ name: "Adam/iterations/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/iterations"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/iterations"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0010000000474974513
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/lr"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/lr"
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/lr"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/lr"
+ input: "Adam/lr/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/lr/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/lr"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/lr"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.8999999761581421
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/beta_1"
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/beta_1"
+ input: "Adam/beta_1/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_1/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/beta_1"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.9990000128746033
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/beta_2"
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_2"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/beta_2"
+ input: "Adam/beta_2/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/beta_2/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/beta_2"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/beta_2"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/Initializer/initial_value"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/decay"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "Adam/decay"
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/decay"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/Assign"
+ op: "AssignVariableOp"
+ input: "Adam/decay"
+ input: "Adam/decay/Initializer/initial_value"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "Adam/decay/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "Adam/decay"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@Adam/decay"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "sigmoid_out_target"
+ op: "Placeholder"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "sigmoid_out_sample_weights"
+ op: "PlaceholderWithDefault"
+ input: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "total/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "total"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "total"
+ }
+ }
+ }
+ node {
+ name: "total/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "total"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "total/Assign"
+ op: "AssignVariableOp"
+ input: "total"
+ input: "total/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "total/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "count"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "count"
+ }
+ }
+ }
+ node {
+ name: "count/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "count"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "count/Assign"
+ op: "AssignVariableOp"
+ input: "count"
+ input: "count/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "count"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "total_1/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "total_1"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "total_1"
+ }
+ }
+ }
+ node {
+ name: "total_1/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "total_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "total_1/Assign"
+ op: "AssignVariableOp"
+ input: "total_1"
+ input: "total_1/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "total_1/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total_1"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@total_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count_1/Initializer/zeros"
+ op: "Const"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "count_1"
+ op: "VarHandleOp"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "container"
+ value {
+ s: ""
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ attr {
+ key: "shared_name"
+ value {
+ s: "count_1"
+ }
+ }
+ }
+ node {
+ name: "count_1/IsInitialized/VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "count_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "count_1/Assign"
+ op: "AssignVariableOp"
+ input: "count_1"
+ input: "count_1/Initializer/zeros"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "count_1/Read/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "count_1"
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@count_1"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0000000116860974e-07
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/sub/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/sub"
+ op: "Sub"
+ input: "loss/sigmoid_out_loss/sub/x"
+ input: "loss/sigmoid_out_loss/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/clip_by_value/Minimum"
+ op: "Minimum"
+ input: "sigmoid_out/Sigmoid"
+ input: "loss/sigmoid_out_loss/sub"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/clip_by_value"
+ op: "Maximum"
+ input: "loss/sigmoid_out_loss/clip_by_value/Minimum"
+ input: "loss/sigmoid_out_loss/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/sub_1/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/sub_1"
+ op: "Sub"
+ input: "loss/sigmoid_out_loss/sub_1/x"
+ input: "loss/sigmoid_out_loss/clip_by_value"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/truediv"
+ op: "RealDiv"
+ input: "loss/sigmoid_out_loss/clip_by_value"
+ input: "loss/sigmoid_out_loss/sub_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Log"
+ op: "Log"
+ input: "loss/sigmoid_out_loss/truediv"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/zeros_like"
+ op: "ZerosLike"
+ input: "loss/sigmoid_out_loss/Log"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/GreaterEqual"
+ op: "GreaterEqual"
+ input: "loss/sigmoid_out_loss/Log"
+ input: "loss/sigmoid_out_loss/logistic_loss/zeros_like"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/Select"
+ op: "Select"
+ input: "loss/sigmoid_out_loss/logistic_loss/GreaterEqual"
+ input: "loss/sigmoid_out_loss/Log"
+ input: "loss/sigmoid_out_loss/logistic_loss/zeros_like"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/Neg"
+ op: "Neg"
+ input: "loss/sigmoid_out_loss/Log"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/Select_1"
+ op: "Select"
+ input: "loss/sigmoid_out_loss/logistic_loss/GreaterEqual"
+ input: "loss/sigmoid_out_loss/logistic_loss/Neg"
+ input: "loss/sigmoid_out_loss/Log"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/mul"
+ op: "Mul"
+ input: "loss/sigmoid_out_loss/Log"
+ input: "sigmoid_out_target"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/sub"
+ op: "Sub"
+ input: "loss/sigmoid_out_loss/logistic_loss/Select"
+ input: "loss/sigmoid_out_loss/logistic_loss/mul"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/Exp"
+ op: "Exp"
+ input: "loss/sigmoid_out_loss/logistic_loss/Select_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss/Log1p"
+ op: "Log1p"
+ input: "loss/sigmoid_out_loss/logistic_loss/Exp"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/logistic_loss"
+ op: "Add"
+ input: "loss/sigmoid_out_loss/logistic_loss/sub"
+ input: "loss/sigmoid_out_loss/logistic_loss/Log1p"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Mean/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Mean"
+ op: "Mean"
+ input: "loss/sigmoid_out_loss/logistic_loss"
+ input: "loss/sigmoid_out_loss/Mean/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ op: "Shape"
+ input: "sigmoid_out_sample_weights"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ op: "Shape"
+ input: "loss/sigmoid_out_loss/Mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/rank"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ op: "Equal"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar/x"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_t"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_f"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ op: "Equal"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/rank"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/rank"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/rank"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims"
+ op: "ExpandDims"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 2
+ }
+ }
+ tensor_content: "\001\000\000\000\001\000\000\000"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like"
+ op: "Fill"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "index_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat"
+ op: "ConcatV2"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1"
+ op: "ExpandDims"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:1"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Tdim"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation"
+ op: "DenseToDenseSetOperation"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 2
+ }
+ }
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ shape {
+ dim {
+ size: 2
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "set_operation"
+ value {
+ s: "a-b"
+ }
+ }
+ attr {
+ key: "validate_indices"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims"
+ op: "Size"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims"
+ op: "Equal"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge"
+ op: "Merge"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ op: "Merge"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:1"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights can not be broadcast to values."
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/Const_2"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "sigmoid_out_sample_weights:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/Const_3"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "values.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/Const_4"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "loss/sigmoid_out_loss/Mean:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/Const_5"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "is_scalar="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Switch"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Switch:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Switch"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/NoOp"
+ op: "NoOp"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/NoOp"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_0"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights can not be broadcast to values."
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_1"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "weights.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_2"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "sigmoid_out_sample_weights:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_4"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "values.shape="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_5"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "loss/sigmoid_out_loss/Mean:0"
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_7"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "is_scalar="
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert"
+ op: "Assert"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_0"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_1"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_2"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_4"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_5"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_7"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3"
+ attr {
+ key: "T"
+ value {
+ list {
+ type: DT_STRING
+ type: DT_STRING
+ type: DT_STRING
+ type: DT_INT32
+ type: DT_STRING
+ type: DT_STRING
+ type: DT_INT32
+ type: DT_STRING
+ type: DT_BOOL
+ }
+ }
+ }
+ attr {
+ key: "summarize"
+ value {
+ i: 3
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3"
+ op: "Switch"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency_1"
+ op: "Identity"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert"
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Merge"
+ op: "Merge"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency_1"
+ input: "loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/ones_like/Shape"
+ op: "Shape"
+ input: "loss/sigmoid_out_loss/Mean"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Merge"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/ones_like/Const"
+ op: "Const"
+ input: "^loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Merge"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights/ones_like"
+ op: "Fill"
+ input: "loss/sigmoid_out_loss/broadcast_weights/ones_like/Shape"
+ input: "loss/sigmoid_out_loss/broadcast_weights/ones_like/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "index_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/broadcast_weights"
+ op: "Mul"
+ input: "sigmoid_out_sample_weights"
+ input: "loss/sigmoid_out_loss/broadcast_weights/ones_like"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Mul"
+ op: "Mul"
+ input: "loss/sigmoid_out_loss/Mean"
+ input: "loss/sigmoid_out_loss/broadcast_weights"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Sum"
+ op: "Sum"
+ input: "loss/sigmoid_out_loss/Mul"
+ input: "loss/sigmoid_out_loss/Const_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Const_2"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Sum_1"
+ op: "Sum"
+ input: "loss/sigmoid_out_loss/broadcast_weights"
+ input: "loss/sigmoid_out_loss/Const_2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/div_no_nan"
+ op: "DivNoNan"
+ input: "loss/sigmoid_out_loss/Sum"
+ input: "loss/sigmoid_out_loss/Sum_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Const_3"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/sigmoid_out_loss/Mean_1"
+ op: "Mean"
+ input: "loss/sigmoid_out_loss/div_no_nan"
+ input: "loss/sigmoid_out_loss/Const_3"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "loss/mul/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 1.0
+ }
+ }
+ }
+ }
+ node {
+ name: "loss/mul"
+ op: "Mul"
+ input: "loss/mul/x"
+ input: "loss/sigmoid_out_loss/Mean_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.5
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Greater"
+ op: "Greater"
+ input: "sigmoid_out/Sigmoid"
+ input: "metrics/acc/Cast/x"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_1"
+ op: "Cast"
+ input: "metrics/acc/Greater"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Equal"
+ op: "Equal"
+ input: "sigmoid_out_target"
+ input: "metrics/acc/Cast_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_2"
+ op: "Cast"
+ input: "metrics/acc/Equal"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean"
+ op: "Mean"
+ input: "metrics/acc/Cast_2"
+ input: "metrics/acc/Mean/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Size"
+ op: "Size"
+ input: "metrics/acc/Mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_3"
+ op: "Cast"
+ input: "metrics/acc/Size"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Sum"
+ op: "Sum"
+ input: "metrics/acc/Mean"
+ input: "metrics/acc/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/AssignAddVariableOp"
+ op: "AssignAddVariableOp"
+ input: "total"
+ input: "metrics/acc/Sum"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total"
+ input: "^metrics/acc/AssignAddVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/AssignAddVariableOp_1"
+ op: "AssignAddVariableOp"
+ input: "count"
+ input: "metrics/acc/Cast_3"
+ input: "^metrics/acc/ReadVariableOp"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count"
+ input: "^metrics/acc/AssignAddVariableOp_1"
+ input: "^metrics/acc/ReadVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/div_no_nan/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total"
+ input: "^metrics/acc/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/div_no_nan/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count"
+ input: "^metrics/acc/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/div_no_nan"
+ op: "DivNoNan"
+ input: "metrics/acc/div_no_nan/ReadVariableOp"
+ input: "metrics/acc/div_no_nan/ReadVariableOp_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_4/x"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ }
+ float_val: 0.5
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Greater_1"
+ op: "Greater"
+ input: "sigmoid_out/Sigmoid"
+ input: "metrics/acc/Cast_4/x"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_5"
+ op: "Cast"
+ input: "metrics/acc/Greater_1"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Equal_1"
+ op: "Equal"
+ input: "sigmoid_out_target"
+ input: "metrics/acc/Cast_5"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Cast_6"
+ op: "Cast"
+ input: "metrics/acc/Equal_1"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_BOOL
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean_1/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean_1"
+ op: "Mean"
+ input: "metrics/acc/Cast_6"
+ input: "metrics/acc/Mean_1/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/acc/Mean_2"
+ op: "Mean"
+ input: "metrics/acc/Mean_1"
+ input: "metrics/acc/Const_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/sub"
+ op: "Sub"
+ input: "sigmoid_out/Sigmoid"
+ input: "sigmoid_out_target"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Abs"
+ op: "Abs"
+ input: "metrics/mean_absolute_error/sub"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean"
+ op: "Mean"
+ input: "metrics/mean_absolute_error/Abs"
+ input: "metrics/mean_absolute_error/Mean/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Size"
+ op: "Size"
+ input: "metrics/mean_absolute_error/Mean"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "out_type"
+ value {
+ type: DT_INT32
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Cast"
+ op: "Cast"
+ input: "metrics/mean_absolute_error/Size"
+ attr {
+ key: "DstT"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "SrcT"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "Truncate"
+ value {
+ b: false
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Const"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Sum"
+ op: "Sum"
+ input: "metrics/mean_absolute_error/Mean"
+ input: "metrics/mean_absolute_error/Const"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/AssignAddVariableOp"
+ op: "AssignAddVariableOp"
+ input: "total_1"
+ input: "metrics/mean_absolute_error/Sum"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total_1"
+ input: "^metrics/mean_absolute_error/AssignAddVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/AssignAddVariableOp_1"
+ op: "AssignAddVariableOp"
+ input: "count_1"
+ input: "metrics/mean_absolute_error/Cast"
+ input: "^metrics/mean_absolute_error/ReadVariableOp"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count_1"
+ input: "^metrics/mean_absolute_error/AssignAddVariableOp_1"
+ input: "^metrics/mean_absolute_error/ReadVariableOp"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp"
+ op: "ReadVariableOp"
+ input: "total_1"
+ input: "^metrics/mean_absolute_error/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp_1"
+ op: "ReadVariableOp"
+ input: "count_1"
+ input: "^metrics/mean_absolute_error/ReadVariableOp_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/div_no_nan"
+ op: "DivNoNan"
+ input: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp"
+ input: "metrics/mean_absolute_error/div_no_nan/ReadVariableOp_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/sub_1"
+ op: "Sub"
+ input: "sigmoid_out/Sigmoid"
+ input: "sigmoid_out_target"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Abs_1"
+ op: "Abs"
+ input: "metrics/mean_absolute_error/sub_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean_1/reduction_indices"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: -1
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean_1"
+ op: "Mean"
+ input: "metrics/mean_absolute_error/Abs_1"
+ input: "metrics/mean_absolute_error/Mean_1/reduction_indices"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Const_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "metrics/mean_absolute_error/Mean_2"
+ op: "Mean"
+ input: "metrics/mean_absolute_error/Mean_1"
+ input: "metrics/mean_absolute_error/Const_1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tidx"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "keep_dims"
+ value {
+ b: false
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_2"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_1"
+ op: "VarIsInitializedOp"
+ input: "count_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_2"
+ op: "VarIsInitializedOp"
+ input: "Adam/decay"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_3"
+ op: "VarIsInitializedOp"
+ input: "total"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_4"
+ op: "VarIsInitializedOp"
+ input: "Adam/lr"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_5"
+ op: "VarIsInitializedOp"
+ input: "total_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_6"
+ op: "VarIsInitializedOp"
+ input: "count"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_7"
+ op: "VarIsInitializedOp"
+ input: "Adam/iterations"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "VarIsInitializedOp_8"
+ op: "VarIsInitializedOp"
+ input: "Adam/beta_1"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "init"
+ op: "NoOp"
+ input: "^Adam/beta_1/Assign"
+ input: "^Adam/beta_2/Assign"
+ input: "^Adam/decay/Assign"
+ input: "^Adam/iterations/Assign"
+ input: "^Adam/lr/Assign"
+ input: "^count/Assign"
+ input: "^count_1/Assign"
+ input: "^total/Assign"
+ input: "^total_1/Assign"
+ }
+ node {
+ name: "init_1"
+ op: "NoOp"
+ input: "^Adam/beta_1/Assign"
+ input: "^Adam/beta_2/Assign"
+ input: "^Adam/decay/Assign"
+ input: "^Adam/iterations/Assign"
+ input: "^Adam/lr/Assign"
+ }
+ node {
+ name: "init_2"
+ op: "NoOp"
+ }
+ node {
+ name: "group_deps"
+ op: "NoOp"
+ input: "^init_1"
+ input: "^init_2"
+ }
+ node {
+ name: "save/filename/input"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "model"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/filename"
+ op: "PlaceholderWithDefault"
+ input: "save/filename/input"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "save/Const"
+ op: "PlaceholderWithDefault"
+ input: "save/filename"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "shape"
+ value {
+ shape {
+ }
+ }
+ }
+ }
+ node {
+ name: "save/StringJoin/inputs_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "_temp_f9ee0bde57514bd8b273ce01b6ff32fd/part"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/StringJoin"
+ op: "StringJoin"
+ input: "save/Const"
+ input: "save/StringJoin/inputs_1"
+ attr {
+ key: "N"
+ value {
+ i: 2
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "separator"
+ value {
+ s: ""
+ }
+ }
+ }
+ node {
+ name: "save/num_shards"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "save/ShardedFilename/shard"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ }
+ int_val: 0
+ }
+ }
+ }
+ }
+ node {
+ name: "save/ShardedFilename"
+ op: "ShardedFilename"
+ input: "save/StringJoin"
+ input: "save/ShardedFilename/shard"
+ input: "save/num_shards"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/SaveV2/tensor_names"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 5
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 5
+ }
+ }
+ string_val: "Adam/beta_1"
+ string_val: "Adam/beta_2"
+ string_val: "Adam/decay"
+ string_val: "Adam/iterations"
+ string_val: "Adam/lr"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/SaveV2/shape_and_slices"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 5
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 5
+ }
+ }
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ }
+ }
+ }
+ }
+ node {
+ name: "save/SaveV2"
+ op: "SaveV2"
+ input: "save/ShardedFilename"
+ input: "save/SaveV2/tensor_names"
+ input: "save/SaveV2/shape_and_slices"
+ input: "Adam/beta_1/Read/ReadVariableOp"
+ input: "Adam/beta_2/Read/ReadVariableOp"
+ input: "Adam/decay/Read/ReadVariableOp"
+ input: "Adam/iterations/Read/ReadVariableOp"
+ input: "Adam/lr/Read/ReadVariableOp"
+ device: "/device:CPU:0"
+ attr {
+ key: "dtypes"
+ value {
+ list {
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_INT64
+ type: DT_FLOAT
+ }
+ }
+ }
+ }
+ node {
+ name: "save/control_dependency"
+ op: "Identity"
+ input: "save/ShardedFilename"
+ input: "^save/SaveV2"
+ device: "/device:CPU:0"
+ attr {
+ key: "T"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "_class"
+ value {
+ list {
+ s: "loc:@save/ShardedFilename"
+ }
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/MergeV2Checkpoints/checkpoint_prefixes"
+ op: "Pack"
+ input: "save/ShardedFilename"
+ input: "^save/control_dependency"
+ device: "/device:CPU:0"
+ attr {
+ key: "N"
+ value {
+ i: 1
+ }
+ }
+ attr {
+ key: "T"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "axis"
+ value {
+ i: 0
+ }
+ }
+ }
+ node {
+ name: "save/MergeV2Checkpoints"
+ op: "MergeV2Checkpoints"
+ input: "save/MergeV2Checkpoints/checkpoint_prefixes"
+ input: "save/Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "delete_old_dirs"
+ value {
+ b: true
+ }
+ }
+ }
+ node {
+ name: "save/Identity"
+ op: "Identity"
+ input: "save/Const"
+ input: "^save/MergeV2Checkpoints"
+ input: "^save/control_dependency"
+ device: "/device:CPU:0"
+ attr {
+ key: "T"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/RestoreV2/tensor_names"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 5
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 5
+ }
+ }
+ string_val: "Adam/beta_1"
+ string_val: "Adam/beta_2"
+ string_val: "Adam/decay"
+ string_val: "Adam/iterations"
+ string_val: "Adam/lr"
+ }
+ }
+ }
+ }
+ node {
+ name: "save/RestoreV2/shape_and_slices"
+ op: "Const"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 5
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ dim {
+ size: 5
+ }
+ }
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ string_val: ""
+ }
+ }
+ }
+ }
+ node {
+ name: "save/RestoreV2"
+ op: "RestoreV2"
+ input: "save/Const"
+ input: "save/RestoreV2/tensor_names"
+ input: "save/RestoreV2/shape_and_slices"
+ device: "/device:CPU:0"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtypes"
+ value {
+ list {
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_FLOAT
+ type: DT_INT64
+ type: DT_FLOAT
+ }
+ }
+ }
+ }
+ node {
+ name: "save/Identity_1"
+ op: "Identity"
+ input: "save/RestoreV2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp"
+ op: "AssignVariableOp"
+ input: "Adam/beta_1"
+ input: "save/Identity_1"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_2"
+ op: "Identity"
+ input: "save/RestoreV2:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_1"
+ op: "AssignVariableOp"
+ input: "Adam/beta_2"
+ input: "save/Identity_2"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_3"
+ op: "Identity"
+ input: "save/RestoreV2:2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_2"
+ op: "AssignVariableOp"
+ input: "Adam/decay"
+ input: "save/Identity_3"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/Identity_4"
+ op: "Identity"
+ input: "save/RestoreV2:3"
+ attr {
+ key: "T"
+ value {
+ type: DT_INT64
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_3"
+ op: "AssignVariableOp"
+ input: "Adam/iterations"
+ input: "save/Identity_4"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT64
+ }
+ }
+ }
+ node {
+ name: "save/Identity_5"
+ op: "Identity"
+ input: "save/RestoreV2:4"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ unknown_rank: true
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "save/AssignVariableOp_4"
+ op: "AssignVariableOp"
+ input: "Adam/lr"
+ input: "save/Identity_5"
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ }
+ node {
+ name: "save/restore_shard"
+ op: "NoOp"
+ input: "^save/AssignVariableOp"
+ input: "^save/AssignVariableOp_1"
+ input: "^save/AssignVariableOp_2"
+ input: "^save/AssignVariableOp_3"
+ input: "^save/AssignVariableOp_4"
+ }
+ node {
+ name: "save/restore_all"
+ op: "NoOp"
+ input: "^save/restore_shard"
+ }
+ versions {
+ producer: 27
+ }
+ }
+ saver_def {
+ filename_tensor_name: "save/Const:0"
+ save_tensor_name: "save/Identity:0"
+ restore_op_name: "save/restore_all"
+ max_to_keep: 5
+ sharded: true
+ keep_checkpoint_every_n_hours: 10000.0
+ version: V2
+ }
+ collection_def {
+ key: "cond_context"
+ value {
+ bytes_list {
+ value: "\nUloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/cond_text\022Uloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\032Vloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_t:0 \001*\377\005\nHloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\nVloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:0\nVloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:1\nUloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\nVloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_t:0\022\242\001\nHloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\022Vloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Switch_1:1\022\256\001\nUloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\022Uloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0"
+ value: "\nWloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/cond_text_1\022Uloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\032Vloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_f:0*\226+\nmloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge:0\nmloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Merge:1\nnloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch:0\nnloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch:1\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:0\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:1\n\221\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:0\n\221\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:1\n\221\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:2\n\212\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\n\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1\n\207\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim:0\n\203\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims:0\n\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\n\216\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:1\n\211\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim:0\n\205\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1:0\n\204\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis:0\n\177loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat:0\n\211\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims:0\n\210\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const:0\n\210\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape:0\n\202\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like:0\nzloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x:0\nxloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims:0\n{loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch:0\n}loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1:0\ntloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank:0\noloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f:0\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t:0\nUloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\nVloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/switch_f:0\nJloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/rank:0\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/rank:0\nLloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\256\001\nUloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\022Uloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/pred_id:0\022\332\001\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\022\212\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\022\314\001\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/rank:0\022}loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch_1:0\022\335\001\nLloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\022\311\001\nJloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/rank:0\022{loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank/Switch:02\377#\n\374#\noloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/cond_text\022oloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\032ploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t:0 \001*\243!\n\221\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:0\n\221\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:1\n\221\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation:2\n\212\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\n\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1\n\207\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/dim:0\n\203\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims:0\n\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\n\216\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:1\n\211\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/dim:0\n\205\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1:0\n\204\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat/axis:0\n\177loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/concat:0\n\211\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/num_invalid_dims:0\n\210\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Const:0\n\210\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like/Shape:0\n\202\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ones_like:0\nzloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/x:0\nxloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims:0\noloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_t:0\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\nLloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\232\002\n\212\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\022\212\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch:0\022\334\001\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\022\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims/Switch_1:1\022\342\001\noloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\022oloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\022\236\002\n\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\022\214\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch:0\022\337\001\nLloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\216\001loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/ExpandDims_1/Switch_1:12\351\n\n\346\n\nqloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/cond_text_1\022oloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\032ploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f:0*\215\010\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:0\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:1\ntloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank:0\noloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\nploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/switch_f:0\022\350\001\ntloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/is_same_rank:0\022ploss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/Switch_1:0\022\342\001\noloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0\022oloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/pred_id:0"
+ value: "\nRloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/cond_text\022Rloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\032Sloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t:0 \001*\263\003\n]loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency:0\nRloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\nSloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_t:0\022\250\001\nRloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\022Rloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0"
+ value: "\nTloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/cond_text_1\022Rloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\032Sloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f:0*\255\022\nXloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch:0\nZloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1:0\nZloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2:0\nZloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3:0\nXloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_0:0\nXloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_1:0\nXloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_2:0\nXloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_4:0\nXloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_5:0\nXloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/data_7:0\n_loss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/control_dependency_1:0\nRloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\nSloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/switch_f:0\nHloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\nSloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge:0\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\nLloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022\246\001\nHloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_scalar:0\022Zloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_3:0\022\251\001\nKloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/values/shape:0\022Zloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_2:0\022\257\001\nSloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/is_valid_shape/Merge:0\022Xloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch:0\022\250\001\nRloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\022Rloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/pred_id:0\022\252\001\nLloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/weights/shape:0\022Zloss/sigmoid_out_loss/broadcast_weights/assert_broadcastable/AssertGuard/Assert/Switch_1:0"
+ }
+ }
+ }
+ collection_def {
+ key: "trainable_variables"
+ value {
+ bytes_list {
+ value: "\n\021Adam/iterations:0\022\026Adam/iterations/Assign\032%Adam/iterations/Read/ReadVariableOp:0(\0012+Adam/iterations/Initializer/initial_value:08\001"
+ value: "\n\tAdam/lr:0\022\016Adam/lr/Assign\032\035Adam/lr/Read/ReadVariableOp:0(\0012#Adam/lr/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_1:0\022\022Adam/beta_1/Assign\032!Adam/beta_1/Read/ReadVariableOp:0(\0012\'Adam/beta_1/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_2:0\022\022Adam/beta_2/Assign\032!Adam/beta_2/Read/ReadVariableOp:0(\0012\'Adam/beta_2/Initializer/initial_value:08\001"
+ value: "\n\014Adam/decay:0\022\021Adam/decay/Assign\032 Adam/decay/Read/ReadVariableOp:0(\0012&Adam/decay/Initializer/initial_value:08\001"
+ }
+ }
+ }
+ collection_def {
+ key: "variables"
+ value {
+ bytes_list {
+ value: "\n\021Adam/iterations:0\022\026Adam/iterations/Assign\032%Adam/iterations/Read/ReadVariableOp:0(\0012+Adam/iterations/Initializer/initial_value:08\001"
+ value: "\n\tAdam/lr:0\022\016Adam/lr/Assign\032\035Adam/lr/Read/ReadVariableOp:0(\0012#Adam/lr/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_1:0\022\022Adam/beta_1/Assign\032!Adam/beta_1/Read/ReadVariableOp:0(\0012\'Adam/beta_1/Initializer/initial_value:08\001"
+ value: "\n\rAdam/beta_2:0\022\022Adam/beta_2/Assign\032!Adam/beta_2/Read/ReadVariableOp:0(\0012\'Adam/beta_2/Initializer/initial_value:08\001"
+ value: "\n\014Adam/decay:0\022\021Adam/decay/Assign\032 Adam/decay/Read/ReadVariableOp:0(\0012&Adam/decay/Initializer/initial_value:08\001"
+ }
+ }
+ }
+ signature_def {
+ key: "serving_default"
+ value {
+ inputs {
+ key: "input_embedding_product_slug"
+ value {
+ name: "input_embedding_user_guid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ inputs {
+ key: "input_embedding_user_guid"
+ value {
+ name: "input_embedding_product_slug:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 32
+ }
+ }
+ }
+ }
+ outputs {
+ key: "output"
+ value {
+ name: "sigmoid_out/Sigmoid:0"
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ method_name: "tensorflow/serving/predict"
+ }
+ }
+}
diff --git a/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001 b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001
new file mode 100644
index 00000000000..8339979323b
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.data-00000-of-00001
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.index b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.index
new file mode 100644
index 00000000000..cf999e88e22
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/Model_C/factorization_machine_v1/export/standard/variables/variables.index
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/modelv1/saved_model.pb b/model-integration/src/test/models/tensorflow/external/modelv1/saved_model.pb
new file mode 100644
index 00000000000..223ad4baf59
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/modelv1/saved_model.pb
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.data-00000-of-00001 b/model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.data-00000-of-00001
new file mode 100644
index 00000000000..76e3a429612
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.data-00000-of-00001
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.index b/model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.index
new file mode 100644
index 00000000000..285449d22c5
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/modelv1/variables/variables.index
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/modelv2/saved_model.pb b/model-integration/src/test/models/tensorflow/external/modelv2/saved_model.pb
new file mode 100644
index 00000000000..e2af4d90552
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/modelv2/saved_model.pb
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.data-00000-of-00001 b/model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.data-00000-of-00001
new file mode 100644
index 00000000000..4bc7ff8a5d5
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.data-00000-of-00001
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.index b/model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.index
new file mode 100644
index 00000000000..398e369c5e3
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/modelv2/variables/variables.index
Binary files differ
diff --git a/model-integration/src/test/models/tensorflow/external/train.py b/model-integration/src/test/models/tensorflow/external/train.py
new file mode 100644
index 00000000000..b015f1ff5af
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/train.py
@@ -0,0 +1,52 @@
+import numpy as np
+import tensorflow as tf
+import tensorflow.keras.backend as K
+
+from tensorflow.keras.layers import Input, Dense, concatenate
+from tensorflow.keras.models import Model
+
+input_user = Input(shape=(3,))
+input_ad = Input(shape=(3,))
+
+merged = concatenate([input_user, input_ad])
+output_1 = Dense(64, activation='relu')(merged)
+output_2 = Dense(64, activation='relu')(output_1)
+predictions = Dense(1)(output_2)
+
+model = Model(inputs=[input_user, input_ad], outputs=predictions)
+model.compile(optimizer='adam',
+ loss='binary_crossentropy',
+ metrics=['accuracy'])
+model.summary()
+
+SAMPLES = 1000
+user_data = np.random.rand(SAMPLES,3)
+ad_data = np.random.rand(SAMPLES,3)
+labels = np.random.rand(SAMPLES,1)
+print(user_data[:10])
+print(ad_data[:10])
+print(labels[:10])
+
+model.fit([user_data, ad_data], labels, epochs=10, ) # starts training
+
+user_data_sample1 = np.random.rand(1, 3)
+ad_data_sample1 = np.random.rand(1, 3)
+
+print("predicting for:")
+print(user_data_sample1)
+print(ad_data_sample1)
+predictions = model.predict([user_data_sample1, ad_data_sample1])
+print(predictions)
+
+signature = tf.saved_model.signature_def_utils.predict_signature_def(
+ inputs={'input1': model.inputs[0],'input2': model.inputs[1] }, outputs={'pctr': model.outputs[0]})
+
+builder = tf.saved_model.builder.SavedModelBuilder('modelv1')
+builder.add_meta_graph_and_variables(
+ sess=K.get_session(),
+ tags=[tf.saved_model.tag_constants.SERVING],
+ signature_def_map={
+ tf.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY:
+ signature
+ })
+builder.save()
diff --git a/model-integration/src/test/models/tensorflow/external/train_embed.py b/model-integration/src/test/models/tensorflow/external/train_embed.py
new file mode 100644
index 00000000000..7aae61b49a7
--- /dev/null
+++ b/model-integration/src/test/models/tensorflow/external/train_embed.py
@@ -0,0 +1,65 @@
+import numpy as np
+import tensorflow as tf
+import tensorflow.keras.backend as K
+
+from tensorflow.keras.layers import Input, Dense, concatenate, Embedding, Reshape
+from tensorflow.keras.models import Model
+
+input_user = Input(shape=(3,))
+input_ad = Input(shape=(3,))
+gender_samples = Input(shape=(1,), dtype='int32')
+
+gender_values = ['m', 'f', 'a']
+
+gender_embeddings = Embedding(len(gender_values), 1)(gender_samples)
+reshape_gender = Reshape(target_shape=[1])(gender_embeddings)
+
+model2 = Model(inputs=[gender_samples], outputs=reshape_gender)
+model2.summary()
+
+merged = concatenate([input_user, input_ad, reshape_gender])
+output_1 = Dense(64, activation='relu')(merged)
+output_2 = Dense(64, activation='relu')(output_1)
+predictions = Dense(1)(output_2)
+
+model = Model(inputs=[input_user, input_ad, gender_samples], outputs=predictions)
+model.compile(optimizer='adam',
+ loss='binary_crossentropy',
+ metrics=['accuracy'])
+model.summary()
+
+SAMPLES = 1000
+user_data = np.random.rand(SAMPLES,3)
+ad_data = np.random.rand(SAMPLES,3)
+gender_data = np.random.randint(len(gender_values), size=SAMPLES)
+labels = np.random.rand(SAMPLES,1)
+print(user_data[:10])
+print(ad_data[:10])
+print(gender_data[:10])
+print(labels[:10])
+
+model.fit([user_data, ad_data, gender_data], labels, epochs=10, ) # starts training
+
+user_data_sample1 = np.random.rand(1, 3)
+ad_data_sample1 = np.random.rand(1, 3)
+gender_data_sample1 = np.random.randint(len(gender_values), size=1)
+
+print("predicting for:")
+print(user_data_sample1)
+print(ad_data_sample1)
+print(gender_data_sample1)
+predictions = model.predict([user_data_sample1, ad_data_sample1, gender_data_sample1])
+print(predictions)
+
+signature = tf.saved_model.signature_def_utils.predict_signature_def(
+ inputs={'input1': model.inputs[0],'input2': model.inputs[1], 'input3': model.inputs[2] }, outputs={'pctrx': model.outputs[0]})
+
+builder = tf.saved_model.builder.SavedModelBuilder('modelv2')
+builder.add_meta_graph_and_variables(
+ sess=K.get_session(),
+ tags=[tf.saved_model.tag_constants.SERVING],
+ signature_def_map={
+ tf.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY:
+ signature
+ })
+builder.save()
diff --git a/vespajlib/abi-spec.json b/vespajlib/abi-spec.json
index 47b066b15a6..4ec1a5a234b 100644
--- a/vespajlib/abi-spec.json
+++ b/vespajlib/abi-spec.json
@@ -2063,6 +2063,21 @@
],
"fields": []
},
+ "com.yahoo.tensor.functions.ScalarFunctions$LeakyRelu": {
+ "superClass": "java.lang.Object",
+ "interfaces": [
+ "java.util.function.DoubleUnaryOperator"
+ ],
+ "attributes": [
+ "public"
+ ],
+ "methods": [
+ "public void <init>()",
+ "public double applyAsDouble(double)",
+ "public java.lang.String toString()"
+ ],
+ "fields": []
+ },
"com.yahoo.tensor.functions.ScalarFunctions$Less": {
"superClass": "java.lang.Object",
"interfaces": [
@@ -2429,6 +2444,7 @@
"public static java.util.function.DoubleUnaryOperator relu()",
"public static java.util.function.DoubleUnaryOperator rsqrt()",
"public static java.util.function.DoubleUnaryOperator selu()",
+ "public static java.util.function.DoubleUnaryOperator leakyrelu()",
"public static java.util.function.DoubleUnaryOperator sin()",
"public static java.util.function.DoubleUnaryOperator sigmoid()",
"public static java.util.function.DoubleUnaryOperator sqrt()",
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 eabeb8905f7..e8e329cd75c 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/functions/ScalarFunctions.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/ScalarFunctions.java
@@ -47,6 +47,7 @@ public class ScalarFunctions {
public static DoubleUnaryOperator relu() { return new Relu(); }
public static DoubleUnaryOperator rsqrt() { return new Rsqrt(); }
public static DoubleUnaryOperator selu() { return new Selu(); }
+ public static DoubleUnaryOperator leakyrelu() { return new LeakyRelu(); }
public static DoubleUnaryOperator sin() { return new Sin(); }
public static DoubleUnaryOperator sigmoid() { return new Sigmoid(); }
public static DoubleUnaryOperator sqrt() { return new Sqrt(); }
@@ -248,6 +249,13 @@ public class ScalarFunctions {
public String toString() { return "f(a)(" + scale + " * if(a >= 0, a, " + alpha + " * (exp(a) - 1)))"; }
}
+ public static class LeakyRelu implements DoubleUnaryOperator {
+ @Override
+ public double applyAsDouble(double operand) { return Math.max(0.01 * operand, operand); }
+ @Override
+ public String toString() { return "f(a)(max(0.01*a, a))"; }
+ }
+
public static class Sin implements DoubleUnaryOperator {
@Override
public double applyAsDouble(double operand) { return Math.sin(operand); }
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/TensorFunction.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/TensorFunction.java
index 1086d91da31..810651bbcfb 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/functions/TensorFunction.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/TensorFunction.java
@@ -39,7 +39,7 @@ public abstract class TensorFunction {
/**
* Evaluates this tensor.
*
- * @param context a context which must be passed to all nexted functions when evaluating
+ * @param context a context which must be passed to all nested functions when evaluating
*/
public abstract <NAMETYPE extends TypeContext.Name> Tensor evaluate(EvaluationContext<NAMETYPE> context);