From 05626f9fc3b7084b34535bf0cd44f79d8fcee649 Mon Sep 17 00:00:00 2001 From: Jingtian Peng Date: Fri, 19 Aug 2016 22:54:58 +0800 Subject: [PATCH 001/223] Docs(Queue): Fix a PriorityQueue API missing bug Add the description of `class PriorityQueue()` API in /python/ops/data_flow_ops.py. From line #714 to #759 you can check [here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/data_flow_ops.py) --- tensorflow/g3doc/api_docs/python/io_ops.md | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tensorflow/g3doc/api_docs/python/io_ops.md b/tensorflow/g3doc/api_docs/python/io_ops.md index c1433adbb5..39eb046845 100644 --- a/tensorflow/g3doc/api_docs/python/io_ops.md +++ b/tensorflow/g3doc/api_docs/python/io_ops.md @@ -2079,6 +2079,57 @@ queue has been closed. +- - - + +### `class tf.PriorityQueue` {#PriorityQueue} + +A queue implementation that dequeues elements in prioritized order. + +See [`tf.QueueBase`](#QueueBase) for a description of the methods on +this class. + +- - - + + +#### `tf.PriorityQueue.__init__(capacity, types, shapes=None, names=None, shared_name=None, name='priority_queue')` {#PriorityQueue.__init__} + +Creates a queue that dequeues elements in a first-in first-out order. + +A `PriorityQueue` has bounded capacity; supports multiple concurrent +producers and consumers; and provides exactly-once delivery. + +A `PriorityQueue` holds a list of up to `capacity` elements. Each +element is a fixed-length tuple of tensors whose dtypes are +described by `types`, and whose shapes are optionally described +by the `shapes` argument. + +If the `shapes` argument is specified, each component of a queue +element must have the respective fixed shape. If it is +unspecified, different queue elements may have different shapes, +but the use of `dequeue_many` is disallowed. + +Enqueues and Dequeues to the `PriorityQueue` must include an additional +tuple entry at the beginning: the `priority`. The priority must be +an int64 scalar (for `enqueue`) or an int64 vector (for `enqueue_many`). + +##### Args: +* `capacity`: An integer. The upper bound on the number of elements + that may be stored in this queue. +* `types`: A list of `DType` objects. The length of `types` must equal + the number of tensors in each queue element, except the first priority + element. The first tensor in each element is the priority, + which must be type int64. +* `shapes`: (Optional.) A list of fully-defined `TensorShape` objects + with the same length as `dtypes`, or `None`. +* `names`: (Optional.) A list of string naming the components in the queue + with the same length as `dtypes`, or `None`. If specified the dequeue + methods return a dictionary with the names as keys. +* `shared_name`: (Optional.) If non-empty, this queue will be shared under + the given name across multiple sessions. +* `name`: Optional name for the queue operation. + + + ## Dealing with the filesystem -- GitLab From 3d3fbf4fb576f60c9f689cfe852d42c7ca84832f Mon Sep 17 00:00:00 2001 From: Pieter de Rijk Date: Sat, 20 Aug 2016 20:46:54 +0200 Subject: [PATCH 002/223] Modified tensorboard message with correct URL --- tensorflow/tensorboard/tensorboard.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tensorflow/tensorboard/tensorboard.py b/tensorflow/tensorboard/tensorboard.py index 7757956b38..6ca7dfc16b 100644 --- a/tensorflow/tensorboard/tensorboard.py +++ b/tensorflow/tensorboard/tensorboard.py @@ -138,7 +138,13 @@ def main(unused_argv=None): status_bar.SetupStatusBarInsideGoogle('TensorBoard %s' % tag, FLAGS.port) print('Starting TensorBoard %s on port %d' % (tag, FLAGS.port)) - print('(You can navigate to http://%s:%d)' % (FLAGS.host, FLAGS.port)) + + hostname = socket.gethostname() + if FLAGS.host == "0.0.0.0": + print('(You can navigate to http://%s:%d)' % (socket.gethostname(), FLAGS.port)) + else: + print('(You can navigate to http://%s:%d)' % (FLAGS.host, FLAGS.port)) + tb_server.serve_forever() -- GitLab From eec92db0eae46f3241be8a7472555854b8fa3b17 Mon Sep 17 00:00:00 2001 From: Pieter de Rijk Date: Sun, 21 Aug 2016 12:01:26 +0200 Subject: [PATCH 003/223] Modified the output message, so if FLAGS.host is set to 0.0.0.0 it will display the correct IP-address on the prompt --- tensorflow/tensorboard/tensorboard.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tensorflow/tensorboard/tensorboard.py b/tensorflow/tensorboard/tensorboard.py index 6ca7dfc16b..273065ea3f 100644 --- a/tensorflow/tensorboard/tensorboard.py +++ b/tensorflow/tensorboard/tensorboard.py @@ -139,9 +139,8 @@ def main(unused_argv=None): status_bar.SetupStatusBarInsideGoogle('TensorBoard %s' % tag, FLAGS.port) print('Starting TensorBoard %s on port %d' % (tag, FLAGS.port)) - hostname = socket.gethostname() if FLAGS.host == "0.0.0.0": - print('(You can navigate to http://%s:%d)' % (socket.gethostname(), FLAGS.port)) + print('(You can navigate to http://%s:%d)' % (socket.gethostbyname(socket.gethostname()), FLAGS.port)) else: print('(You can navigate to http://%s:%d)' % (FLAGS.host, FLAGS.port)) -- GitLab From 5b16538a6348da7191add43f0904047007125d94 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 22 Aug 2016 11:17:08 -0800 Subject: [PATCH 004/223] Add tests for _stochastic_dependencies_map Change: 130967459 --- .../kernel_tests/stochastic_graph_test.py | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_graph_test.py b/tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_graph_test.py index 172c474d13..1c21b786f7 100644 --- a/tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_graph_test.py +++ b/tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_graph_test.py @@ -354,5 +354,47 @@ class TestSurrogateLosses(tf.test.TestCase): self.assertAllClose(*sess.run([sl_dt2, sum([loss, dt2_term])])) +class StochasticDependenciesMapTest(tf.test.TestCase): + + def testBuildsMapOfUpstreamNodes(self): + dt1 = sg.DistributionTensor(distributions.Normal, mu=0., sigma=1.) + dt2 = sg.DistributionTensor(distributions.Normal, mu=0., sigma=1.) + out1 = dt1.value() + 1. + out2 = dt2.value() + 2. + x = out1 + out2 + y = out2 * 3. + dep_map = sg._stochastic_dependencies_map([x, y]) + self.assertEqual(dep_map[dt1], set([x])) + self.assertEqual(dep_map[dt2], set([x, y])) + + def testHandlesStackedStochasticNodes(self): + dt1 = sg.DistributionTensor(distributions.Normal, mu=0., sigma=1.) + out1 = dt1.value() + 1. + dt2 = sg.DistributionTensor(distributions.Normal, mu=out1, sigma=1.) + x = dt2.value() + 2. + dt3 = sg.DistributionTensor(distributions.Normal, mu=0., sigma=1.) + y = dt3.value() * 3. + dep_map = sg._stochastic_dependencies_map([x, y]) + self.assertEqual(dep_map[dt1], set([x])) + self.assertEqual(dep_map[dt2], set([x])) + self.assertEqual(dep_map[dt3], set([y])) + + def testTraversesControlInputs(self): + dt1 = sg.DistributionTensor(distributions.Normal, mu=0., sigma=1.) + logits = dt1.value() * 3. + dt2 = sg.DistributionTensor(distributions.Bernoulli, logits=logits) + dt3 = sg.DistributionTensor(distributions.Normal, mu=0., sigma=1.) + x = dt3.value() + y = tf.ones((2, 2)) * 4. + z = tf.ones((2, 2)) * 3. + out = tf.cond( + tf.cast(dt2, tf.bool), lambda: tf.add(x, y), lambda: tf.square(z)) + out += 5. + dep_map = sg._stochastic_dependencies_map([out]) + self.assertEqual(dep_map[dt1], set([out])) + self.assertEqual(dep_map[dt2], set([out])) + self.assertEqual(dep_map[dt3], set([out])) + + if __name__ == "__main__": tf.test.main() -- GitLab From 6feae52e911bc5c4614073964f60cb96cfe9f128 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 22 Aug 2016 11:21:23 -0800 Subject: [PATCH 005/223] Update generated Python Op docs. Change: 130967884 --- .../api_docs/python/contrib.framework.md | 110 ++++++++++++++++++ ...ontrib.framework.assign_from_checkpoint.md | 23 ++++ ...tf.contrib.framework.assign_from_values.md | 24 ++++ ...contrib.framework.assign_from_values_fn.md | 22 ++++ ...rib.framework.assign_from_checkpoint_fn.md | 29 +++++ tensorflow/g3doc/api_docs/python/index.md | 4 + 6 files changed, 212 insertions(+) create mode 100644 tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.assign_from_checkpoint.md create mode 100644 tensorflow/g3doc/api_docs/python/functions_and_classes/shard6/tf.contrib.framework.assign_from_values.md create mode 100644 tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.contrib.framework.assign_from_values_fn.md create mode 100644 tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.contrib.framework.assign_from_checkpoint_fn.md diff --git a/tensorflow/g3doc/api_docs/python/contrib.framework.md b/tensorflow/g3doc/api_docs/python/contrib.framework.md index 0a6c811924..63f612dbfd 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.framework.md +++ b/tensorflow/g3doc/api_docs/python/contrib.framework.md @@ -521,6 +521,116 @@ tensor (using `assert_global_step`). Otherwise find a global step tensor using was found. +- - - + +### `tf.contrib.framework.assign_from_checkpoint(model_path, var_list)` {#assign_from_checkpoint} + +Creates an operation to assign specific variables from a checkpoint. + +##### Args: + + +* `model_path`: The full path to the model checkpoint. To get latest checkpoint + use `model_path = tf.train.latest_checkpoint(checkpoint_dir)` +* `var_list`: A list of `Variable` objects or a dictionary mapping names in the + checkpoint to the correspoing variables to initialize. If empty or None, + it would return no_op(), None. + +##### Returns: + + the restore_op and the feed_dict that need to be run to restore var_list. + +##### Raises: + + +* `ValueError`: If the checkpoint specified at `model_path` is missing one of + the variables in `var_list`. + + +- - - + +### `tf.contrib.framework.assign_from_checkpoint_fn(model_path, var_list, ignore_missing_vars=False, reshape_variables=False)` {#assign_from_checkpoint_fn} + +Returns a function that assigns specific variables from a checkpoint. + +##### Args: + + +* `model_path`: The full path to the model checkpoint. To get latest checkpoint + use `model_path = tf.train.latest_checkpoint(checkpoint_dir)` +* `var_list`: A list of `Variable` objects or a dictionary mapping names in the + checkpoint to the correspoing variables to initialize. If empty or None, + it would return no_op(), None. +* `ignore_missing_vars`: Boolean, if True it would ignore variables missing in + the checkpoint with a warning instead of failing. +* `reshape_variables`: Boolean, if True it would automatically reshape variables + which are of different shape then the ones stored in the checkpoint but + which have the same number of elements. + +##### Returns: + + A function that takes a single argument, a `tf.Session`, that applies the + assignment operation. + +##### Raises: + + +* `ValueError`: If the checkpoint specified at `model_path` is missing one of + the variables in `var_list`. + + +- - - + +### `tf.contrib.framework.assign_from_values(var_names_to_values)` {#assign_from_values} + +Creates an assignment operation from a given mapping. + +This function provides a mechanism for performing assignment of variables +to values in a way that does not fill the graph with large assignment values. + +##### Args: + + +* `var_names_to_values`: A map from variable names to values. + +##### Returns: + + +* `assign_op`: An `Operation` that assigns each of the given variables to the + requested values. +* `feed_dict`: The feed dictionary to use when evaluating `assign_op`. + +##### Raises: + + +* `ValueError`: if any of the given variable names were not found. + + +- - - + +### `tf.contrib.framework.assign_from_values_fn(var_names_to_values)` {#assign_from_values_fn} + +Returns a function that assigns specific variables from the given values. + +This function provides a mechanism for performing assignment of variables +to values in a way that does not fill the graph with large assignment values. + +##### Args: + + +* `var_names_to_values`: A map from variable names to values. + +##### Returns: + + A function that takes a single argument, a `tf.Session`, that applies the + assignment operation. + +##### Raises: + + +* `ValueError`: if any of the given variable names were not found. + + - - - ### `tf.contrib.framework.create_global_step(graph=None)` {#create_global_step} diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.assign_from_checkpoint.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.assign_from_checkpoint.md new file mode 100644 index 0000000000..947e672688 --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.contrib.framework.assign_from_checkpoint.md @@ -0,0 +1,23 @@ +### `tf.contrib.framework.assign_from_checkpoint(model_path, var_list)` {#assign_from_checkpoint} + +Creates an operation to assign specific variables from a checkpoint. + +##### Args: + + +* `model_path`: The full path to the model checkpoint. To get latest checkpoint + use `model_path = tf.train.latest_checkpoint(checkpoint_dir)` +* `var_list`: A list of `Variable` objects or a dictionary mapping names in the + checkpoint to the correspoing variables to initialize. If empty or None, + it would return no_op(), None. + +##### Returns: + + the restore_op and the feed_dict that need to be run to restore var_list. + +##### Raises: + + +* `ValueError`: If the checkpoint specified at `model_path` is missing one of + the variables in `var_list`. + diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard6/tf.contrib.framework.assign_from_values.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard6/tf.contrib.framework.assign_from_values.md new file mode 100644 index 0000000000..6560f08281 --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard6/tf.contrib.framework.assign_from_values.md @@ -0,0 +1,24 @@ +### `tf.contrib.framework.assign_from_values(var_names_to_values)` {#assign_from_values} + +Creates an assignment operation from a given mapping. + +This function provides a mechanism for performing assignment of variables +to values in a way that does not fill the graph with large assignment values. + +##### Args: + + +* `var_names_to_values`: A map from variable names to values. + +##### Returns: + + +* `assign_op`: An `Operation` that assigns each of the given variables to the + requested values. +* `feed_dict`: The feed dictionary to use when evaluating `assign_op`. + +##### Raises: + + +* `ValueError`: if any of the given variable names were not found. + diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.contrib.framework.assign_from_values_fn.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.contrib.framework.assign_from_values_fn.md new file mode 100644 index 0000000000..9a5a82c8c4 --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.contrib.framework.assign_from_values_fn.md @@ -0,0 +1,22 @@ +### `tf.contrib.framework.assign_from_values_fn(var_names_to_values)` {#assign_from_values_fn} + +Returns a function that assigns specific variables from the given values. + +This function provides a mechanism for performing assignment of variables +to values in a way that does not fill the graph with large assignment values. + +##### Args: + + +* `var_names_to_values`: A map from variable names to values. + +##### Returns: + + A function that takes a single argument, a `tf.Session`, that applies the + assignment operation. + +##### Raises: + + +* `ValueError`: if any of the given variable names were not found. + diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.contrib.framework.assign_from_checkpoint_fn.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.contrib.framework.assign_from_checkpoint_fn.md new file mode 100644 index 0000000000..e4d183b990 --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.contrib.framework.assign_from_checkpoint_fn.md @@ -0,0 +1,29 @@ +### `tf.contrib.framework.assign_from_checkpoint_fn(model_path, var_list, ignore_missing_vars=False, reshape_variables=False)` {#assign_from_checkpoint_fn} + +Returns a function that assigns specific variables from a checkpoint. + +##### Args: + + +* `model_path`: The full path to the model checkpoint. To get latest checkpoint + use `model_path = tf.train.latest_checkpoint(checkpoint_dir)` +* `var_list`: A list of `Variable` objects or a dictionary mapping names in the + checkpoint to the correspoing variables to initialize. If empty or None, + it would return no_op(), None. +* `ignore_missing_vars`: Boolean, if True it would ignore variables missing in + the checkpoint with a warning instead of failing. +* `reshape_variables`: Boolean, if True it would automatically reshape variables + which are of different shape then the ones stored in the checkpoint but + which have the same number of elements. + +##### Returns: + + A function that takes a single argument, a `tf.Session`, that applies the + assignment operation. + +##### Raises: + + +* `ValueError`: If the checkpoint specified at `model_path` is missing one of + the variables in `var_list`. + diff --git a/tensorflow/g3doc/api_docs/python/index.md b/tensorflow/g3doc/api_docs/python/index.md index 9562ade43f..c93190c139 100644 --- a/tensorflow/g3doc/api_docs/python/index.md +++ b/tensorflow/g3doc/api_docs/python/index.md @@ -652,6 +652,10 @@ * [`assert_or_get_global_step`](../../api_docs/python/contrib.framework.md#assert_or_get_global_step) * [`assert_same_float_dtype`](../../api_docs/python/contrib.framework.md#assert_same_float_dtype) * [`assert_scalar_int`](../../api_docs/python/contrib.framework.md#assert_scalar_int) + * [`assign_from_checkpoint`](../../api_docs/python/contrib.framework.md#assign_from_checkpoint) + * [`assign_from_checkpoint_fn`](../../api_docs/python/contrib.framework.md#assign_from_checkpoint_fn) + * [`assign_from_values`](../../api_docs/python/contrib.framework.md#assign_from_values) + * [`assign_from_values_fn`](../../api_docs/python/contrib.framework.md#assign_from_values_fn) * [`convert_to_tensor_or_sparse_tensor`](../../api_docs/python/contrib.framework.md#convert_to_tensor_or_sparse_tensor) * [`create_global_step`](../../api_docs/python/contrib.framework.md#create_global_step) * [`deprecated`](../../api_docs/python/contrib.framework.md#deprecated) -- GitLab From ee7332cec10ed8ee1f908f272e050d739fa5cf9e Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 22 Aug 2016 11:44:02 -0800 Subject: [PATCH 006/223] Wrap all ops created by report_uninitialized_variables in a name_scope. Previously ops were created outside of a scope leading to the ugly occurrence of bare ops in TensorBoard. Change: 130970109 --- tensorflow/python/ops/variables.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tensorflow/python/ops/variables.py b/tensorflow/python/ops/variables.py index 4d1af8bcca..47ced90acd 100644 --- a/tensorflow/python/ops/variables.py +++ b/tensorflow/python/ops/variables.py @@ -1031,20 +1031,19 @@ def report_uninitialized_variables(var_list=None, for op in ops.get_default_graph().get_operations(): if op.type in ["Variable", "AutoReloadVariable"]: var_list.append(op.outputs[0]) - if not var_list: - # Return an empty tensor so we only need to check for returned tensor - # size being 0 as an indication of model ready. - return array_ops.constant([], dtype=dtypes.string, name=name) - else: - # Get a 1-D boolean tensor listing whether each variable is initialized. - variables_mask = math_ops.logical_not( - array_ops.pack([state_ops.is_variable_initialized(v) for v in var_list - ])) - # Get a 1-D string tensor containing all the variable names. - variable_names_tensor = array_ops.constant([s.op.name for s in var_list]) - # Return a 1-D tensor containing all the names of uninitialized variables. - return array_ops.boolean_mask( - variable_names_tensor, variables_mask, name=name) + with ops.name_scope(name): + if not var_list: + # Return an empty tensor so we only need to check for returned tensor + # size being 0 as an indication of model ready. + return array_ops.constant([], dtype=dtypes.string) + else: + # Get a 1-D boolean tensor listing whether each variable is initialized. + variables_mask = math_ops.logical_not(array_ops.pack( + [state_ops.is_variable_initialized(v) for v in var_list])) + # Get a 1-D string tensor containing all the variable names. + variable_names_tensor = array_ops.constant([s.op.name for s in var_list]) + # Return a 1-D tensor containing all the names of uninitialized variables. + return array_ops.boolean_mask(variable_names_tensor, variables_mask) # pylint: disable=protected-access ops.register_tensor_conversion_function(Variable, -- GitLab From 317b6d0e3a66ea446e793eb65a397786e62f8d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Man=C3=A9?= Date: Mon, 22 Aug 2016 11:46:23 -0800 Subject: [PATCH 007/223] Autogenerated Change: Release TensorBoard at TAG: 26 Change: 130970371 --- tensorflow/tensorboard/TAG | 2 +- .../tensorboard/dist/tf-tensorboard.html | 6886 +++++++++-------- 2 files changed, 3558 insertions(+), 3330 deletions(-) diff --git a/tensorflow/tensorboard/TAG b/tensorflow/tensorboard/TAG index 6f4247a625..f64f5d8d85 100644 --- a/tensorflow/tensorboard/TAG +++ b/tensorflow/tensorboard/TAG @@ -1 +1 @@ -26 +27 diff --git a/tensorflow/tensorboard/dist/tf-tensorboard.html b/tensorflow/tensorboard/dist/tf-tensorboard.html index 0c1a6111b2..dc39c8fa10 100644 --- a/tensorflow/tensorboard/dist/tf-tensorboard.html +++ b/tensorflow/tensorboard/dist/tf-tensorboard.html @@ -112,1506 +112,308 @@ var TF; - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - /** - * Re-renders the chart. Useful if e.g. the container size changed. - */ - redraw: function() { - this._chart.redraw(); + + + - + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + - .sidebar-section:first-child { - border: none; - } - .sidebar-section:last-child { - flex-grow: 1; - display: flex; - } + + + - paper-checkbox { - --paper-checkbox-checked-color: var(--tb-ui-dark-accent); - --paper-checkbox-unchecked-color: var(--tb-ui-dark-accent); + - - - - + - - - - - - + - + +