platform/upstream/tensorflow.git
7 years agoInitialize context handle before enable_run_metadata.
A. Unique TensorFlower [Fri, 12 Jan 2018 19:36:49 +0000 (11:36 -0800)]
Initialize context handle before enable_run_metadata.

PiperOrigin-RevId: 181770918

7 years agoUpdating the docker login command. The email flag is deprecated.
Amit Patankar [Fri, 12 Jan 2018 19:29:11 +0000 (11:29 -0800)]
Updating the docker login command. The email flag is deprecated.

PiperOrigin-RevId: 181769938

7 years agoAdds some logging around model creation.
A. Unique TensorFlower [Fri, 12 Jan 2018 19:23:04 +0000 (11:23 -0800)]
Adds some logging around model creation.

When debugging slow startups, it is useful to be able to determine the following, and I which I was not able to get from the current logging:
  - When, and how long, model construction happens with Estimator
  - When, and how long, the init op takes

PiperOrigin-RevId: 181768945

7 years agoSmall bug fix visualize.
Andrew Selle [Fri, 12 Jan 2018 18:58:07 +0000 (10:58 -0800)]
Small bug fix visualize.

PiperOrigin-RevId: 181765083

7 years ago[tf.data] Update docstrings to point to `tf.data.Dataset.apply()`.
Derek Murray [Fri, 12 Jan 2018 18:31:12 +0000 (10:31 -0800)]
[tf.data] Update docstrings to point to `tf.data.Dataset.apply()`.

PiperOrigin-RevId: 181761270

7 years agoAdd python script that can visualize models by producing an HTML page.
Andrew Selle [Fri, 12 Jan 2018 17:57:25 +0000 (09:57 -0800)]
Add python script that can visualize models by producing an HTML page.

PiperOrigin-RevId: 181756421

7 years agoEnable passing CSE consider_fn through GraphOptimizer::Optimize call.
Jacques Pienaar [Fri, 12 Jan 2018 17:56:28 +0000 (09:56 -0800)]
Enable passing CSE consider_fn through GraphOptimizer::Optimize call.

PiperOrigin-RevId: 181756325

7 years agoMade Dataset as a main reference for input_fn preparation.
Mustafa Ispir [Fri, 12 Jan 2018 17:52:01 +0000 (09:52 -0800)]
Made Dataset as a main reference for input_fn preparation.

PiperOrigin-RevId: 181755864

7 years ago[TFXLA] Don't rely on CSE to dedup args.
Jacques Pienaar [Fri, 12 Jan 2018 17:18:33 +0000 (09:18 -0800)]
[TFXLA] Don't rely on CSE to dedup args.

Handle the case where a value is fed in via multiple switch nodes without relying on CSE to dedup the nodes as we'd only want/need to feed in the same value once per function.

PiperOrigin-RevId: 181752351

7 years agoFormatting fixes
Mark Daoust [Fri, 12 Jan 2018 16:44:43 +0000 (08:44 -0800)]
Formatting fixes

PiperOrigin-RevId: 181748699

7 years agoUpdate Eigen to 14e1418fcf12985861f17131e6de94adb4c7b630.
RJ Ryan [Fri, 12 Jan 2018 16:38:39 +0000 (08:38 -0800)]
Update Eigen to 14e1418fcf12985861f17131e6de94adb4c7b630.

Fixes Eigen TensorFFT precision issues due to twiddle factor calculation via recurrence:
https://bitbucket.org/eigen/eigen/commits/6c74460b39d4c3e2e570dbe9e82497cac3800e57

PiperOrigin-RevId: 181748118

7 years agoGenerate more numerically stable random inputs.
Blake Hechtman [Fri, 12 Jan 2018 16:24:05 +0000 (08:24 -0800)]
Generate more numerically stable random inputs.

PiperOrigin-RevId: 181746741

7 years agoMoves CUDA-only condition of NCCL further up to dependent targets.
A. Unique TensorFlower [Fri, 12 Jan 2018 14:15:05 +0000 (06:15 -0800)]
Moves CUDA-only condition of NCCL further up to dependent targets.
Removes NCCL kernel registration in non-CUDA builds (but retains NCCL ops).
Removes unused python/ops/_nccl_ops.so target.

PiperOrigin-RevId: 181736230

7 years agoAdjust feature name in `features` field of generic tree proto for Sparse Float Features
A. Unique TensorFlower [Fri, 12 Jan 2018 08:24:57 +0000 (00:24 -0800)]
Adjust feature name in `features` field of generic tree proto for Sparse Float Features

