platform/upstream/tensorflow.git
6 years agoPrototype for tf.data writer API.
Jiri Simsa [Thu, 19 Apr 2018 17:14:09 +0000 (10:14 -0700)]
Prototype for tf.data writer API.

PiperOrigin-RevId: 193534333

6 years agoAdded support for concatenation and slicing of symbolic shapes
Benoit Steiner [Thu, 19 Apr 2018 17:05:08 +0000 (10:05 -0700)]
Added support for concatenation and slicing of symbolic shapes

PiperOrigin-RevId: 193532769

6 years agoCreate a skeleton tf.contrib.checkpoint.
Allen Lavoie [Thu, 19 Apr 2018 16:54:40 +0000 (09:54 -0700)]
Create a skeleton tf.contrib.checkpoint.

My plan for this is to incubate tools for working with object-based checkpoints:
  - Tools for managing dependency graphs, e.g. checkpointable lists/dictionaries
  - Inspecting/visualizing checkpoints
  - Listing variables and gathering initializers from a Checkpointable object
    and its dependencies
  - Verifying all variables are accessible as dependencies, which should make
    converting existing graph building Saver uses easier/safer.

This CL includes none of those things, it just moves the split_dependency tool
here instead of contrib/eager.

PiperOrigin-RevId: 193531292

6 years ago[tf.data] Add checkpointing support for MapAndBatchDataset.
Saurabh Saxena [Thu, 19 Apr 2018 16:37:20 +0000 (09:37 -0700)]
[tf.data] Add checkpointing support for MapAndBatchDataset.

PiperOrigin-RevId: 193528712

6 years agoDisable dlopen error of libneuralnetworks for non-Android platforms.
A. Unique TensorFlower [Thu, 19 Apr 2018 16:34:24 +0000 (09:34 -0700)]
Disable dlopen error of libneuralnetworks for non-Android platforms.

PiperOrigin-RevId: 193528346

6 years ago[TF:XLA] Change HloTestBase::ExecuteNoHloPasses to return a literal directly.
A. Unique TensorFlower [Thu, 19 Apr 2018 16:23:35 +0000 (09:23 -0700)]
[TF:XLA] Change HloTestBase::ExecuteNoHloPasses to return a literal directly.

PiperOrigin-RevId: 193526900

6 years agoPin pip to version 9.0.3
A. Unique TensorFlower [Thu, 19 Apr 2018 16:13:47 +0000 (09:13 -0700)]
Pin pip to version 9.0.3

* This is because pip 10 is still unstable in some distros
* reference: https://github.com/pypa/pip/issues/5240

PiperOrigin-RevId: 193525542

6 years agoTeach the conditinal simplifier about sharding.
A. Unique TensorFlower [Thu, 19 Apr 2018 14:13:03 +0000 (07:13 -0700)]
Teach the conditinal simplifier about sharding.

PiperOrigin-RevId: 193510638

6 years agoUpdate the Colorbot demo to use a Keras model in addition to the Estimator.
A. Unique TensorFlower [Thu, 19 Apr 2018 13:58:34 +0000 (06:58 -0700)]
Update the Colorbot demo to use a Keras model in addition to the Estimator.

PiperOrigin-RevId: 193508874

6 years agoSupport for converting entire class hierarchies:
A. Unique TensorFlower [Thu, 19 Apr 2018 12:11:30 +0000 (05:11 -0700)]
Support for converting entire class hierarchies:
 * limit the methods being converted to those that have not been inherited from the superclass
 * include the (possibly compiled) superclass in the definition of the compiled class
 * either mark the superclass for conversion or generate an absolute aliased import line, depending on whether it's whitelisted

PiperOrigin-RevId: 193499204

6 years agoHandle corner case in Python 3: members annotated with @classmethod.
A. Unique TensorFlower [Thu, 19 Apr 2018 11:27:38 +0000 (04:27 -0700)]
Handle corner case in Python 3: members annotated with @classmethod.

PiperOrigin-RevId: 193495506

6 years agoSet the random seed in on-demand mode.
A. Unique TensorFlower [Thu, 19 Apr 2018 09:58:31 +0000 (02:58 -0700)]
Set the random seed in on-demand mode.

PiperOrigin-RevId: 193488103

6 years agoUpdate feature_util's GetFeatures to show compile-time error for unsupported types...
A. Unique TensorFlower [Thu, 19 Apr 2018 08:56:31 +0000 (01:56 -0700)]
Update feature_util's GetFeatures to show compile-time error for unsupported types instead of a link-time error.

