Skip to content

Commit f89ba48

Browse files
A. Unique TensorFlowerVijay Vasudevan
authored andcommitted
Colocate the constant initializer of the adagrad accumulator with the variable
and the accumulator. Change: 113391069
1 parent 743e80d commit f89ba48

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

tensorflow/examples/android/BUILD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ cc_binary(
5858

5959
cc_library(
6060
name = "tensorflow_native_libs",
61-
srcs = [
61+
tags = [
62+
"manual",
63+
"notap",
64+
],
65+
deps = [
6266
":libpthread.so",
6367
":libtensorflow_demo.so",
6468
],

tensorflow/python/training/adagrad.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ def __init__(self, learning_rate, initial_accumulator_value=0.1,
6060

6161
def _create_slots(self, var_list):
6262
for v in var_list:
63-
val = constant_op.constant(self._initial_accumulator_value,
64-
shape=v.get_shape())
63+
with ops.device(v.device):
64+
val = constant_op.constant(self._initial_accumulator_value,
65+
shape=v.get_shape())
6566
self._get_or_make_slot(v, val, "accumulator", self._name)
6667

6768
def _prepare(self):

0 commit comments

Comments
 (0)