PiperOrigin-RevId: 181712201

7 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Fri, 12 Jan 2018 04:17:58 +0000 (20:17 -0800)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 181698744

7 years agoAvoid creating swap nodes multiple times if the memory optimizer is run more
Benoit Steiner [Fri, 12 Jan 2018 03:24:20 +0000 (19:24 -0800)]
Avoid creating swap nodes multiple times if the memory optimizer is run more
than once.

PiperOrigin-RevId: 181695508

7 years agoImprove performance of several utility functions in TensorFlow
A. Unique TensorFlower [Fri, 12 Jan 2018 03:23:24 +0000 (19:23 -0800)]
Improve performance of several utility functions in TensorFlow

framework/types.h defines a variety of functions on DataType enums. Some of these functions are implemented by allocating arrays in the heap.  Even though DataTypeVector is a typedef for InlinedVector, it only stores 4 elements inline. Many of the vectors used in types.h/types.cc contain more than 4 elements.

To make matters worse, some of these functions are called quite frequently under load, so we're wasting time allocating and copying arrays.

The set of distinct DataType values is so small, however, that we can represent a set of DataType values as a bitmask, and use bit-shifts and tests instead of sequential scans of arrays.

Even the functions that do not allocate, such as DataTypeCanUseMemcpy(), are needlessly inefficient (read: they use control-flow and indirect jumps when a simple table-based load would do; they are also not inlined).  These costs were significant enough that they consumed about 1.2% of CPU cycles under heavy load.

The surprising cost of DataTypeCanUseMemcpy() inspired this change. I went ahead and made the change fully general, by adding a DataTypeSet type and changing all of the utility functions in framework/types.h to use it (with the exception of DataTypeAlwaysOnHost because it uses a _REF type), for the sake of generality and performance.

PiperOrigin-RevId: 181695458

7 years agoCreate loader and vacuum tools for TensorBoard DB
Justine Tunney [Fri, 12 Jan 2018 03:19:21 +0000 (19:19 -0800)]
Create loader and vacuum tools for TensorBoard DB

PiperOrigin-RevId: 181695156

7 years agoReduce memory allocations in GCS client
A. Unique TensorFlower [Fri, 12 Jan 2018 02:49:07 +0000 (18:49 -0800)]
Reduce memory allocations in GCS client

This removes some unnecessary transient allocations from the GCS client code, by passing pointers to data directly to the JSON parsing library, rather than copying all of the JSON data to a temporary 'string' object.

Also converted some unnecessarily-general comparisons against Json::Value::null to calls to Value::isNull().

Also changes several parameters from "const string&" to "const char*", in order to avoid unnecessary intermediate allocations.  Json::Value::get() has an overload which takes "const char*".  Ideally, the JSON library would use string_view or StringPiece, but that's an open source project and so modifying that dependency is out of scope for this change.

PiperOrigin-RevId: 181693172

7 years agoDon't optimize AddN nodes with 2 or fewer inputs
Benoit Steiner [Fri, 12 Jan 2018 02:46:33 +0000 (18:46 -0800)]
Don't optimize AddN nodes with 2 or fewer inputs

PiperOrigin-RevId: 181692968

7 years agoK-FAC: Utility function for scheduling N ops per global_step.
A. Unique TensorFlower [Fri, 12 Jan 2018 02:10:14 +0000 (18:10 -0800)]
K-FAC: Utility function for scheduling N ops per global_step.

PiperOrigin-RevId: 181689879

7 years agoImplement legacy tensor->summary methods on DB writer
Justine Tunney [Fri, 12 Jan 2018 02:03:56 +0000 (18:03 -0800)]
Implement legacy tensor->summary methods on DB writer

In the future these methods should be removed in favor of the Python
graph-based implementations in tensorboard.summary. But the methods
should be supported until they're deleted.

PiperOrigin-RevId: 181689100

7 years agoAdd support for if conditionals. Fix a bug in the activity analysis.
A. Unique TensorFlower [Fri, 12 Jan 2018 01:35:20 +0000 (17:35 -0800)]
Add support for if conditionals. Fix a bug in the activity analysis.

PiperOrigin-RevId: 181686453

7 years agoMove SummaryFileWriter alongside SummaryDbWriter
Justine Tunney [Fri, 12 Jan 2018 01:14:28 +0000 (17:14 -0800)]
Move SummaryFileWriter alongside SummaryDbWriter