PiperOrigin-RevId: 193480683

6 years agoRemove proto import in header files for core/kernels/boosted_trees.
Yifei Feng [Thu, 19 Apr 2018 08:26:07 +0000 (01:26 -0700)]
Remove proto import in header files for core/kernels/boosted_trees.
Move implementations that requires declaration of TreeEnsemble to .cc files.

The goal is to make kernels mostly independent of proto headers, which will let us lock down our .so import

PiperOrigin-RevId: 193478404

6 years agodocs: Add a note on building the C and/or Java API binaries from source.
Asim Shankar [Thu, 19 Apr 2018 07:28:33 +0000 (00:28 -0700)]
docs: Add a note on building the C and/or Java API binaries from source.

See #15290

PiperOrigin-RevId: 193473886

6 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Thu, 19 Apr 2018 06:46:34 +0000 (23:46 -0700)]
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 193471104

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Thu, 19 Apr 2018 06:18:50 +0000 (23:18 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 193469437

6 years ago[tf.data] Add native implementation for `tf.contrib.data.unbatch()`.
Derek Murray [Thu, 19 Apr 2018 05:59:01 +0000 (22:59 -0700)]
[tf.data] Add native implementation for `tf.contrib.data.unbatch()`.

The implementation has two main improvements:
1. Avoid relatively expensive (~15us) function invocation for each incoming batch.
2. Use std::move() where possible to avoid copying strings/variants into the unbatched
   elements.

PiperOrigin-RevId: 193467856

6 years ago[XLA] Fix BF16 propagation bug for while condition.
Yuanzhong Xu [Thu, 19 Apr 2018 05:07:12 +0000 (22:07 -0700)]
[XLA] Fix BF16 propagation bug for while condition.

PiperOrigin-RevId: 193465140

6 years agoInitial addition of CLZ HLO
Jacques Pienaar [Thu, 19 Apr 2018 04:15:41 +0000 (21:15 -0700)]
Initial addition of CLZ HLO

* Adds the HLO op and lowering on CPU/GPU/evaluator;
* This does not update the operation semantics;

PiperOrigin-RevId: 193461989

6 years agoExpose tf.contrib.training.{prepend_from_queue_and_padded_batch_dataset}
Eugene Brevdo [Thu, 19 Apr 2018 03:15:27 +0000 (20:15 -0700)]
Expose tf.contrib.training.{prepend_from_queue_and_padded_batch_dataset}

Also its helper method "enqueue_in_queue_dataset".

PiperOrigin-RevId: 193458095

6 years agoUse the host implementation of vec permute op if the input on the host. Note
Yao Zhang [Thu, 19 Apr 2018 03:04:56 +0000 (20:04 -0700)]
Use the host implementation of vec permute op if the input on the host. Note
that the op still needs to be placed on the GPU so that it stays within the
same partiion with the neighboring ops, and as a result, no unnecessary send
and recv are created.

PiperOrigin-RevId: 193457328

6 years agoTeach the reshape mover pass about sharding.
A. Unique TensorFlower [Thu, 19 Apr 2018 03:02:52 +0000 (20:02 -0700)]
Teach the reshape mover pass about sharding.

PiperOrigin-RevId: 193457083

6 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Thu, 19 Apr 2018 02:49:12 +0000 (19:49 -0700)]
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 193456151

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Thu, 19 Apr 2018 02:18:33 +0000 (19:18 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 193454093

6 years agoTeach transpose folding about sharding.
A. Unique TensorFlower [Thu, 19 Apr 2018 01:49:37 +0000 (18:49 -0700)]
Teach transpose folding about sharding.

PiperOrigin-RevId: 193451839

6 years ago[TF TensorLists] Add TensorListConcatLists
Eugene Brevdo [Thu, 19 Apr 2018 01:49:02 +0000 (18:49 -0700)]
[TF TensorLists] Add TensorListConcatLists

TensorListConcat concatenates two TensorLists' entries (supports non-scalar
Tensors containing TensorLists).

PiperOrigin-RevId: 193451787

6 years agoVarious lint fixes to TensorFlow detected after GitHub merge.
Michael Case [Thu, 19 Apr 2018 01:04:44 +0000 (18:04 -0700)]
Various lint fixes to TensorFlow detected after GitHub merge.

