platform/upstream/tensorflow.git
6 years agoAdded an experimental C API to dump TF_Graph in a human-readable format, for
Mingsheng Hong [Thu, 22 Mar 2018 00:38:04 +0000 (17:38 -0700)]
Added an experimental C API to dump TF_Graph in a human-readable format, for
debugging purposes.

PiperOrigin-RevId: 189997099

6 years agoSmall convenience changes.
A. Unique TensorFlower [Thu, 22 Mar 2018 00:34:52 +0000 (17:34 -0700)]
Small convenience changes.

PiperOrigin-RevId: 189996801

6 years agoShorter definitions for elementwise_ops in op_level_cost_estimator.
Max Galkin [Wed, 21 Mar 2018 23:00:44 +0000 (16:00 -0700)]
Shorter definitions for elementwise_ops in op_level_cost_estimator.

PiperOrigin-RevId: 189983460

6 years agoChange Softmax on CUDA to use fp32 for denominator when input/output are fp16.
James Qin [Wed, 21 Mar 2018 22:55:30 +0000 (15:55 -0700)]
Change Softmax on CUDA to use fp32 for denominator when input/output are fp16.

This avoids potential overflow in the denominator, also makes sure accumulation is done
in high precision.

PiperOrigin-RevId: 189982655

6 years ago[TF:XLA] do not emit bfloat16 sum reductions from tf2xla
Nick Desaulniers [Wed, 21 Mar 2018 22:23:07 +0000 (15:23 -0700)]
[TF:XLA] do not emit bfloat16 sum reductions from tf2xla

bfloat16 is a storage format, not a computation format. Doing reductions in
this reduced precision is prone to quickly overflow.  Instead, emit a float32
computation, and wrap the reduce params and result in conversions to and from float32.

PiperOrigin-RevId: 189977590

6 years agoAdd an alternative "no_contrib" BUILD target to tensorflow/python to avoid including...
A. Unique TensorFlower [Wed, 21 Mar 2018 21:59:06 +0000 (14:59 -0700)]
Add an alternative "no_contrib" BUILD target to tensorflow/python to avoid including contrib packages

PiperOrigin-RevId: 189973359

6 years agoAvoid taking a reference on a temporary value
Benoit Steiner [Wed, 21 Mar 2018 21:26:14 +0000 (14:26 -0700)]
Avoid taking a reference on a temporary value

PiperOrigin-RevId: 189967517

6 years ago[XLA][BF16] Add bf16 rounding function.
Yunxing Dai [Wed, 21 Mar 2018 21:12:07 +0000 (14:12 -0700)]
[XLA][BF16] Add bf16 rounding function.

We now use truncation to convert a F32 to BF16 by default. This CL adds a rounding method (basically a roll forward of the rounding part in cl/175252067).

PiperOrigin-RevId: 189965138

6 years ago[docs] Update explicit latest_checkpoint with `path` returned while saving for object...
Shivani Agrawal [Wed, 21 Mar 2018 20:57:29 +0000 (13:57 -0700)]
[docs] Update explicit latest_checkpoint with `path` returned while saving for object-based checkpointing.

PiperOrigin-RevId: 189962437