These impls are two peas in the same pod. This will make it easier to
write a follow-up change that refactors out common code.

PiperOrigin-RevId: 181684341

7 years ago[XLA:GPU] Add an @llvm.assume(linear_index < threads_per_block * num_blocks).
Justin Lebar [Fri, 12 Jan 2018 00:32:18 +0000 (16:32 -0800)]
[XLA:GPU] Add an @llvm.assume(linear_index < threads_per_block * num_blocks).

PiperOrigin-RevId: 181679271

7 years agoAdd missing AndroidManifest to TensorFlow Lite Java android library target.
A. Unique TensorFlower [Fri, 12 Jan 2018 00:31:02 +0000 (16:31 -0800)]
Add missing AndroidManifest to TensorFlow Lite Java android library target.

This is a fix to the below issue:
#15956

PiperOrigin-RevId: 181679121

7 years agoSwitch `tf.parse_single_example()` to use the fused implementation in most cases.
Derek Murray [Fri, 12 Jan 2018 00:11:19 +0000 (16:11 -0800)]
Switch `tf.parse_single_example()` to use the fused implementation in most cases.

Remove the unused `tf.contrib.data.parse_single_example()` function, which was
a temporary bridge to the fused implementation.

Note that the fused implementation is only used if the (seldom used) `example_names` argument is None. Otherwise, it falls back to the existing unfused implementation.

PiperOrigin-RevId: 181676746

7 years agoAdd reservoir sampling to DB summary writer
Justine Tunney [Fri, 12 Jan 2018 00:08:50 +0000 (16:08 -0800)]
Add reservoir sampling to DB summary writer

This thing is kind of cool. It's able to turn a 350mB event log into a
35mB SQLite file at 80mBps with one Macbook core. Best of all, this was
accomplished using a normalized schema without the embedded protos.

PiperOrigin-RevId: 181676380

7 years agoDon't log to ERROR if an unsupported type is encountered in neutral/absorbing element...
A. Unique TensorFlower [Thu, 11 Jan 2018 23:50:40 +0000 (15:50 -0800)]
Don't log to ERROR if an unsupported type is encountered in neutral/absorbing element optimizer. This is not an error, at worst a missed optimization oppportunity. See #15521.

PiperOrigin-RevId: 181673939

7 years agoThis change is to add more control over when multiprocessing is used.
A. Unique TensorFlower [Thu, 11 Jan 2018 23:46:24 +0000 (15:46 -0800)]
This change is to add more control over when multiprocessing is used.

PiperOrigin-RevId: 181673354

7 years agoK-FAC: Add (cov|inv)_update_(ops|thunks) to FisherEstimator.
A. Unique TensorFlower [Thu, 11 Jan 2018 23:39:45 +0000 (15:39 -0800)]
K-FAC: Add (cov|inv)_update_(ops|thunks) to FisherEstimator.

PiperOrigin-RevId: 181672525

7 years agoSundry small changes to enable the C API in more tests.
Skye Wanderman-Milne [Thu, 11 Jan 2018 23:09:54 +0000 (15:09 -0800)]
Sundry small changes to enable the C API in more tests.

PiperOrigin-RevId: 181668268

7 years agoOpen-source TPU Embedding Op definitions.
A. Unique TensorFlower [Thu, 11 Jan 2018 22:59:23 +0000 (14:59 -0800)]
Open-source TPU Embedding Op definitions.

PiperOrigin-RevId: 181667044

7 years agoFixes flaky step counting test in dnn_linear_combined_test
A. Unique TensorFlower [Thu, 11 Jan 2018 22:58:20 +0000 (14:58 -0800)]
Fixes flaky step counting test in dnn_linear_combined_test

PiperOrigin-RevId: 181666917

7 years ago* Added code to delegate LSTM operation to NN API. Off by default.
A. Unique TensorFlower [Thu, 11 Jan 2018 22:57:26 +0000 (14:57 -0800)]
* Added code to delegate LSTM operation to NN API. Off by default.
* Added code to turn on NN API delegation for speaker id test. Off by default.

PiperOrigin-RevId: 181666821

7 years agoMake Exporters export stripped SavedModels. This improves the forward compatibility...
Martin Wicke [Thu, 11 Jan 2018 22:39:53 +0000 (14:39 -0800)]
Make Exporters export stripped SavedModels. This improves the forward compatibility of the SavedModel. While the underlying infrastructure still can export non-stripped versions, this is not recommended, and the flag to turn off stripping is not exposed (although it is easy to access by subclassing or using _SavedModelExporter directly).