PiperOrigin-RevId: 193448139

6 years agoEnable for all gpus.
Yao Zhang [Thu, 19 Apr 2018 00:48:49 +0000 (17:48 -0700)]
Enable for all gpus.

PiperOrigin-RevId: 193446717

6 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Thu, 19 Apr 2018 00:46:46 +0000 (17:46 -0700)]
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 193446519

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Thu, 19 Apr 2018 00:18:52 +0000 (17:18 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 193443417

6 years agoFix reference name.
A. Unique TensorFlower [Thu, 19 Apr 2018 00:09:06 +0000 (17:09 -0700)]
Fix reference name.

PiperOrigin-RevId: 193442269

6 years agoReplace space in "Fraction of Zero Values" with _ because using space is illegal...
A. Unique TensorFlower [Thu, 19 Apr 2018 00:05:04 +0000 (17:05 -0700)]
Replace space in "Fraction of Zero Values" with _ because using space is illegal and will be auto replaced.

PiperOrigin-RevId: 193441676

6 years agoAdd a ten-second timeout to the DeleteWorkerSession call.
Derek Murray [Thu, 19 Apr 2018 00:04:46 +0000 (17:04 -0700)]
Add a ten-second timeout to the DeleteWorkerSession call.

Previously, `MasterSession::Close()` did not block on the cleanup RPCs
to the individual workers, leading to deployments where the remote
workers might be shut down (e.g. by an external mechanism) before the
session was closed. In order to switch over to using
DeleteWorkerSession for all sessions, and preserve backwards
compatibility, we need to permit this behavior. Therefore, this CL
adds a 10-second timeout on the requests to workers, and logs an error
if the request does not succeed in that time period.

PiperOrigin-RevId: 193441618

6 years agoAdd tf.train.Checkpoint for reading and writing object-based checkpoints.
Allen Lavoie [Wed, 18 Apr 2018 23:48:17 +0000 (16:48 -0700)]
Add tf.train.Checkpoint for reading and writing object-based checkpoints.

Previously exposed as tf.contrib.eager.Checkpoint / tfe.Checkpoint.

Spiffies up the documentation a bit, but otherwise just adds the export decorator.

Compatible in both directions with tf.train.Saver (object-based checkpoints can be fed to tf.train.Saver, and name-based checkpoints can be fed to tf.train.Checkpoint).

PiperOrigin-RevId: 193439442

6 years agoChange distribution.distribute_dataset to accept an input_fn instead of a dataset.
Yuefeng Zhou [Wed, 18 Apr 2018 23:35:44 +0000 (16:35 -0700)]
Change distribution.distribute_dataset to accept an input_fn instead of a dataset.

PiperOrigin-RevId: 193437651

6 years agoAdds dataset transformation function `set_stats_aggregator(..)`, which sets the given...
Shivani Agrawal [Wed, 18 Apr 2018 23:01:55 +0000 (16:01 -0700)]
Adds dataset transformation function `set_stats_aggregator(..)`, which sets the given `stats_aggregator` for aggregating the input dataset stats.

PiperOrigin-RevId: 193432590

6 years agoDisable failing test RGBToHSVTest.testBatch
HyoukJoong Lee [Wed, 18 Apr 2018 22:57:53 +0000 (15:57 -0700)]
Disable failing test RGBToHSVTest.testBatch

PiperOrigin-RevId: 193431888

6 years agoRemove duplicate code.
A. Unique TensorFlower [Wed, 18 Apr 2018 22:47:12 +0000 (15:47 -0700)]
Remove duplicate code.

PiperOrigin-RevId: 193430279

6 years agoHave TensorFlow Distributions share name scopes across method calls.
Dustin Tran [Wed, 18 Apr 2018 22:38:38 +0000 (15:38 -0700)]
Have TensorFlow Distributions share name scopes across method calls.
END_PUBLIC

*** Reason for rollback ***

Roll forward, allowing distributions to have same names across objects.

*** Original change description ***

BEGIN_PUBLIC
Automated g4 rollback of changelist 190728742

PiperOrigin-RevId: 193428925

6 years agoAutomated g4 rollback of changelist 192180356
Dimitris Vardoulakis [Wed, 18 Apr 2018 22:30:30 +0000 (15:30 -0700)]
Automated g4 rollback of changelist 192180356

PiperOrigin-RevId: 193427566

6 years agoNever use the LegacySession when a Master explicitly calls CreateWorkerSession.
Derek Murray [Wed, 18 Apr 2018 22:27:05 +0000 (15:27 -0700)]
Never use the LegacySession when a Master explicitly calls CreateWorkerSession.

Previously, if the session handle was unrecognized by the worker, it
would default to using the LegacySession. This prevents us from
noticing that a server has been restarted.

To address the problem in a backwards-compatible way, we add a bit to
each session-handle-carrying worker request, indicating whether the
master believes that CreateWorkerSession has been called. If this bit
is set and the handle is unrecognized, the worker will raise an
AbortedError, which can be caught by high-level frameworks such as
`tf.estimator`.

Note that CreateWorkerSession is not yet used by default, and a
follow-up change will add that.

PiperOrigin-RevId: 193427057

6 years agoA very simple AST pattern matcher. Only supports wildcards, and it's minimally tested...
A. Unique TensorFlower [Wed, 18 Apr 2018 22:25:42 +0000 (15:25 -0700)]
A very simple AST pattern matcher. Only supports wildcards, and it's minimally tested. When using, you may want to add your use case to the tests.

PiperOrigin-RevId: 193426859

6 years agoFix loss computation bug in Model training/eval methods with eager execution enabled.
Francois Chollet [Wed, 18 Apr 2018 22:04:21 +0000 (15:04 -0700)]
Fix loss computation bug in Model training/eval methods with eager execution enabled.
Fixes #18642.

PiperOrigin-RevId: 193423288

6 years agoFix a bug in GcsFileSystem that inconsistent read error may not be revealed if
A. Unique TensorFlower [Wed, 18 Apr 2018 22:02:44 +0000 (15:02 -0700)]
Fix a bug in GcsFileSystem that inconsistent read error may not be revealed if
the requested read size is larger than the block size.

PiperOrigin-RevId: 193422905

6 years agoMerged commit includes the following changes:
A. Unique TensorFlower [Wed, 18 Apr 2018 22:02:26 +0000 (15:02 -0700)]
Merged commit includes the following changes:
193422827  by yifeif:

    Fix buildifier error.

--
193421691  by skyewm:

    Make GraphModeFunctions work with _USE_C_SHAPES=True.

    Tensor._handle_data is going away. This change adds special hooks for
    propagating the resource handle shape information through
    EagerTensors.

--
193421473  by A. Unique TensorFlower:

    Register dynamic_stitch for DT_VARIANT type.

--
193421175  by nolivia:

    disabling flaky tsan test

--
193420117  by nolivia:

    disabling flaky test in tensorflow that has no apparent culprit

--

PiperOrigin-RevId: 193422827

6 years agoAdds an implementation of the precision at recall metric.
A. Unique TensorFlower [Wed, 18 Apr 2018 21:38:07 +0000 (14:38 -0700)]
Adds an implementation of the precision at recall metric.

PiperOrigin-RevId: 193418737

6 years agoIncrease shard count of :init_ops_test.
A. Unique TensorFlower [Wed, 18 Apr 2018 21:34:50 +0000 (14:34 -0700)]
Increase shard count of :init_ops_test.

PiperOrigin-RevId: 193418147

6 years agoAllow turning off checkpointing for ShardedMutableDenseHashTable. Keep the checkpoint...
A. Unique TensorFlower [Wed, 18 Apr 2018 21:30:01 +0000 (14:30 -0700)]
Allow turning off checkpointing for ShardedMutableDenseHashTable. Keep the checkpointing=True as the default.

PiperOrigin-RevId: 193417350

6 years agoAutomated g4 rollback of changelist 193392688
Chris Kennelly [Wed, 18 Apr 2018 21:07:23 +0000 (14:07 -0700)]
Automated g4 rollback of changelist 193392688

PiperOrigin-RevId: 193413401

6 years agoIf the summary is empty, return empty list for quantiles.
A. Unique TensorFlower [Wed, 18 Apr 2018 21:07:10 +0000 (14:07 -0700)]
If the summary is empty, return empty list for quantiles.

PiperOrigin-RevId: 193413363

6 years agoReplace six.get_unbound_function with a simpler version that doesn't crash for method...
A. Unique TensorFlower [Wed, 18 Apr 2018 20:54:52 +0000 (13:54 -0700)]
Replace six.get_unbound_function with a simpler version that doesn't crash for methods of tf.keras.Model.

PiperOrigin-RevId: 193411332

6 years ago[XLA] Redesign: add arguments, result, and execution_platform to HloProto, because...
A. Unique TensorFlower [Wed, 18 Apr 2018 20:54:43 +0000 (13:54 -0700)]
[XLA] Redesign: add arguments, result, and execution_platform to HloProto, because the SessionModule has those.

PiperOrigin-RevId: 193411310

6 years agoUse the new gather HLO in the bridge when lowering TF gather ops; NFC
Sanjoy Das [Wed, 18 Apr 2018 20:47:17 +0000 (13:47 -0700)]
Use the new gather HLO in the bridge when lowering TF gather ops; NFC

After gather expansion this should boil down to a while loop very similar to
what we emit from the bridge today.

PiperOrigin-RevId: 193410095

6 years agoInternal-only change.
Justin Lebar [Wed, 18 Apr 2018 20:46:37 +0000 (13:46 -0700)]
Internal-only change.

PiperOrigin-RevId: 193409980

6 years agoCatch OSError in gen_git_source.py subprocess call.
Michael Case [Wed, 18 Apr 2018 20:29:43 +0000 (13:29 -0700)]
Catch OSError in gen_git_source.py subprocess call.

OSError occurs if git cannot be found. This is a initial fix for some
Windows build errors.

PiperOrigin-RevId: 193407250

6 years agoPrevent access to deallocated hash map upon exit().
A. Unique TensorFlower [Wed, 18 Apr 2018 20:13:02 +0000 (13:13 -0700)]
Prevent access to deallocated hash map upon exit().

PiperOrigin-RevId: 193404950

6 years agoImproves error messaging for bad (empty) CSV files.
Stanley Bileschi [Wed, 18 Apr 2018 20:12:04 +0000 (13:12 -0700)]
Improves error messaging for bad (empty) CSV files.

PiperOrigin-RevId: 193404804

6 years agoMoving all state (variables) required for _EmbeddingColumn and _SharedEmbeddingColumn...
Rohan Jain [Wed, 18 Apr 2018 19:51:56 +0000 (12:51 -0700)]
Moving all state (variables) required for _EmbeddingColumn and _SharedEmbeddingColumn into a base.Layer

PiperOrigin-RevId: 193401873

6 years agoCreate specialized functions in optimized graph for each function instantiation context.
A. Unique TensorFlower [Wed, 18 Apr 2018 19:32:53 +0000 (12:32 -0700)]
Create specialized functions in optimized graph for each function instantiation context.

PiperOrigin-RevId: 193399263

6 years agoMinor test improvement
Jiri Simsa [Wed, 18 Apr 2018 19:26:03 +0000 (12:26 -0700)]
Minor test improvement

PiperOrigin-RevId: 193398068

6 years agoAutomated g4 rollback of changelist 193369280
A. Unique TensorFlower [Wed, 18 Apr 2018 19:13:24 +0000 (12:13 -0700)]
Automated g4 rollback of changelist 193369280

PiperOrigin-RevId: 193396206

6 years agoMake toco generate uint8 weights that are safe for fast int8 kernels.
A. Unique TensorFlower [Wed, 18 Apr 2018 19:10:51 +0000 (12:10 -0700)]
Make toco generate uint8 weights that are safe for fast int8 kernels.

PiperOrigin-RevId: 193395910

6 years agoAdd support for initializable iterator in distribution strategies. Use that in estimator.
Priya Gupta [Wed, 18 Apr 2018 19:03:32 +0000 (12:03 -0700)]
Add support for initializable iterator in distribution strategies. Use that in estimator.

PiperOrigin-RevId: 193394603

6 years agoExpose an API for invoking sized delete.
Chris Kennelly [Wed, 18 Apr 2018 18:50:46 +0000 (11:50 -0700)]
Expose an API for invoking sized delete.

Sized delete avoids a costly lookup to map the pointer to the allocated size
when this information is commonly available (Allocator::Deallocate).  As this
code also provides an alignment, we only use these paths when aligned new is
available.

PiperOrigin-RevId: 193392688

6 years agoChange operands of subtraction expression to have well-defined behaviour.
A. Unique TensorFlower [Wed, 18 Apr 2018 18:46:07 +0000 (11:46 -0700)]
Change operands of subtraction expression to have well-defined behaviour.

At present, signed arithmetic overflows (i.e. has undefined behaviour) in general, e.g. when computing 0 - INT_MIN or INT_MAX - INT_MIN. The fact that we want the result in the unsigned type does not help us here.

The fix is to convert the operands to the corresponding unsigned type first and then perform the operation in unsigned arithmetic, which is well-defined and has the correct subtraction behaviour.

PiperOrigin-RevId: 193391813

6 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Wed, 18 Apr 2018 17:28:47 +0000 (10:28 -0700)]
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 193378249

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Wed, 18 Apr 2018 17:27:48 +0000 (10:27 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 193378087

6 years agoSimplify the break canonicalization transformer to use more of the base transformer...
A. Unique TensorFlower [Wed, 18 Apr 2018 16:40:21 +0000 (09:40 -0700)]
Simplify the break canonicalization transformer to use more of the base transformer helpers. Add support for the loop's else block.

PiperOrigin-RevId: 193370640

6 years agoUpdating some more tests in constant_folding_test.cc so that the tests evaluate the...
A. Unique TensorFlower [Wed, 18 Apr 2018 16:30:17 +0000 (09:30 -0700)]
Updating some more tests in constant_folding_test.cc so that the tests evaluate the original and optimized graphs and check if their outputs are the same.

PiperOrigin-RevId: 193369280

6 years agoAvoid generating degenerate dimensions during gather expansions
Sanjoy Das [Wed, 18 Apr 2018 16:03:21 +0000 (09:03 -0700)]
Avoid generating degenerate dimensions during gather expansions

This gets rid of two cases that used to introduce degenerate dimensions
(dimensions with bound = 1) into the while loop state:

 - Previously we'd explicitly reshape gathers using scalar indices to have a
   minor degenerate dimension.  With this CL we no longer do that - instead we
   push this into the code that looks up the index vector from the gather
   indices tensor.
 - Previously we'd have the accumulator (the tensor we're
   dynamic-update-slice-ing into) contain all of the degenerate window dims that
   the gather op would later elide (after the while loop).  With this CL we
   eagerly elide these dimensions as we slice out individual windows from the
   operand.

