aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-03-23 13:13:09 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-03-23 14:19:16 -0700
commitf6e7205516eeb54d3e85b5d283c2d7a387ec81bc (patch)
treed0c59643de015bf4f3b9023f7150addd3732dfe5
parent99e298a84775fcfe91ce0e2d40566d4bd00f53f9 (diff)
Add dependency for contrib kernels.
Change: 117967381
-rw-r--r--.gitmodules2
-rw-r--r--tensorflow/contrib/BUILD4
-rw-r--r--tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py8
3 files changed, 8 insertions, 6 deletions
diff --git a/.gitmodules b/.gitmodules
index 1b17ea57b9..0edca21239 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
[submodule "google/protobuf"]
path = google/protobuf
- url = https://github.com/google/protobuf.git
+ url = https://github.googlesource.com/google/protobuf.git
diff --git a/tensorflow/contrib/BUILD b/tensorflow/contrib/BUILD
index 708cfddefc..ece038a572 100644
--- a/tensorflow/contrib/BUILD
+++ b/tensorflow/contrib/BUILD
@@ -11,7 +11,7 @@ py_library(
name = "contrib_py",
srcs = glob(["**/*.py"]),
srcs_version = "PY2AND3",
- visibility = ["//tensorflow:internal"],
+ visibility = ["//visibility:public"],
deps = [
"//tensorflow/contrib/ctc:ctc_py",
"//tensorflow/contrib/distributions:distributions_py",
@@ -28,7 +28,7 @@ cc_library(
name = "contrib_kernels",
visibility = ["//visibility:public"],
deps = [
- "//tensorflow/contrib/linear_optimizer/kernels:sdca_ops",
+ "//tensorflow/contrib/linear_optimizer:sdca_op_kernels",
],
)
diff --git a/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py b/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py
index a54b631ef2..06c986beb3 100644
--- a/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py
+++ b/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py
@@ -224,14 +224,16 @@ class SdcaModel(object):
fv = array_ops.reshape(st_i.values, [-1])
# TODO(sibyl-Aix6ihai): This does not work if examples have empty features.
result += math_ops.segment_sum(
- math_ops.mul(
- array_ops.gather(sv, fi), fv), array_ops.reshape(ei, [-1]))
+ math_ops.mul(array_ops.gather(sv, fi), fv), ei)
dense_features = self._convert_n_to_tensor(examples['dense_features'])
dense_variables = self._convert_n_to_tensor(self._variables[
'dense_features_weights'])
+
for i in range(len(dense_variables)):
result += dense_features[i] * dense_variables[i]
- return result
+
+ # Reshaping to allow shape inference at graph construction time.
+ return array_ops.reshape(result, [-1])
def predictions(self, examples):
"""Add operations to compute predictions by the model.