PiperOrigin-RevId: 181664387

7 years ago[tf.data] Change the IteratorBase::RestoreInternal() method to take IteratorContext*.
Derek Murray [Thu, 11 Jan 2018 22:29:20 +0000 (14:29 -0800)]
[tf.data] Change the IteratorBase::RestoreInternal() method to take IteratorContext*.

The IteratorContext type contains all of the state needed to restore
an iterator and it is easier to construct, so this change will make it
possible to control the environment of the restoration more easily
(e.g. when using function overlays on a shared runtime).

PiperOrigin-RevId: 181662977

7 years agoAdds Mean op to Tensorflow Lite.
A. Unique TensorFlower [Thu, 11 Jan 2018 22:01:15 +0000 (14:01 -0800)]
Adds Mean op to Tensorflow Lite.

PiperOrigin-RevId: 181658399

7 years ago[XLA:GPU] Get rid of unnecessary urem in IrArray with linear index.
Justin Lebar [Thu, 11 Jan 2018 21:53:02 +0000 (13:53 -0800)]
[XLA:GPU] Get rid of unnecessary urem in IrArray with linear index.

PiperOrigin-RevId: 181657090

7 years agoMake best model export strategy preemption-safe.
A. Unique TensorFlower [Thu, 11 Jan 2018 21:36:33 +0000 (13:36 -0800)]
Make best model export strategy preemption-safe.

PiperOrigin-RevId: 181654743

7 years agoFixes a tiny typo in the usage message.
A. Unique TensorFlower [Thu, 11 Jan 2018 21:06:47 +0000 (13:06 -0800)]
Fixes a tiny typo in the usage message.

PiperOrigin-RevId: 181650869

7 years agoSet SQLite page_size to 4096 by default
Justine Tunney [Thu, 11 Jan 2018 20:53:31 +0000 (12:53 -0800)]
Set SQLite page_size to 4096 by default

This ensures we don't get accidentally locked into a 1024 byte page_size when
linked against older versions of SQLite.

See https://www.sqlite.org/pgszchng2016.html

PiperOrigin-RevId: 181649143

7 years agoAdd option to specify output alignment for BundleWriter.
A. Unique TensorFlower [Thu, 11 Jan 2018 20:42:35 +0000 (12:42 -0800)]
Add option to specify output alignment for BundleWriter.

PiperOrigin-RevId: 181647536

7 years agobackward compat: Prevent changes to attr's default value only for last historical...
A. Unique TensorFlower [Thu, 11 Jan 2018 20:35:25 +0000 (12:35 -0800)]
backward compat: Prevent changes to attr's default value only for last historical version.

PiperOrigin-RevId: 181646665

7 years agoImplemented heuristic to decrease memory utilization of AddN nodes
Benoit Steiner [Thu, 11 Jan 2018 20:19:19 +0000 (12:19 -0800)]
Implemented heuristic to decrease memory utilization of AddN nodes

PiperOrigin-RevId: 181644649

7 years agoAdd speech endpointer model test for TF-lite.
A. Unique TensorFlower [Thu, 11 Jan 2018 20:15:24 +0000 (12:15 -0800)]
Add speech endpointer model test for TF-lite.

PiperOrigin-RevId: 181644178

7 years agoAdd missing tf.contrib.receptive_field dependencies.
A. Unique TensorFlower [Thu, 11 Jan 2018 20:12:06 +0000 (12:12 -0800)]
Add missing tf.contrib.receptive_field dependencies.

PiperOrigin-RevId: 181643790

7 years agoIncrease number of inlined elements in EdgeSet from 2 to 4 to speed up graph construc...
A. Unique TensorFlower [Thu, 11 Jan 2018 20:10:56 +0000 (12:10 -0800)]
Increase number of inlined elements in EdgeSet from 2 to 4 to speed up graph construction and reduce startup time in TensorFlow.

In the motivating case, this change decreases the time for a RegisterGraph RPC with a large graph from 10 minutes to 40s. Without this change, a large portion of the time is spent walking the red-black tree.

PiperOrigin-RevId: 181643594

7 years agoEnable stacktrace printing ont test failures for python tests.
Gunhan Gulsoy [Thu, 11 Jan 2018 20:03:29 +0000 (12:03 -0800)]
Enable stacktrace printing ont test failures for python tests.

PiperOrigin-RevId: 181642475