PiperOrigin-RevId: 193365863

6 years agoAllow default min/max ranges for int16 data types.
A. Unique TensorFlower [Wed, 18 Apr 2018 15:40:40 +0000 (08:40 -0700)]
Allow default min/max ranges for int16 data types.

PiperOrigin-RevId: 193362891

6 years agoFix bug in importing while loops within a while loop.
Skye Wanderman-Milne [Wed, 18 Apr 2018 15:10:05 +0000 (08:10 -0700)]
Fix bug in importing while loops within a while loop.

PiperOrigin-RevId: 193358699

6 years agoEnable the n=1 special case in the DeserializeSparse op.
Derek Murray [Wed, 18 Apr 2018 07:18:50 +0000 (00:18 -0700)]
Enable the n=1 special case in the DeserializeSparse op.

The optimized case was previously dead because of two off-by-one errors (mea culpa).

PiperOrigin-RevId: 193314065

6 years agoNo public changes.
Noah Eisen [Wed, 18 Apr 2018 06:06:57 +0000 (23:06 -0700)]
No public changes.

PiperOrigin-RevId: 193309262

6 years ago[XLA] Convert XLA to use xla::se as a namespace alias for ::stream_executor.
Justin Lebar [Wed, 18 Apr 2018 04:04:35 +0000 (21:04 -0700)]
[XLA] Convert XLA to use xla::se as a namespace alias for ::stream_executor.