6 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Wed, 21 Mar 2018 20:46:27 +0000 (13:46 -0700)]
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 189960595

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Wed, 21 Mar 2018 20:30:26 +0000 (13:30 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 189957912

6 years ago[TF CriticalSection] Bugfix when Execute() inside a while_loop has a dep on a Variabl...
Eugene Brevdo [Wed, 21 Mar 2018 20:28:11 +0000 (13:28 -0700)]
[TF CriticalSection] Bugfix when Execute() inside a while_loop has a dep on a Variable outside of it.

PiperOrigin-RevId: 189957569

6 years agoMake strcat.{h,cc} independent of Eigen.
A. Unique TensorFlower [Wed, 21 Mar 2018 20:08:02 +0000 (13:08 -0700)]
Make strcat.{h,cc} independent of Eigen.

PiperOrigin-RevId: 189954596

6 years agoTemporarily disable constant folding past Enter, since a few breakages have been...
A. Unique TensorFlower [Wed, 21 Mar 2018 19:53:53 +0000 (12:53 -0700)]
Temporarily disable constant folding past Enter, since a few breakages have been observed.

PiperOrigin-RevId: 189952252

6 years agoFurther improve accuracy of op_level_cost_estimator (Gather, GatherV2, Slice).
Max Galkin [Wed, 21 Mar 2018 19:53:04 +0000 (12:53 -0700)]
Further improve accuracy of op_level_cost_estimator (Gather, GatherV2, Slice).

PiperOrigin-RevId: 189952132

6 years ago[XLA] Adding more tests for ReduceWindow.
A. Unique TensorFlower [Wed, 21 Mar 2018 19:40:08 +0000 (12:40 -0700)]
[XLA] Adding more tests for ReduceWindow.

PiperOrigin-RevId: 189950361

6 years agoMade sure to compare all the attributes when comparing nodes
Benoit Steiner [Wed, 21 Mar 2018 19:14:30 +0000 (12:14 -0700)]
Made sure to compare all the attributes when comparing nodes

PiperOrigin-RevId: 189946858

6 years agoMerge changes from github.
Jacques Pienaar [Wed, 21 Mar 2018 19:07:51 +0000 (12:07 -0700)]
Merge changes from github.

PiperOrigin-RevId: 189945839

6 years agoFix compilation error with clang.
Ilya Biryukov [Wed, 21 Mar 2018 19:00:04 +0000 (12:00 -0700)]
Fix compilation error with clang.

Link to breaking CI build:
https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu-clang/232

PiperOrigin-RevId: 189944547

6 years agoDon't run data_utils_test without optimizations.
Justin Lebar [Wed, 21 Mar 2018 18:41:12 +0000 (11:41 -0700)]
Don't run data_utils_test without optimizations.

PiperOrigin-RevId: 189941645

6 years agoMake the graph_editor C-API friendly: always construct ops with their inputs.
Frank Perbet [Wed, 21 Mar 2018 18:40:25 +0000 (11:40 -0700)]
Make the graph_editor C-API friendly: always construct ops with their inputs.

PiperOrigin-RevId: 189941495

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Wed, 21 Mar 2018 18:18:02 +0000 (11:18 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 189937564

6 years agoAllowing dnn tree combined estimator to work with core versions of feature columns...
A. Unique TensorFlower [Wed, 21 Mar 2018 18:16:13 +0000 (11:16 -0700)]
Allowing dnn tree combined estimator to work with core versions of feature columns and losses

PiperOrigin-RevId: 189937063

6 years agoMoves KernelAndDevice to common_runtime
Alexandre Passos [Wed, 21 Mar 2018 18:12:28 +0000 (11:12 -0700)]
Moves KernelAndDevice to common_runtime

PiperOrigin-RevId: 189936396

6 years agoAdding `drop_remainder` option for the `map_and_batch` transformation, which allows...
Jiri Simsa [Wed, 21 Mar 2018 18:10:13 +0000 (11:10 -0700)]
Adding `drop_remainder` option for the `map_and_batch` transformation, which allows the user to express whether they wish to drop the last batch if its size is smaller than desired; the default is not to drop the smaller batch.

PiperOrigin-RevId: 189936029

6 years agoUpdate the doc to reflect the change of replacing std::clock with random::New64(...
A. Unique TensorFlower [Wed, 21 Mar 2018 18:01:54 +0000 (11:01 -0700)]
Update the doc to reflect the change of replacing std::clock with random::New64() as random number generator seed.

PiperOrigin-RevId: 189934377

6 years ago[XLA:GPU] Don't crash if a GTE feeds into a bitcast.
Justin Lebar [Wed, 21 Mar 2018 17:47:18 +0000 (10:47 -0700)]
[XLA:GPU] Don't crash if a GTE feeds into a bitcast.

GTE and bitcast are sort of "implicitly fused", so we have to handle
them in this way.

PiperOrigin-RevId: 189931422

6 years agoFix zipfile path for MacOS builds.
Michael Case [Wed, 21 Mar 2018 17:26:49 +0000 (10:26 -0700)]
Fix zipfile path for MacOS builds.

For some reason, the zipfile module on Macs appears to work differently and
complains about the whl file we are trying to extract not being found.

PiperOrigin-RevId: 189928007

6 years agoCollapse adjacent dimensions that have no paddings.
Jingyue Wu [Wed, 21 Mar 2018 17:20:25 +0000 (10:20 -0700)]
Collapse adjacent dimensions that have no paddings.

For example,

tf.pad(<4D tensor>, [[0, 0], [0, 0], [0, 0], [0, 1]])

is equivalent to a 2D pad, which is faster.

PiperOrigin-RevId: 189926996

6 years agoAdded an option to run shape analysis assuming the shapes of the feed nodes are
Benoit Steiner [Wed, 21 Mar 2018 16:59:18 +0000 (09:59 -0700)]
Added an option to run shape analysis assuming the shapes of the feed nodes are
valid.

PiperOrigin-RevId: 189923541

6 years agoDeletes sequential_feature_column(|_test).py.
A. Unique TensorFlower [Wed, 21 Mar 2018 16:26:16 +0000 (09:26 -0700)]
Deletes sequential_feature_column(|_test).py.

PiperOrigin-RevId: 189919029

6 years agoDon't run tensorflow/python:function_test under fastbuild.
Justin Lebar [Wed, 21 Mar 2018 16:20:28 +0000 (09:20 -0700)]
Don't run tensorflow/python:function_test under fastbuild.

It gets flaky timeouts.

PiperOrigin-RevId: 189918276

6 years agoDeleted dead code and fixed compilation warnings
Benoit Steiner [Wed, 21 Mar 2018 16:19:11 +0000 (09:19 -0700)]
Deleted dead code and fixed compilation warnings

PiperOrigin-RevId: 189918110

6 years agoRefactor pruning code to support custom node rewrites for feeds and fetches.
Derek Murray [Wed, 21 Mar 2018 15:45:19 +0000 (08:45 -0700)]
Refactor pruning code to support custom node rewrites for feeds and fetches.

PiperOrigin-RevId: 189913309

6 years agoMore accurate shape inference for TensorArrayGatherV3 and TensorArrayScatterV3
Benoit Steiner [Wed, 21 Mar 2018 15:40:35 +0000 (08:40 -0700)]
More accurate shape inference for TensorArrayGatherV3 and TensorArrayScatterV3

PiperOrigin-RevId: 189912762

6 years ago[tf.contrib CriticalSection] Avoid deadlocks using additional control dependencies...
Eugene Brevdo [Wed, 21 Mar 2018 15:25:34 +0000 (08:25 -0700)]
[tf.contrib CriticalSection] Avoid deadlocks using additional control dependencies on the lock op.

PiperOrigin-RevId: 189910726

6 years agoAutomated g4 rollback of changelist 189888700
A. Unique TensorFlower [Wed, 21 Mar 2018 15:21:28 +0000 (08:21 -0700)]
Automated g4 rollback of changelist 189888700

PiperOrigin-RevId: 189910239

6 years agoInstall documentation: adds note for virtual env with fish shell
A. Unique TensorFlower [Wed, 21 Mar 2018 14:34:28 +0000 (07:34 -0700)]
Install documentation: adds note for virtual env with fish shell

PiperOrigin-RevId: 189904848

6 years ago[XLA] Initialize arrays using cudaMemset when possible.
Justin Lebar [Wed, 21 Mar 2018 14:33:03 +0000 (07:33 -0700)]
[XLA] Initialize arrays using cudaMemset when possible.

Previously we were using our own hand-rolled initializer thunk.  This
worked OK for reduces, because the amount of data we were initializing
is usually small.  But for e.g. select-and-scatter, it's quite slow.

This patch lets us use cudaMemset instead.

PiperOrigin-RevId: 189904720

6 years agoTensorflow/GCS: Check whether we are running under GCE before trying to obtain auth...
A. Unique TensorFlower [Wed, 21 Mar 2018 13:57:06 +0000 (06:57 -0700)]
Tensorflow/GCS: Check whether we are running under GCE before trying to obtain auth token from GCE. Before this change, if a process is not running under GCE, the token request to metadata server would time out after 3+ minutes of retry. After this change, the check is bypassed, and we return an empty token to the caller. At that point, the caller's request to read/write a file in GCS would either succeed or fail depending on whether the bucket is publicly accessible.

PiperOrigin-RevId: 189900977

6 years agoMinor cosmetic improvement to error message.
A. Unique TensorFlower [Wed, 21 Mar 2018 12:55:32 +0000 (05:55 -0700)]
Minor cosmetic improvement to error message.

PiperOrigin-RevId: 189895415

6 years agoWe were ValueOrDie()ing in one place, and TF_CHECK_OK()ing in another. Both should...
A. Unique TensorFlower [Wed, 21 Mar 2018 11:09:32 +0000 (04:09 -0700)]
We were ValueOrDie()ing in one place, and TF_CHECK_OK()ing in another. Both should gracefully return an error condition.

Add some tests to check this.

PiperOrigin-RevId: 189888700

6 years agoMake graph's name scope thread local so that two threads opening the same scope don...
Priya Gupta [Wed, 21 Mar 2018 06:07:37 +0000 (23:07 -0700)]
Make graph's name scope thread local so that two threads opening the same scope don't get nested under each other.

PiperOrigin-RevId: 189865854

6 years agoMake variable scope and scope counts local to current thread so that they work correc...
Priya Gupta [Wed, 21 Mar 2018 04:39:16 +0000 (21:39 -0700)]
Make variable scope and scope counts local to current thread so that they work correctly in multi-threaded environments.

PiperOrigin-RevId: 189860229

6 years agoC API: fix device + colocation edge case in import_graph_def
Skye Wanderman-Milne [Wed, 21 Mar 2018 04:30:02 +0000 (21:30 -0700)]
C API: fix device + colocation edge case in import_graph_def

This change makes the C API consistent with the Python API, by making
sure that all nodes in a colocation group have the device of the op
named in the "_class" attr (all other ops' devices are ignored). This
is currently done by preserving the current Python logic for
colocation and devices, which only works if all ops start with no
device set. Without this change, imported nodes would have the device
specified in the GraphDef. This change unsets any device before
running the Python logic.

PiperOrigin-RevId: 189859688

6 years agoRemove recently introduced LOG INFO statements from AvgPoolingOp
Smit Hinsu [Wed, 21 Mar 2018 03:25:03 +0000 (20:25 -0700)]
Remove recently introduced LOG INFO statements from AvgPoolingOp

PiperOrigin-RevId: 189856039

6 years agoAdd reduce window tests for the cases when the input shape has 1 element.
A. Unique TensorFlower [Wed, 21 Mar 2018 02:48:18 +0000 (19:48 -0700)]
Add reduce window tests for the cases when the input shape has 1 element.

PiperOrigin-RevId: 189853631

6 years ago[XLA] Plumb hlo dump options via local client.
Chris Leary [Wed, 21 Mar 2018 02:14:26 +0000 (19:14 -0700)]
[XLA] Plumb hlo dump options via local client.

PiperOrigin-RevId: 189851211

6 years agoMinor documentation fix
A. Unique TensorFlower [Wed, 21 Mar 2018 01:45:17 +0000 (18:45 -0700)]
Minor documentation fix

PiperOrigin-RevId: 189848838

6 years ago[XLA] Simpify XlaBuilder: extract common add instruction logic.
A. Unique TensorFlower [Wed, 21 Mar 2018 01:36:33 +0000 (18:36 -0700)]
[XLA] Simpify XlaBuilder: extract common add instruction logic.

PiperOrigin-RevId: 189848174

6 years ago Fixing bug in MultitaskOptimizerWrapper where types of tensors were mismatching.
A. Unique TensorFlower [Wed, 21 Mar 2018 00:00:33 +0000 (17:00 -0700)]
 Fixing bug in MultitaskOptimizerWrapper where types of tensors were mismatching.

PiperOrigin-RevId: 189837743

6 years agoUse softmax_crossentropy_with_logits_v2 in tf.keras since softmax_crossentropy_with_l...
Anjali Sridhar [Tue, 20 Mar 2018 23:32:22 +0000 (16:32 -0700)]
Use softmax_crossentropy_with_logits_v2 in tf.keras since softmax_crossentropy_with_logits is deprecated.

PiperOrigin-RevId: 189833677

6 years ago[XLA] Use IDs instead of names to represent the edges of HLO graph in hlo.proto.
A. Unique TensorFlower [Tue, 20 Mar 2018 23:13:58 +0000 (16:13 -0700)]
[XLA] Use IDs instead of names to represent the edges of HLO graph in hlo.proto.

PiperOrigin-RevId: 189831057

6 years ago[XLA] Make HLO memory schedulers pluggable. Introduce a typedef MemorySchedulerAlgori...
Peter Hawkins [Tue, 20 Mar 2018 23:11:23 +0000 (16:11 -0700)]
[XLA] Make HLO memory schedulers pluggable. Introduce a typedef MemorySchedulerAlgorithm  which is a function instead of an enum to allow experimentation with non-standard schedulers. Refactoring only; no functional changes to the scheduling itself.

PiperOrigin-RevId: 189830685

6 years agoTweak statistical testing test to avoid making a zillion TF session.run calls.
A. Unique TensorFlower [Tue, 20 Mar 2018 22:10:07 +0000 (15:10 -0700)]
Tweak statistical testing test to avoid making a zillion TF session.run calls.

PiperOrigin-RevId: 189819449

6 years ago[XLA] Simplify the HLO proto: don't nest the fusion computation in an fusion HloInstr...
A. Unique TensorFlower [Tue, 20 Mar 2018 21:33:19 +0000 (14:33 -0700)]
[XLA] Simplify the HLO proto: don't nest the fusion computation in an fusion HloInstructionProto.

PiperOrigin-RevId: 189811729

6 years ago[tf.data] Improve docstring for `tf.contrib.data.Counter`.
Derek Murray [Tue, 20 Mar 2018 21:30:36 +0000 (14:30 -0700)]
[tf.data] Improve docstring for `tf.contrib.data.Counter`.

PiperOrigin-RevId: 189811108

6 years agoInternal Change.
Anjali Sridhar [Tue, 20 Mar 2018 21:23:39 +0000 (14:23 -0700)]
Internal Change.

PiperOrigin-RevId: 189809845

6 years agoMakes protobuf dep in tf.contrib.data conditional using if_static().
Terry Koo [Tue, 20 Mar 2018 20:39:42 +0000 (13:39 -0700)]
Makes protobuf dep in tf.contrib.data conditional using if_static().

In non-monolithic builds, adding it unconditionally would duplicate of protobuf symbols among tf.contrib op libraries.  Guarding it with if_static() restricts the dep to monolithic builds, which should be able to dedupe the symbols at link time.

PiperOrigin-RevId: 189800612

6 years agoBuild tflite interpreter from buffer in python interface
A. Unique TensorFlower [Tue, 20 Mar 2018 20:38:09 +0000 (13:38 -0700)]
Build tflite interpreter from buffer in python interface

PiperOrigin-RevId: 189800400

6 years agoImproved the performance of the function optimizer.
Benoit Steiner [Tue, 20 Mar 2018 20:34:02 +0000 (13:34 -0700)]
Improved the performance of the function optimizer.

PiperOrigin-RevId: 189799697

6 years agoIn allocate_transient_arrays.cc, was not handling the case where the same
A. Unique TensorFlower [Tue, 20 Mar 2018 20:02:36 +0000 (13:02 -0700)]
In allocate_transient_arrays.cc, was not handling the case where the same
array occurs more than once in the list of inputs or outputs of a node.

PiperOrigin-RevId: 189794090

6 years agoTFBT: Pass label_keys to the head class constructor.
A. Unique TensorFlower [Tue, 20 Mar 2018 19:56:51 +0000 (12:56 -0700)]
TFBT: Pass label_keys to the head class constructor.

PiperOrigin-RevId: 189793004

6 years agoAdd broadcasting support for fused add or sub.
Mingxing Tan [Tue, 20 Mar 2018 19:54:01 +0000 (12:54 -0700)]
Add broadcasting support for fused add or sub.

PiperOrigin-RevId: 189792542

6 years ago[TF:XLA] Bump open source llvm revision to r327958
Sanjoy Das [Tue, 20 Mar 2018 19:51:50 +0000 (12:51 -0700)]
[TF:XLA] Bump open source llvm revision to r327958

PiperOrigin-RevId: 189792132

6 years agoImproved accuracy of op_level_cost_estimator (QuantizeV2, Dequantize, Gather).
Max Galkin [Tue, 20 Mar 2018 18:45:23 +0000 (11:45 -0700)]
Improved accuracy of op_level_cost_estimator (QuantizeV2, Dequantize, Gather).

PiperOrigin-RevId: 189779691

6 years agoDon't run tensorflow/python:function_test under asan.
A. Unique TensorFlower [Tue, 20 Mar 2018 18:36:07 +0000 (11:36 -0700)]
Don't run tensorflow/python:function_test under asan.

It gets flaky timeouts.

PiperOrigin-RevId: 189777986

6 years agoThe Quantized BroadcastSub portion of #17123
A. Unique TensorFlower [Tue, 20 Mar 2018 18:27:54 +0000 (11:27 -0700)]
The Quantized BroadcastSub portion of #17123

PiperOrigin-RevId: 189776376

6 years agoUpdate version of nsync used by TensorFlow.
A. Unique TensorFlower [Tue, 20 Mar 2018 18:21:40 +0000 (11:21 -0700)]
Update version of nsync used by TensorFlow.

The primary change is that on Linux, the C++11 build of nsync will now use
underlying system primitives to implement a semaphore instead of the C++11
primitives, which are currently surprisingly slow on Linux.

PiperOrigin-RevId: 189775201

6 years agoUse 32 bit induction variable in gather expander
Sanjoy Das [Tue, 20 Mar 2018 18:13:48 +0000 (11:13 -0700)]
Use 32 bit induction variable in gather expander

Right now this is unconditional (and we fail with Unimplemented() if a 32 bit
induction variable is not large enough), but eventually we may want to be
smarter about this.

PiperOrigin-RevId: 189773581

6 years agoReplace std::clock with random::New64() for setting random seed
A. Unique TensorFlower [Tue, 20 Mar 2018 18:12:47 +0000 (11:12 -0700)]
Replace std::clock with random::New64() for setting random seed

PiperOrigin-RevId: 189773399

6 years agoAdd support for automatically wrapping NumPy functions based on a whitelist.
A. Unique TensorFlower [Tue, 20 Mar 2018 18:04:44 +0000 (11:04 -0700)]
Add support for automatically wrapping NumPy functions based on a whitelist.

PiperOrigin-RevId: 189771575

6 years agoRevise the main API for more consistent notation and add a supplemental shortcut...
A. Unique TensorFlower [Tue, 20 Mar 2018 16:27:24 +0000 (09:27 -0700)]
Revise the main API for more consistent notation and add a supplemental shortcut to mark functions as "run in py_func". This is an intermediate step to simplifying the execution of plotting code.

PiperOrigin-RevId: 189753509

6 years agoFixed the bug that the export code triggers the TPU validation.
Jianwei Xie [Tue, 20 Mar 2018 15:32:30 +0000 (08:32 -0700)]
Fixed the bug that the export code triggers the TPU validation.

PiperOrigin-RevId: 189745966

6 years agotfdbg: Curses CLI: Fill line-end whitespace with default color pair
Shanqing Cai [Tue, 20 Mar 2018 15:08:48 +0000 (08:08 -0700)]
tfdbg: Curses CLI: Fill line-end whitespace with default color pair

to prevent spurious color pairs from appearing in certain text
terminal environments.

RELNOTES: Bug fix: tfdbg curses CLI: fix spurious background colors in some text terminals.
PiperOrigin-RevId: 189742433

6 years agoDrop name_scope from operation names during quantization to avoid doubling it up.
A. Unique TensorFlower [Tue, 20 Mar 2018 14:27:16 +0000 (07:27 -0700)]
Drop name_scope from operation names during quantization to avoid doubling it up.

PiperOrigin-RevId: 189737746

6 years agoMake TensorSpec and BoundedTensorSpec serializable.
A. Unique TensorFlower [Tue, 20 Mar 2018 13:28:09 +0000 (06:28 -0700)]
Make TensorSpec and BoundedTensorSpec serializable.

PiperOrigin-RevId: 189731737

6 years agoAdds float64 support for avg pool and its gradient.
Brian Patton [Tue, 20 Mar 2018 13:25:19 +0000 (06:25 -0700)]
Adds float64 support for avg pool and its gradient.

Eigen NumTraits is modified to directly use std::numeric_limits, which resolves a broken test caused by inconsistency between the host and devices values of Eigen::NumTraits<double>::highest(). This returns +inf on device, due to third_party/eigen3/Eigen/src/Core/util/Meta.h, and __DBL_MAX__ (1.7976931348623157e+308) on host, making the behavior for doubles (on device) inconsistent with both the behavior of floats Eigen::NumTraits<float>::highest() and the behavior of std::numeric_limits<double>::max()

PiperOrigin-RevId: 189731521

6 years agoDon't spin in a loop when we're not waiting on any GPU events.
Justin Lebar [Tue, 20 Mar 2018 10:48:38 +0000 (03:48 -0700)]
Don't spin in a loop when we're not waiting on any GPU events.

PiperOrigin-RevId: 189719711

6 years ago- Added support for data to be specified in RNN classes as large tensors with time...
A. Unique TensorFlower [Tue, 20 Mar 2018 10:11:32 +0000 (03:11 -0700)]
- Added support for data to be specified in RNN classes as large tensors with time folded into the batch dimension instead of lists of tensors
- Significant refactoring of RNN classes
- Fixed a bunch of issues in the LayerCollection docstrings, especially around the 'reuse' argument.

PiperOrigin-RevId: 189716331

6 years agoFix bug
A. Unique TensorFlower [Tue, 20 Mar 2018 09:26:31 +0000 (02:26 -0700)]
Fix bug

PiperOrigin-RevId: 189712233

6 years agoFix some edge cases around scalar indices in the gather expander
Sanjoy Das [Tue, 20 Mar 2018 06:15:42 +0000 (23:15 -0700)]
Fix some edge cases around scalar indices in the gather expander

I discovered these when changing the tf2xla bridge to directly emit gather
operations.

 - DeScalarizeGatherIndices was assuming that gather_indices must be of at least
   rank 1.  Fix this to be more general.

 - We were passing in the wrong version of gather indices to
   ExpandFirstDimIntoNDims.  We don't strictly need to pass in
   transposed_gather_indices (since if transposed_gather_indices is rank 1 then
   the transpose has to be an identity transpose), passing in
   descalarized_gather_indices would also have been fine, but
   transposed_gather_indices seems more uniform.

 - ExpandGatherDimsInAccumulator was assuming that gather_indices must be of at
   least rank 1 (by calling CollapseFirstNDims).  Fix this to be more general.

 - We were trying to go through with emitting zero sized gather operations.  I
   don't think it is worth dealing with all of the edge cases this would expose
   so now we just punt to ZeroSizedHloElimination.

PiperOrigin-RevId: 189696444

6 years agoPredictions have to be updated for exported output signatures
A. Unique TensorFlower [Tue, 20 Mar 2018 05:56:01 +0000 (22:56 -0700)]
Predictions have to be updated for exported output signatures

PiperOrigin-RevId: 189694707

6 years agoAdded infeed support for experimental C APIs associated with TPU graph rewrite.
Mingsheng Hong [Tue, 20 Mar 2018 05:29:33 +0000 (22:29 -0700)]
Added infeed support for experimental C APIs associated with TPU graph rewrite.

This initial design of the C API is different from (and mostly higher level
than) the python API counterparts for infeed, in that the python API has
explicit graph construction APIs for generating infeed enqueue/dequeue
ops (e.g. split_inputs_and_generate_enqueue_ops() and generate_dequeue_op()),
while the C API takes an input graph and redirects all input nodes to feed the
infeed enqueue.

One requirement/restriction is that the input nodes in the TF
graph (e.g. Placeholder) must specify their tensor shapes, for infeed enqueue
and dequeue nodes to properly compile with XLA. The API for more general shape
support will be designed and implemented later.

PiperOrigin-RevId: 189693028

6 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Tue, 20 Mar 2018 04:45:45 +0000 (21:45 -0700)]
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 189690096

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Tue, 20 Mar 2018 04:18:06 +0000 (21:18 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 189688675

6 years agoAdd `ostream<<` to `tensorflow::TensorShapeBase`.
A. Unique TensorFlower [Tue, 20 Mar 2018 03:55:51 +0000 (20:55 -0700)]
Add `ostream<<` to `tensorflow::TensorShapeBase`.

Reason: Allow `LOG(ERROR) << shape` (currently disallowed).
PiperOrigin-RevId: 189687162

6 years agoQuantize bypasses after activations.
Suharsh Sivakumar [Tue, 20 Mar 2018 03:42:00 +0000 (20:42 -0700)]
Quantize bypasses after activations.

PiperOrigin-RevId: 189686219

6 years agoAlways imports the contrib summary ops when importing tensorflow.
Alexandre Passos [Tue, 20 Mar 2018 03:21:45 +0000 (20:21 -0700)]
Always imports the contrib summary ops when importing tensorflow.

Fixes #17802

PiperOrigin-RevId: 189684619

6 years agoAdds final partial batch support for TPUEstimator.predict.
Jianwei Xie [Tue, 20 Mar 2018 03:06:26 +0000 (20:06 -0700)]
Adds final partial batch support for TPUEstimator.predict.

PiperOrigin-RevId: 189683528

6 years agoApply output_min/output_max to the result in the NEON implementation of Add operator.
A. Unique TensorFlower [Tue, 20 Mar 2018 02:58:03 +0000 (19:58 -0700)]
Apply output_min/output_max to the result in the NEON implementation of Add operator.

Both non-NEON and reference implementation have this, but it's missing from NEON version.

PiperOrigin-RevId: 189682984

6 years agoHandle non-broadcastables shapes in eager assert_equal
Igor Ganichev [Tue, 20 Mar 2018 02:52:06 +0000 (19:52 -0700)]
Handle non-broadcastables shapes in eager assert_equal

Before this change assert_equal would fail when producing an error
message for non-equal shapes because array_ops.boolean_mask only
works for equal shapes.

This part of the error message is fairly confusing in presence
of non-equal shapes. This change removes it.

PiperOrigin-RevId: 189682518

6 years agoAvoid attaching fqn annotations to live values that don't have a `__name__`.
A. Unique TensorFlower [Tue, 20 Mar 2018 02:30:23 +0000 (19:30 -0700)]
Avoid attaching fqn annotations to live values that don't have a `__name__`.

PiperOrigin-RevId: 189680937

6 years agoDisable freeze_bn_delay by default.
Suharsh Sivakumar [Tue, 20 Mar 2018 02:24:26 +0000 (19:24 -0700)]
Disable freeze_bn_delay by default.

PiperOrigin-RevId: 189680481

6 years agoUpdate GraphProperties comments
A. Unique TensorFlower [Tue, 20 Mar 2018 02:24:24 +0000 (19:24 -0700)]
Update GraphProperties comments

PiperOrigin-RevId: 189680477

6 years agoMake L2 norm computation more stable.
Surya Bhupatiraju [Tue, 20 Mar 2018 01:51:06 +0000 (18:51 -0700)]
Make L2 norm computation more stable.

Avoids the potentially numerically instable square root in the linalg_ops.norm() function because we 'undo' that operation with a math_ops.square() operation anyway.

PiperOrigin-RevId: 189677716

6 years agoExport tf.GradientTape
Asim Shankar [Tue, 20 Mar 2018 01:32:13 +0000 (18:32 -0700)]
Export tf.GradientTape

tf.GradientTape can be used both for eager execution and graph construction
to compute gradients (unlike tf.gradients, which works only for graph
construction).

PiperOrigin-RevId: 189676004

6 years agoSupport general permutation.
A. Unique TensorFlower [Tue, 20 Mar 2018 01:20:12 +0000 (18:20 -0700)]
Support general permutation.

PiperOrigin-RevId: 189675019

6 years agoAdd docstring pointing to tf.contrib.quantize.
Suharsh Sivakumar [Tue, 20 Mar 2018 00:56:02 +0000 (17:56 -0700)]
Add docstring pointing to tf.contrib.quantize.

PiperOrigin-RevId: 189672549

6 years agoRegister gradient for argmin (cf. #15278).
Martin Wicke [Tue, 20 Mar 2018 00:50:05 +0000 (17:50 -0700)]
Register gradient for argmin (cf. #15278).

PiperOrigin-RevId: 189671974