7 years agoRemove debugging print statement from tf.image.random_flip_left_right.
Chris Ying [Thu, 11 Jan 2018 19:57:23 +0000 (11:57 -0800)]
Remove debugging print statement from tf.image.random_flip_left_right.

PiperOrigin-RevId: 181641673

7 years ago[XLA:GPU] Add reduction-to-scalar code.
Justin Lebar [Thu, 11 Jan 2018 19:46:15 +0000 (11:46 -0800)]
[XLA:GPU] Add reduction-to-scalar code.

Adds special code for reducing a tensor of arbitrary rank to a scalar.

This is similar to the column reduction code that we used to run, but it
has a shfl loop at the end like the row reduction code.  The result is
much faster for the reduction-to-scalar case.  (A shfl loop doesn't make
sense for the column reduction case.)

PiperOrigin-RevId: 181640117

7 years agoChange ios_tensorflow_lib to depend on ios_tensorflow_lib_lite.
A. Unique TensorFlower [Thu, 11 Jan 2018 19:24:57 +0000 (11:24 -0800)]
Change ios_tensorflow_lib to depend on ios_tensorflow_lib_lite.

PiperOrigin-RevId: 181636626

7 years agoComments for the functors in concat_lib
Alexandre Passos [Thu, 11 Jan 2018 19:20:21 +0000 (11:20 -0800)]
Comments for the functors in concat_lib

PiperOrigin-RevId: 181635835

7 years agoAdd support for for loops.
A. Unique TensorFlower [Thu, 11 Jan 2018 19:09:48 +0000 (11:09 -0800)]
Add support for for loops.
Generalize the static analysis across while and for loops.
Convert len builtin to tf.shape()[0].
Add for loop canonicalization and companion tests.
Modify the template behavior for Name nodes to let the template control the target, which allows simplifying the caller.

PiperOrigin-RevId: 181633983

7 years ago[tf.data] Improve documentation for `Dataset.batch()` wrt. small final batches.
Derek Murray [Thu, 11 Jan 2018 18:47:14 +0000 (10:47 -0800)]
[tf.data] Improve documentation for `Dataset.batch()` wrt. small final batches.

This partially addresses the concerns in issue #13161.

PiperOrigin-RevId: 181629980

7 years agoAdds loss_reduction argument in head.
A. Unique TensorFlower [Thu, 11 Jan 2018 18:45:51 +0000 (10:45 -0800)]
Adds loss_reduction argument in head.

PiperOrigin-RevId: 181629745

7 years agoEnable identity reshape and common factor hoisting optimizations.
A. Unique TensorFlower [Thu, 11 Jan 2018 18:20:51 +0000 (10:20 -0800)]
Enable identity reshape and common factor hoisting optimizations.

PiperOrigin-RevId: 181625889

7 years ago[XLA] Make HLO CSE faster.
A. Unique TensorFlower [Thu, 11 Jan 2018 18:15:57 +0000 (10:15 -0800)]
[XLA] Make HLO CSE faster.

Passing around copies of std::functions incurs heap allocations and deallocations, which, unfortunately, matters in this case. Minimize the amount of copies.

PiperOrigin-RevId: 181625079

7 years agoChanging the default value of the momentum constant to 0.9.
A. Unique TensorFlower [Thu, 11 Jan 2018 18:14:43 +0000 (10:14 -0800)]
Changing the default value of the momentum constant to 0.9.
Changing the default value of colocate_gradients_with_ops to True.

PiperOrigin-RevId: 181624864

7 years agoAppropriately handle building of CudnnRNN if variable scope has tf.AUTO_REUSE type.
Adam Roberts [Thu, 11 Jan 2018 17:43:22 +0000 (09:43 -0800)]
Appropriately handle building of CudnnRNN if variable scope has tf.AUTO_REUSE type.

PiperOrigin-RevId: 181620379

7 years agoReduce WARNING to INFO on reloading table.
A. Unique TensorFlower [Thu, 11 Jan 2018 17:32:02 +0000 (09:32 -0800)]
Reduce WARNING to INFO on reloading table.

PiperOrigin-RevId: 181619109

7 years ago[XLA:GPU] Specify an explicit alignment on args to kernels.
Justin Lebar [Thu, 11 Jan 2018 17:30:49 +0000 (09:30 -0800)]
[XLA:GPU] Specify an explicit alignment on args to kernels.

This allows LLVM to vectorize loads/stores in these kernels, among other
things.

PiperOrigin-RevId: 181618991