PiperOrigin-RevId: 193301997

6 years agoDisable CheckpointSaverHook when both save_checkpoints_secs and
Chris Ying [Wed, 18 Apr 2018 03:31:30 +0000 (20:31 -0700)]
Disable CheckpointSaverHook when both save_checkpoints_secs and
save_checkpoints_steps are None

PiperOrigin-RevId: 193299688

6 years agoComment out part of ring_reducer_test suspected to have a race.
A. Unique TensorFlower [Wed, 18 Apr 2018 01:48:38 +0000 (18:48 -0700)]
Comment out part of ring_reducer_test suspected to have a race.

PiperOrigin-RevId: 193292788

6 years agoMinor cleanups to the gather expander; NFC
Sanjoy Das [Wed, 18 Apr 2018 00:17:04 +0000 (17:17 -0700)]
Minor cleanups to the gather expander; NFC

This change is NFC now, but it makes the code more general and this generality
will be used later on.  For instance

  ExpandFirstDimIntoNDims(transposed_gather_indices, {1, shape.dimensions(0)})

does not work if shape is a scalar shape (and this fine because today shape is
never scalar) but

  PrependDegenerateDims(transposed_gather_indices, 1)

works fine if transposed_gather_indices is scalar (and it will be, in a future
change).

PiperOrigin-RevId: 193283404