7 years agoSet the type of the placeholder nodes creating when importing a function
Benoit Steiner [Thu, 11 Jan 2018 17:17:01 +0000 (09:17 -0800)]
Set the type of the placeholder nodes creating when importing a function
definition

PiperOrigin-RevId: 181617501

7 years agoSwitch GradientsDebugger to use C API-friendly Python APIs
Skye Wanderman-Milne [Thu, 11 Jan 2018 16:15:07 +0000 (08:15 -0800)]
Switch GradientsDebugger to use C API-friendly Python APIs

PiperOrigin-RevId: 181610422

7 years agoAllow backends to specify a custom ShapeVerifier to HloVerifier.
Brian Patton [Thu, 11 Jan 2018 14:36:19 +0000 (06:36 -0800)]
Allow backends to specify a custom ShapeVerifier to HloVerifier.

Remove obsolete shape_size_fn_ from HloVerifier/ShapeVerifier.

Adds a rank check to FFT shape inference.

PiperOrigin-RevId: 181601294

7 years ago[TF/XLA] Add stricter checks of buffer sizes within colocated buffer sets.
Todd Wang [Thu, 11 Jan 2018 07:06:32 +0000 (23:06 -0800)]
[TF/XLA] Add stricter checks of buffer sizes within colocated buffer sets.

Note that there are already existing checks in BufferAllocation::AddAssignment
to ensure all buffers are no larger than the allocation. But colocated buffer
sets are used to handle forced aliasing, e.g. kWhile, kCall and kConditional,
which require all buffers to be identically sized.

PiperOrigin-RevId: 181565074

7 years agoFix a deadlock condition when session are run in multiple thread and depend on
A. Unique TensorFlower [Thu, 11 Jan 2018 06:45:17 +0000 (22:45 -0800)]
Fix a deadlock condition when session are run in multiple thread and depend on
each other.

PiperOrigin-RevId: 181563474

7 years agoAutomated g4 rollback of changelist 181548597
A. Unique TensorFlower [Thu, 11 Jan 2018 03:55:40 +0000 (19:55 -0800)]
Automated g4 rollback of changelist 181548597

PiperOrigin-RevId: 181553949

7 years agoAdded the "Getting Started with TensorFlow for ML Beginners" chapter to Get
A. Unique TensorFlower [Thu, 11 Jan 2018 02:32:40 +0000 (18:32 -0800)]
Added the "Getting Started with TensorFlow for ML Beginners" chapter to Get
Started home page.

PiperOrigin-RevId: 181548668

7 years agoAutomated g4 rollback of changelist 181260801
A. Unique TensorFlower [Thu, 11 Jan 2018 02:31:50 +0000 (18:31 -0800)]
Automated g4 rollback of changelist 181260801

PiperOrigin-RevId: 181548597

7 years agoThrows exceptions in Java API of TF Lite if it fails to create interpreters.
A. Unique TensorFlower [Thu, 11 Jan 2018 02:24:44 +0000 (18:24 -0800)]
Throws exceptions in Java API of TF Lite if it fails to create interpreters.

PiperOrigin-RevId: 181548023

7 years ago[XLA] More SWIG error propagation and transfers from outfeed.
Chris Leary [Thu, 11 Jan 2018 02:15:55 +0000 (18:15 -0800)]
[XLA] More SWIG error propagation and transfers from outfeed.

PiperOrigin-RevId: 181547286

7 years agoFix for graph execution of gradients_function
Allen Lavoie [Thu, 11 Jan 2018 02:05:09 +0000 (18:05 -0800)]
Fix for graph execution of gradients_function

Shapes were not correctly converted to C types.

PiperOrigin-RevId: 181546120

7 years agoFetch OpDef if necessary in Operation.__init__
Skye Wanderman-Milne [Thu, 11 Jan 2018 01:42:37 +0000 (17:42 -0800)]
Fetch OpDef if necessary in Operation.__init__

Also enables the C API in slot_create_test.py, which exercises the new
behavior (previously it would fail because it would create an op with
no OpDef and list inputs).

PiperOrigin-RevId: 181544033

7 years agoAdd Dataset support information to pydoc of Estimator functions.
Mustafa Ispir [Thu, 11 Jan 2018 00:49:06 +0000 (16:49 -0800)]
Add Dataset support information to pydoc of Estimator functions.

PiperOrigin-RevId: 181537854

7 years agoFix a bug in updating NodeMap, where the node name without port number should
Yao Zhang [Thu, 11 Jan 2018 00:13:09 +0000 (16:13 -0800)]
Fix a bug in updating NodeMap, where the node name without port number should
have been used.

PiperOrigin-RevId: 181532901

7 years agoImproved performance of tf.image.rgb_to_grayscale. Roughly 4 times faster on CPU...
A. Unique TensorFlower [Wed, 10 Jan 2018 23:38:44 +0000 (15:38 -0800)]
Improved performance of tf.image.rgb_to_grayscale. Roughly 4 times faster on CPU and 10% faster on GPU.

PiperOrigin-RevId: 181528321

7 years agoMake test_utils_test.py work with C API enabled.
Skye Wanderman-Milne [Wed, 10 Jan 2018 23:35:12 +0000 (15:35 -0800)]
Make test_utils_test.py work with C API enabled.

PiperOrigin-RevId: 181527872

7 years agoAdd --fat_apk_cpu=arm64-v8a for arm64 Android builds
Austin Anderson [Wed, 10 Jan 2018 23:16:01 +0000 (15:16 -0800)]
Add --fat_apk_cpu=arm64-v8a for arm64 Android builds

Bazel silently uses the wrong build settings for --config=android_arm64 (--cpu=arm64-v8a is not enough), and actually still uses armeabi-v7a in at least some cases. --fat_apk_cpu fixes this.

See #15581 for more.

PiperOrigin-RevId: 181525260

7 years agoReverted Raspberry Pi Docker files back to Ubuntu 14.04, instead of 16.04, to fix...
Pete Warden [Wed, 10 Jan 2018 23:13:17 +0000 (15:13 -0800)]
Reverted Raspberry Pi Docker files back to Ubuntu 14.04, instead of 16.04, to fix toolchain installation error

PiperOrigin-RevId: 181524891

7 years agoPropagate static shape info in AttentionWrapperState.clone() if possible.
Rui Zhao [Wed, 10 Jan 2018 23:03:47 +0000 (15:03 -0800)]
Propagate static shape info in AttentionWrapperState.clone() if possible.

Fixes #15737

PiperOrigin-RevId: 181523430

7 years agoDo not optimize out Identity nodes if specified as output.
A. Unique TensorFlower [Wed, 10 Jan 2018 23:02:32 +0000 (15:02 -0800)]
Do not optimize out Identity nodes if specified as output.

PiperOrigin-RevId: 181523204

7 years ago[TF:XLA] Fix infinite loop in HLO data flow analysis.
A. Unique TensorFlower [Wed, 10 Jan 2018 22:52:27 +0000 (14:52 -0800)]
[TF:XLA] Fix infinite loop in HLO data flow analysis.

Merge input values at phi nodes correctly: If a phi operand is the phi itself,
and the other operands are all the same, then the phi node is redundant.

PiperOrigin-RevId: 181521522

7 years agoAdded a utility function to create a grappler item from a function definition
Benoit Steiner [Wed, 10 Jan 2018 22:39:49 +0000 (14:39 -0800)]
Added a utility function to create a grappler item from a function definition

PiperOrigin-RevId: 181519635

7 years ago[XLA] Clean up our handling of ExecutionProfile and add a test case
Sanjoy Das [Wed, 10 Jan 2018 22:28:01 +0000 (14:28 -0800)]
[XLA] Clean up our handling of ExecutionProfile and add a test case

ExecutionProfile::compute_cycle_count never worked for CPU and GPU with Hlo
profiling disabled, as far as I can tell.
PiperOrigin-RevId: 181517824

7 years agoFix bug in the conversion of while loops. The while_loop's initial value needs to...
A. Unique TensorFlower [Wed, 10 Jan 2018 21:50:08 +0000 (13:50 -0800)]
Fix bug in the conversion of while loops. The while_loop's initial value needs to use the scope symbols, not their last assigned value.

PiperOrigin-RevId: 181511978

7 years agoRemove host_spec attr from TPU configuration ops since it isn't used any more.
A. Unique TensorFlower [Wed, 10 Jan 2018 21:49:23 +0000 (13:49 -0800)]
Remove host_spec attr from TPU configuration ops since it isn't used any more.

PiperOrigin-RevId: 181511871

7 years agoFix python/framework/subscribe.py and test to work with C API enabled.
Skye Wanderman-Milne [Wed, 10 Jan 2018 21:44:27 +0000 (13:44 -0800)]
Fix python/framework/subscribe.py and test to work with C API enabled.

PiperOrigin-RevId: 181511142