6 years agoTpuStrategy -> TPUStrategy
Jonathan Hseu [Tue, 17 Apr 2018 23:24:42 +0000 (16:24 -0700)]
TpuStrategy -> TPUStrategy

PiperOrigin-RevId: 193275991

6 years agoFix CheckpointSaverHook to properly save every save_checkpoints_steps for TPU workloads.
Chris Ying [Tue, 17 Apr 2018 22:28:12 +0000 (15:28 -0700)]
Fix CheckpointSaverHook to properly save every save_checkpoints_steps for TPU workloads.

PiperOrigin-RevId: 193266515

6 years agoInternal Change.
Michael Case [Tue, 17 Apr 2018 22:01:22 +0000 (15:01 -0700)]
Internal Change.

PiperOrigin-RevId: 193262066

6 years agoDon't consider control flow edges when computing switch depth of switch.
Jacques Pienaar [Tue, 17 Apr 2018 21:47:44 +0000 (14:47 -0700)]
Don't consider control flow edges when computing switch depth of switch.

PiperOrigin-RevId: 193259710

6 years agoUse easy_install to update pip only on Ubuntu14.04
A. Unique TensorFlower [Tue, 17 Apr 2018 21:33:53 +0000 (14:33 -0700)]
Use easy_install to update pip only on Ubuntu14.04

* We only depends on easy_install/easy_install3 to update pip on Ubuntu14.04
* They are not always available for later system e.g. debian9
* We can use pip/pip3 to update themselves

PiperOrigin-RevId: 193257326

6 years ago[StreamExecutor] Rename ::perftools::gputools -> ::stream_executor, part 1.
Justin Lebar [Tue, 17 Apr 2018 21:26:16 +0000 (14:26 -0700)]
[StreamExecutor] Rename ::perftools::gputools -> ::stream_executor, part 1.

Step 1 of re-namespace'ing StreamExecutor into ::stream_executor.

This moves everything inside of stream_executor/..., and leaves a
namespace alias into ::perftools::gputools.  The next steps will clean
up users to use the new namespace.

This is mostly a mechanical change, but it also includes a bunch of
non-mechanical changes that ideally would be split out into separate
patches.  Unfortunately they all sort of need to be shoved in here for
various reasons:

 - forward declarations need to be in the same namespace as the actual
   types, so we need to change all forward declarations of
   StreamExecutor types in this one patch.

 - Uses of these forward declarations need to be changed to the new
   namespace (or otherwise we need to add a namespace alias to the
   relevant header, but this is pretty ugly).

 - Various initialization code needs to live in StreamExecutor's "real"
   namespace, so all this needs to be changed.

PiperOrigin-RevId: 193256128

6 years ago[XLA] Redesign: support xla::XlaComputation in compile-only client and service.
A. Unique TensorFlower [Tue, 17 Apr 2018 20:36:46 +0000 (13:36 -0700)]
[XLA] Redesign: support xla::XlaComputation in compile-only client and service.

PiperOrigin-RevId: 193247845

6 years agoMake GroupRec* const in GroupRecCallback by marking mu mutable in
A. Unique TensorFlower [Tue, 17 Apr 2018 20:36:24 +0000 (13:36 -0700)]
Make GroupRec* const in GroupRecCallback by marking mu mutable in
CollectiveParamResolverLocal::GroupRec.

PiperOrigin-RevId: 193247799

6 years agoUse is_constructible instead of is_convertible.
Akshay Modi [Tue, 17 Apr 2018 20:31:54 +0000 (13:31 -0700)]
Use is_constructible instead of is_convertible.

Before this, all objects would follow the slow path (since nothing is
convertible to AlphaNum since it has a private copy constructor).

Before:
entry {
  name: "MicroBenchmarks.benchmark_defun_matmul_2_by_2_CPU"
  iters: 30000
  wall_time: 67.5895690918
  extras {
    key: "examples_per_sec"
    value {
      double_value: 14795.1823549
    }
  }
}