7 years agoRevert PlaceholderWithDefault logic in constant_folding.cc.
Skye Wanderman-Milne [Wed, 10 Jan 2018 21:40:36 +0000 (13:40 -0800)]
Revert PlaceholderWithDefault logic in constant_folding.cc.

Runtime constant folding after the graph has been rewritten to include any
feeds, so it's safe and desirable to constant fold PlaceholderWithDefaults
at this point.

PiperOrigin-RevId: 181510650

7 years agoAdding a new test case for tf.contrib.receptive_field.
A. Unique TensorFlower [Wed, 10 Jan 2018 21:23:59 +0000 (13:23 -0800)]
Adding a new test case for tf.contrib.receptive_field.

PiperOrigin-RevId: 181508517

7 years agoRemove the gradients function converter now that we can use the tape method.
A. Unique TensorFlower [Wed, 10 Jan 2018 21:09:04 +0000 (13:09 -0800)]
Remove the gradients function converter now that we can use the tape method.

PiperOrigin-RevId: 181506626

7 years agoSupport nesting EagerTemplate objects.
Akshay Agrawal [Wed, 10 Jan 2018 21:08:52 +0000 (13:08 -0800)]
Support nesting EagerTemplate objects.

* Nesting is implemented by sharing a single EagerVariableStore among a top-level EagerTemplate and all children EagerTemplate objects that are nested underneath it. Variables added to an EagerTemplate object are also added to all EagerTemplate objects under which it is nested.
* This change also simplifies the implementation of __call__ for both Template and EagerTemplate.

PiperOrigin-RevId: 181506600

7 years agoAttempt to fix #15951
Brian Patton [Wed, 10 Jan 2018 21:06:33 +0000 (13:06 -0800)]
Attempt to fix #15951

MacOS build fails for missing include of <array>

PiperOrigin-RevId: 181506335

7 years agoFix flaky training tests. Reenable the tests.
A. Unique TensorFlower [Wed, 10 Jan 2018 20:58:02 +0000 (12:58 -0800)]
Fix flaky training tests. Reenable the tests.

PiperOrigin-RevId: 181505090

7 years agoAllow gRPC Workers to use configure the number of threads driving work on both client...
Noah Eisen [Wed, 10 Jan 2018 20:51:47 +0000 (12:51 -0800)]
Allow gRPC Workers to use configure the number of threads driving work on both client and server side. Thread count is hardcoded to 8 for now, should be tuned in the future.

PiperOrigin-RevId: 181504374

7 years agoAdd lite version of ios_tensorflow_lib to exclude operations. This makes it easier...
A. Unique TensorFlower [Wed, 10 Jan 2018 20:46:25 +0000 (12:46 -0800)]
Add lite version of ios_tensorflow_lib to exclude operations. This makes it easier to package custom ops (tfmini) with the core binary on iOS.

PiperOrigin-RevId: 181503662

7 years agoExtend `assertAllClose()` so it supports namedtuples.
A. Unique TensorFlower [Wed, 10 Jan 2018 20:31:08 +0000 (12:31 -0800)]
Extend `assertAllClose()` so it supports namedtuples.
For example, if you have defined a namedtuple called `MyNamedTuple`, and there are two variables `a=MyNamedTuple(...)`, and `b=MyNamedTuple(...)`, you can directly call `assertAllClose(a, b)` if you intend to know if the two namedtuples are close elementwise.

PiperOrigin-RevId: 181501832

7 years ago[XLA] Name conv/dot fusion nodes conv_fusion.42 / dot_fusion.42.
Justin Lebar [Wed, 10 Jan 2018 20:11:13 +0000 (12:11 -0800)]
[XLA] Name conv/dot fusion nodes conv_fusion.42 / dot_fusion.42.

These fusion categories are really just a way of expressing a particular
kind of dot or conv. This makes them easier to differentiate from
"proper" fusion nodes.

We also change the category of these instructions so that in the HLO
profile, e.g. conv-fusion shows up under the convolution category,
rather than under "fusion".

PiperOrigin-RevId: 181499300

7 years agoMerge changes from github.
Frank Chen [Wed, 10 Jan 2018 19:36:52 +0000 (11:36 -0800)]
Merge changes from github.

PiperOrigin-RevId: 181494416

7 years agoAdd BF16 test for reverse.
Yuanzhong Xu [Wed, 10 Jan 2018 19:35:26 +0000 (11:35 -0800)]
Add BF16 test for reverse.

PiperOrigin-RevId: 181494232