After:
entry {
  name: "MicroBenchmarks.benchmark_defun_matmul_2_by_2_CPU"
  iters: 30000
  wall_time: 61.0044002533
  extras {
    key: "examples_per_sec"
    value {
      double_value: 16392.2601623
    }
  }
}
PiperOrigin-RevId: 193247183

6 years agoUnpack multiple assignments when processing lists. This supports the cases "a, b...
A. Unique TensorFlower [Tue, 17 Apr 2018 20:30:45 +0000 (13:30 -0700)]
Unpack multiple assignments when processing lists. This supports the cases "a, b = [], []" and "[a, b] = [], []". Also expand the static analysis to support list unpacking constructs.

PiperOrigin-RevId: 193247024

6 years agoInternal change.
Allen Lavoie [Tue, 17 Apr 2018 20:27:46 +0000 (13:27 -0700)]
Internal change.

PiperOrigin-RevId: 193246563

6 years agoFixing a bug in strided slice. The op was not handling negative indices correctly.
A. Unique TensorFlower [Tue, 17 Apr 2018 20:20:42 +0000 (13:20 -0700)]
Fixing a bug in strided slice. The op was not handling negative indices correctly.

PiperOrigin-RevId: 193245539

6 years agoCache the ag_internal module, to avoid falsely rejecting it when in the namespace...
A. Unique TensorFlower [Tue, 17 Apr 2018 19:52:34 +0000 (12:52 -0700)]
Cache the ag_internal module, to avoid falsely rejecting it when in the namespace of a previously converted function. Explicitly reject lambda functions, for now, becasue they require special treatment.

PiperOrigin-RevId: 193241279

6 years ago[XLA] Fix arguments to IsSparseArray and IsDenseArray
A. Unique TensorFlower [Tue, 17 Apr 2018 19:36:20 +0000 (12:36 -0700)]
[XLA] Fix arguments to IsSparseArray and IsDenseArray

PiperOrigin-RevId: 193238920

6 years agoFix the test gensym to prevent creating duplicate names in the same test.
A. Unique TensorFlower [Tue, 17 Apr 2018 19:31:42 +0000 (12:31 -0700)]
Fix the test gensym to prevent creating duplicate names in the same test.

PiperOrigin-RevId: 193238314

6 years agoRelaxes the type constraints for the features in ServingInputReceiver, so it will...
A. Unique TensorFlower [Tue, 17 Apr 2018 19:31:36 +0000 (12:31 -0700)]
Relaxes the type constraints for the features in ServingInputReceiver, so it will accept anything convertible to a Tensor or SparseTensor.

This makes it possible to use with tf.contrib.labeled_tensor.

PiperOrigin-RevId: 193238295

6 years agoRemoves another custom implementation of ZeroCopyInputStream, instead uses the now...
Noah Eisen [Tue, 17 Apr 2018 19:21:10 +0000 (12:21 -0700)]
Removes another custom implementation of ZeroCopyInputStream, instead uses the now public gRPC implementation.

Also, moves GrpcByteSource to grpc_util, to keep it near the other serialization code.

Lastly, gives a more verbose error if serialization (unparsing) fails (which should not ever happen).

PiperOrigin-RevId: 193236893

6 years agoAutomated g4 rollback of changelist 193168327
Yifei Feng [Tue, 17 Apr 2018 19:07:33 +0000 (12:07 -0700)]
Automated g4 rollback of changelist 193168327

PiperOrigin-RevId: 193234819

6 years agoMoving gradient registration for CudnnRNN op from contrib to core.
Pavithra Vijay [Tue, 17 Apr 2018 19:06:50 +0000 (12:06 -0700)]
Moving gradient registration for CudnnRNN op from contrib to core.

PiperOrigin-RevId: 193234663

6 years agoFixes and cleanup to support more complex quantized models and adds PropagateFakeQuan...
A. Unique TensorFlower [Tue, 17 Apr 2018 18:53:29 +0000 (11:53 -0700)]
Fixes and cleanup to support more complex quantized models and adds PropagateFakeQuantNumBits.

PiperOrigin-RevId: 193232630

6 years agoReplace decode_image with decode_jpeg to avoid ValueError in datasets programmers...
Mingxing Tan [Tue, 17 Apr 2018 18:48:43 +0000 (11:48 -0700)]
Replace decode_image with decode_jpeg to avoid ValueError in datasets programmers guide.

PiperOrigin-RevId: 193231717