platform/upstream/tensorflow.git
6 years agoCollapse adjacent dimensions that have no paddings.
Jingyue Wu [Fri, 9 Mar 2018 06:05:27 +0000 (22:05 -0800)]
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: 188440916

6 years agoRemoving certain attributes from pom-android.xml.
Amit Patankar [Fri, 9 Mar 2018 04:22:09 +0000 (20:22 -0800)]
Removing certain attributes from pom-android.xml.

PiperOrigin-RevId: 188433792

6 years agoAdding AudioSpectrogram and MFCC operator support to tflite
Andrew Harp [Fri, 9 Mar 2018 04:17:40 +0000 (20:17 -0800)]
Adding AudioSpectrogram and MFCC operator support to tflite

PiperOrigin-RevId: 188433328

6 years agoFix typo in error message
Sanjoy Das [Fri, 9 Mar 2018 02:37:35 +0000 (18:37 -0800)]
Fix typo in error message

PiperOrigin-RevId: 188425637

6 years agoTFE: Implement __r*__ operators for `Dimension`.
Akshay Agrawal [Fri, 9 Mar 2018 02:25:29 +0000 (18:25 -0800)]
TFE: Implement __r*__ operators for `Dimension`.

This lets you use Dimension objects in numerical computations; e.g.,
it lets you evaluate expressions like 3 + my_tensor.shape[0] when executing
eagerly.

At time of writing, without this change,

`matplotlib.pyplot.plt(my_tensor, my_other_tensor)`

fails when executing eagerly, but it works with this change.

This change also makes it possible to right-multiply a dimension by a list
(e.g., dimension * [3]); previously, only the left-multiply worked ([3] *
dimension).

PiperOrigin-RevId: 188424557

6 years agoPulling Rendezvous initialization out of TFE_Context constructor.
Alexandre Passos [Fri, 9 Mar 2018 02:12:54 +0000 (18:12 -0800)]
Pulling Rendezvous initialization out of TFE_Context constructor.

PiperOrigin-RevId: 188423386

6 years agoRemove no-longer-needed work-around for resource variables in Optimizer.
A. Unique TensorFlower [Fri, 9 Mar 2018 01:37:51 +0000 (17:37 -0800)]
Remove no-longer-needed work-around for resource variables in Optimizer.

PiperOrigin-RevId: 188419224

6 years agoInternal change
Akshay Modi [Fri, 9 Mar 2018 01:15:03 +0000 (17:15 -0800)]
Internal change

PiperOrigin-RevId: 188416325

6 years agoRestore cholesky_outer_product_test, to contains for CholeskyOuterProduct
A. Unique TensorFlower [Fri, 9 Mar 2018 00:56:26 +0000 (16:56 -0800)]
Restore cholesky_outer_product_test, to contains for CholeskyOuterProduct

PiperOrigin-RevId: 188413575

6 years agoCheck df parameter > 0 for Chi2.
A. Unique TensorFlower [Fri, 9 Mar 2018 00:56:18 +0000 (16:56 -0800)]
Check df parameter > 0 for Chi2.

PiperOrigin-RevId: 188413552

6 years agoFixes a bug where the ProcFLR doesn't lookup existing instantiations in the
Rohan Jain [Fri, 9 Mar 2018 00:45:45 +0000 (16:45 -0800)]
Fixes a bug where the ProcFLR doesn't lookup existing instantiations in the
distributed (ClusterFLR) case. As a result multiple instantiations for the same
function were happening.

PiperOrigin-RevId: 188411978

6 years agoTreat IdentityN nodes with a single input as regular Identity nodes.
Benoit Steiner [Fri, 9 Mar 2018 00:40:24 +0000 (16:40 -0800)]
Treat IdentityN nodes with a single input as regular Identity nodes.

PiperOrigin-RevId: 188411260

6 years ago[tf.data] Fix potential destruction race in IteratorGetNext.
Derek Murray [Fri, 9 Mar 2018 00:39:37 +0000 (16:39 -0800)]
[tf.data] Fix potential destruction race in IteratorGetNext.

PiperOrigin-RevId: 188411125

6 years agoReturn kTfLiteError if calling delegate-specific functions from non-delegate code.
Yu-Cheng Ling [Fri, 9 Mar 2018 00:16:47 +0000 (16:16 -0800)]
Return kTfLiteError if calling delegate-specific functions from non-delegate code.

PiperOrigin-RevId: 188407931

6 years agoFix StridedSlice
A. Unique TensorFlower [Thu, 8 Mar 2018 23:47:07 +0000 (15:47 -0800)]
Fix StridedSlice

PiperOrigin-RevId: 188403234

6 years agoFix typo in comment.
Sanjoy Das [Thu, 8 Mar 2018 23:45:24 +0000 (15:45 -0800)]
Fix typo in comment.

PiperOrigin-RevId: 188403010

6 years ago[XLA]: Enhancement to the while loop simplifier HLO pass.
Bixia Zheng [Thu, 8 Mar 2018 23:10:36 +0000 (15:10 -0800)]
[XLA]: Enhancement to the while loop simplifier HLO pass.

If a while-loop tuple element is initialized as a constant and isn't changed by
the while-body, replace the use of the tuple element in while-condition and
while-body with the constant value. This enables the simplification of
while-loops that have 0/1 iteration and loop bound passed in through the
while-loop tuple.

Add test cases for while-loops with 0/1 iteration and loop bound passed in
through the while-loop tuple.

PiperOrigin-RevId: 188397087

6 years agoFix bug in updating NodeMap when materializing shapes from ShapeN.
A. Unique TensorFlower [Thu, 8 Mar 2018 22:57:22 +0000 (14:57 -0800)]
Fix bug in updating NodeMap when materializing shapes from ShapeN.
Fix a similar bug in MaybeRemoveControlInput.
Improve error message in dependency optimizer, so we can tell if the problem is in dependency optimizer itself or upstream of it.

PiperOrigin-RevId: 188394863

6 years agoAdd SSIM and PSNR functions to tf.image.
A. Unique TensorFlower [Thu, 8 Mar 2018 22:56:02 +0000 (14:56 -0800)]
Add SSIM and PSNR functions to tf.image.

Add the following functions:

- tf.image.psnr()
- tf.image.ssim()
- tf.image.ssim_multiscale()
- tf.image.sobel_edges()
- tf.image.image_gradients()

Add test images in tensorflow/core/lib/ssim/testdata, .../psnr/testdata.

Fulfills request for SSIM, fixes #15370.

PiperOrigin-RevId: 188394631

6 years agoAdd/AddN optimizer/rewriter
A. Unique TensorFlower [Thu, 8 Mar 2018 22:42:12 +0000 (14:42 -0800)]
Add/AddN optimizer/rewriter

Collapse a sub-graph of Add/AddN operations of fully specified
and identical shapes to a single AddN operation.

PiperOrigin-RevId: 188392302

6 years agoAdd document for TPUEstimate.predict, including limitations and example.
Jianwei Xie [Thu, 8 Mar 2018 22:29:45 +0000 (14:29 -0800)]
Add document for TPUEstimate.predict, including limitations and example.

PiperOrigin-RevId: 188390287

6 years agodisabling failing tsan test
Olivia Nordquist [Thu, 8 Mar 2018 22:05:39 +0000 (14:05 -0800)]
disabling failing tsan test

PiperOrigin-RevId: 188385868

6 years agodisbaling timeout in guitar
Olivia Nordquist [Thu, 8 Mar 2018 21:53:19 +0000 (13:53 -0800)]
disbaling timeout in guitar

PiperOrigin-RevId: 188383577

6 years agoAdd basic TensorArray support. This is temporary, and will be replaced with lists...
A. Unique TensorFlower [Thu, 8 Mar 2018 21:49:31 +0000 (13:49 -0800)]
Add basic TensorArray support. This is temporary, and will be replaced with lists (although we can keep the TAs if necessary).

PiperOrigin-RevId: 188382727

6 years ago[TF Lite] Provide a fast path for Interpreter::SetTensorParametersReadOnly.
Eugene Brevdo [Thu, 8 Mar 2018 21:39:54 +0000 (13:39 -0800)]
[TF Lite] Provide a fast path for Interpreter::SetTensorParametersReadOnly.

The fast path kicks in if shape matches tensor.dims and type matches
tensor.type.

In this case, the interpreter is not invalidated and AllocateTensors need not
be called after a call to SetTensorParametersReadOnly.

PiperOrigin-RevId: 188380596

6 years agoMake adaptive SDCA the default.
A. Unique TensorFlower [Thu, 8 Mar 2018 21:36:46 +0000 (13:36 -0800)]
Make adaptive SDCA the default.

PiperOrigin-RevId: 188380039

6 years agodisabling tsan test that is currently failing
Olivia Nordquist [Thu, 8 Mar 2018 21:29:44 +0000 (13:29 -0800)]
disabling tsan test that is currently failing

PiperOrigin-RevId: 188378908

6 years agoAdd support for literals to QN. Fix the AST logic and tests. Add some extra checks.
A. Unique TensorFlower [Thu, 8 Mar 2018 21:06:20 +0000 (13:06 -0800)]
Add support for literals to QN. Fix the AST logic and tests. Add some extra checks.

PiperOrigin-RevId: 188376050

6 years agoMake benchmark_model work.
A. Unique TensorFlower [Thu, 8 Mar 2018 20:32:01 +0000 (12:32 -0800)]
Make benchmark_model work.

PiperOrigin-RevId: 188372156

6 years agoAllow setting control dependencies on TensorArrays. Is this the right way to do it?
A. Unique TensorFlower [Thu, 8 Mar 2018 20:22:56 +0000 (12:22 -0800)]
Allow setting control dependencies on TensorArrays. Is this the right way to do it?

PiperOrigin-RevId: 188370600

6 years agoFix a typo in gcs_smoke_test test script.
A. Unique TensorFlower [Thu, 8 Mar 2018 20:08:23 +0000 (12:08 -0800)]
Fix a typo in gcs_smoke_test test script.

PiperOrigin-RevId: 188367883

6 years agoDecoupling hash and protobuf. This simplifies a little bit the dependency chain as
A. Unique TensorFlower [Thu, 8 Mar 2018 20:01:23 +0000 (12:01 -0800)]
Decoupling hash and protobuf. This simplifies a little bit the dependency chain as
we don't have to link protobuf libraries just to use basic hash functions. The case
for deterministic serialization of protocol buffers if very specific and can be
handled by a new header file.

PiperOrigin-RevId: 188366713

6 years agoExpose a version of model_fn for contrib Estimators. Make the body of get_timestamped...
A. Unique TensorFlower [Thu, 8 Mar 2018 19:57:36 +0000 (11:57 -0800)]
Expose a version of model_fn for contrib Estimators. Make the body of get_timestamped_export_dir an Estimator util.

PiperOrigin-RevId: 188366199

6 years agoTFLite: Delegate Buffer Handle interface (take 2)
Yu-Cheng Ling [Thu, 8 Mar 2018 19:56:29 +0000 (11:56 -0800)]
TFLite: Delegate Buffer Handle interface (take 2)
PiperOrigin-RevId: 188366045

6 years agoAdd some simple HLO creation utilities to auto-infer result shapes
Sanjoy Das [Thu, 8 Mar 2018 19:49:19 +0000 (11:49 -0800)]
Add some simple HLO creation utilities to auto-infer result shapes

I need something like this for my Gather HLO->HLO lowering pass.

PiperOrigin-RevId: 188365102

6 years agoThis strengthens several checks of error codes returned by libcurl. In all of the
A. Unique TensorFlower [Thu, 8 Mar 2018 19:40:19 +0000 (11:40 -0800)]
This strengthens several checks of error codes returned by libcurl.  In all of the
cases that are changed by this CL, a failure indicates a software bug, not a runtime
condition that should be handled and continued beyond.  Continuing to execute only promotes silently-ignored bugs.

I also removed the useless call which attempts to set the HTTP protocol to HTTP/2, because this call always fails.  I opened b/74351157 to track the possible feature of adding support for HTTP/2.

Also simplified the code around constructing the error string when returning actual Status objects, by moving code into a lambda.

PiperOrigin-RevId: 188363531

6 years ago[SE] Initial perftools::gputools::Platform initialization support
A. Unique TensorFlower [Thu, 8 Mar 2018 19:38:46 +0000 (11:38 -0800)]
[SE] Initial perftools::gputools::Platform initialization support

Adds initialization methods to Platform.  Some platforms require initialization.
Those that do not have trivial implementations of these methods.

PiperOrigin-RevId: 188363315

6 years agoUpdating Tensorflow Docs to add reference around measures to ensure forward compatibi...
A. Unique TensorFlower [Thu, 8 Mar 2018 19:12:41 +0000 (11:12 -0800)]
Updating Tensorflow Docs to add reference around measures to ensure forward compatibility around TF op attributes.

PiperOrigin-RevId: 188359164

6 years agoDisable flaky checkpoint_utils_test everywhere
Gunhan Gulsoy [Thu, 8 Mar 2018 18:38:34 +0000 (10:38 -0800)]
Disable flaky checkpoint_utils_test everywhere

PiperOrigin-RevId: 188353354

6 years agoAutomated g4 rollback of changelist 188265500
Sergio Guadarrama [Thu, 8 Mar 2018 17:32:53 +0000 (09:32 -0800)]
Automated g4 rollback of changelist 188265500

PiperOrigin-RevId: 188343238

6 years agoOptimize the destruction of CancellationManager and LocalRendezvousImpl.
Derek Murray [Thu, 8 Mar 2018 17:02:51 +0000 (09:02 -0800)]
Optimize the destruction of CancellationManager and LocalRendezvousImpl.

In the common case of clean termination, we can avoid performing several atomic
operations and allocations.

PiperOrigin-RevId: 188339594

6 years agoFix feature fraction per tree.
A. Unique TensorFlower [Thu, 8 Mar 2018 17:01:41 +0000 (09:01 -0800)]
Fix feature fraction per tree.

PiperOrigin-RevId: 188339438

6 years agoThis creates a new helper, xla_launch_util, that contains the business logic
A. Unique TensorFlower [Thu, 8 Mar 2018 16:26:52 +0000 (08:26 -0800)]
This creates a new helper, xla_launch_util, that contains the business logic
of launching an XLA computation.

Also changes the resource variable container from a std::vector<OptionalTensor>
to a std::map<int, OptionalTensor> in preparation for backends where the
resource variables aren't ordered densely at the end of the argument list.

PiperOrigin-RevId: 188335574

6 years agoAdd init op and target node support to benchmark
A. Unique TensorFlower [Thu, 8 Mar 2018 16:23:31 +0000 (08:23 -0800)]
Add init op and target node support to benchmark

PiperOrigin-RevId: 188335233

6 years agoUpdate the eager user guide to use object-based saving (and Model)
Allen Lavoie [Thu, 8 Mar 2018 16:02:35 +0000 (08:02 -0800)]
Update the eager user guide to use object-based saving (and Model)

PiperOrigin-RevId: 188332858

6 years agoDisable interleave_dataset_ops_test
Gunhan Gulsoy [Thu, 8 Mar 2018 15:07:58 +0000 (07:07 -0800)]
Disable interleave_dataset_ops_test

PiperOrigin-RevId: 188327338

6 years agoEnable test CompatibleUseLinearIndexWithReshape.
A. Unique TensorFlower [Thu, 8 Mar 2018 14:39:52 +0000 (06:39 -0800)]
Enable test CompatibleUseLinearIndexWithReshape.

This requires adding a special case to SourceIndexOfBitcast if the bitcast is a
reshape.

PiperOrigin-RevId: 188324197

6 years agoupdate docker containers used for remote CPU/GPU builds and the corresponding script.
A. Unique TensorFlower [Thu, 8 Mar 2018 14:37:55 +0000 (06:37 -0800)]
update docker containers used for remote CPU/GPU builds and the corresponding script.

PiperOrigin-RevId: 188324090

6 years agoExtract the iterated expression of a for loop into a variable to avoid repeated staging.
A. Unique TensorFlower [Thu, 8 Mar 2018 13:12:20 +0000 (05:12 -0800)]
Extract the iterated expression of a for loop into a variable to avoid repeated staging.

PiperOrigin-RevId: 188316160

6 years ago- FisherEstimator now supports computing products with arbitrary matrix powers of...
A. Unique TensorFlower [Thu, 8 Mar 2018 12:11:24 +0000 (04:11 -0800)]
- FisherEstimator now supports computing products with arbitrary matrix powers of the approximate Fisher
- Added multi-tower support to multi/RNN fully connected layers
- All op creation is now done inside functions that explicitly create ops, thus allowing fine control of their placement. One result of this is that we no longer need any colocation statements (and these have been removed)
- Multi-tower computations are now handled using ParitionedTensor class, which appears to be a single tensor to the FisherFactors but actually contains a list of tensors.
- To achieve the above damping values are passed around as special functions that are packaged along with "ids" that can be used to uniquely identify the computation they perform.  Topohash might provide a better solution for this in the future.
- Variable creation in the factors is now done via special methods so we can have fine control over where these are placed
- FisherEstimator now has special functions to create ops and variables using different placement strategies (currently: no strategy, round-robin, and as thunks).  By default this will use the round-robin strategy and manufacture the usual convenience properties ("inv_update_ops", etc).  This default behavior is to preserve backwards compatibility but in the future we should deprecate this and require the user to ask for an explicit strategy.
- LossFunctions no longer make any ops in their constructors.  The only make ops when evaluated.  LayerCollection maintains a list of tensors/ops which we can colocate LossFunction computations with (typically their inputs)
- LossFunctions no longer support multi-tower/mini-batches directly. Instead LayerCollection maintains a list of these objects, one for each tower.  This solution is better since now the loss function related computations can take place exclusively on the corresponding tower.
- All loss functions now support multiple towers/minibatches (via LayerCollection).
- tf.gradients is passed list of loss function values instead of their sum, which will prevent extraneous gradient ops being placed on arbitrary devices.  Hopefully with this change and the above one for loss functions all ops associated with gradient computations (for computing stats) will occur completely on the device that defines that part of the graph.  e.g. this will do the right thing for multiple towers
- I've also made sure that sensible colocation occurs for the extra ops needed by the curvature_propagation and exact estimation modes.
- Variables and ops made by FisherEstimator are now placed inside of name scopes (based on the name given to FisherEstimator)
- Restored old variable use count tracker implementation, thus fixing the issue with how generic registrations were handled by check_registration().
- Restored interface to FisherEstimator (which was changed in the previous CL).
- Fixed bug in LazyKFacOptimizer: optional/named arguments weren't being passed in properly
- Lots of other minor refactors/improvements

PiperOrigin-RevId: 188310846

6 years agoAutomated g4 rollback of changelist 188263046
Gunhan Gulsoy [Thu, 8 Mar 2018 08:32:17 +0000 (00:32 -0800)]
Automated g4 rollback of changelist 188263046

PiperOrigin-RevId: 188293315

6 years agoMake comparison functors const
A. Unique TensorFlower [Thu, 8 Mar 2018 06:56:41 +0000 (22:56 -0800)]
Make comparison functors const

In libc++ std::map and std::multimap call the comparison functor
from a const object, which requires the `operator()` to be a const
method.

PiperOrigin-RevId: 188285407

6 years agoAdd support for ResourceVariable weights to the quantization rewriter.
Suharsh Sivakumar [Thu, 8 Mar 2018 06:36:15 +0000 (22:36 -0800)]
Add support for ResourceVariable weights to the quantization rewriter.

PiperOrigin-RevId: 188284335

6 years agoDisable the predict input warning in TPUEstimator.
Jianwei Xie [Thu, 8 Mar 2018 03:46:00 +0000 (19:46 -0800)]
Disable the predict input warning in TPUEstimator.

PiperOrigin-RevId: 188273641

6 years agointernal
A. Unique TensorFlower [Thu, 8 Mar 2018 03:39:04 +0000 (19:39 -0800)]
internal

PiperOrigin-RevId: 188273192

6 years agoFix docstring.
A. Unique TensorFlower [Thu, 8 Mar 2018 03:24:20 +0000 (19:24 -0800)]
Fix docstring.

PiperOrigin-RevId: 188272354

6 years ago[XLA]: Rewrite the test cases for while loop simplifier with HLO strings.
Bixia Zheng [Thu, 8 Mar 2018 03:04:18 +0000 (19:04 -0800)]
[XLA]: Rewrite the test cases for while loop simplifier with HLO strings.

PiperOrigin-RevId: 188270727

6 years agoPiperOrigin-RevId: 188267957
A. Unique TensorFlower [Thu, 8 Mar 2018 02:30:38 +0000 (18:30 -0800)]
PiperOrigin-RevId: 188267957

6 years agoRemove StackPush nodes where the corresponding StackPop nodes have no consumers..
A. Unique TensorFlower [Thu, 8 Mar 2018 02:26:56 +0000 (18:26 -0800)]
Remove StackPush nodes where the corresponding StackPop nodes have no consumers..

PiperOrigin-RevId: 188267649

6 years agoTFE: Implement __r*__ operators for `Dimension`.
Akshay Agrawal [Thu, 8 Mar 2018 02:05:53 +0000 (18:05 -0800)]
TFE: Implement __r*__ operators for `Dimension`.

This lets you use Dimension objects in numerical computations; e.g.,
it lets you evaluate expressions like 3 + my_tensor.shape[0] when executing
eagerly.

At time of writing, without this change,

`matplotlib.pyplot.plt(my_tensor, my_other_tensor)`

fails when executing eagerly, but it works with this change.

PiperOrigin-RevId: 188265500

6 years agoAdd support for converting range, and an actual build rule for the builtins_test...
A. Unique TensorFlower [Thu, 8 Mar 2018 01:58:24 +0000 (17:58 -0800)]
Add support for converting range, and an actual build rule for the builtins_test, which somehow got left out.

PiperOrigin-RevId: 188264644

6 years agoRestores accumulate_n's functionality when shapes are unknown.
Alexandre Passos [Thu, 8 Mar 2018 01:52:04 +0000 (17:52 -0800)]
Restores accumulate_n's functionality when shapes are unknown.

PiperOrigin-RevId: 188264080

6 years agoFix OP_REQUIRES to be OP_REQUIRES_ASYNC
A. Unique TensorFlower [Thu, 8 Mar 2018 01:44:57 +0000 (17:44 -0800)]
Fix OP_REQUIRES to be OP_REQUIRES_ASYNC

PiperOrigin-RevId: 188263337

6 years agoTFLite: Delegate Buffer Handle interface
Yu-Cheng Ling [Thu, 8 Mar 2018 01:42:08 +0000 (17:42 -0800)]
TFLite: Delegate Buffer Handle interface
PiperOrigin-RevId: 188263046

6 years agoInternal-only change.
Brennan Saeta [Thu, 8 Mar 2018 01:26:21 +0000 (17:26 -0800)]
Internal-only change.

PiperOrigin-RevId: 188261279

6 years agoHelpful ImportError message
Brennan Saeta [Thu, 8 Mar 2018 01:26:18 +0000 (17:26 -0800)]
Helpful ImportError message

PiperOrigin-RevId: 188261273

6 years agoAdd tracing annotations to RemoteCallOp's execution.
Brennan Saeta [Thu, 8 Mar 2018 01:23:57 +0000 (17:23 -0800)]
Add tracing annotations to RemoteCallOp's execution.

PiperOrigin-RevId: 188260984

6 years agoRemove unneeded rewrite, now that contrib.quantize is ready and better.
Suharsh Sivakumar [Thu, 8 Mar 2018 00:56:34 +0000 (16:56 -0800)]
Remove unneeded rewrite, now that contrib.quantize is ready and better.

PiperOrigin-RevId: 188257466

6 years agoInternal change.
A. Unique TensorFlower [Thu, 8 Mar 2018 00:54:01 +0000 (16:54 -0800)]
Internal change.

PiperOrigin-RevId: 188257136

6 years agoeager: Export tf.enable_eager_execution() and tf.executing_eagerly()
Asim Shankar [Thu, 8 Mar 2018 00:44:11 +0000 (16:44 -0800)]
eager: Export tf.enable_eager_execution() and tf.executing_eagerly()

PiperOrigin-RevId: 188255674

6 years agoCheckpointable: Fix device placement when restoring name-based checkpoints.
Allen Lavoie [Wed, 7 Mar 2018 23:52:25 +0000 (15:52 -0800)]
Checkpointable: Fix device placement when restoring name-based checkpoints.

Just need to put the restore ops on a CPU.

PiperOrigin-RevId: 188248198

6 years agoAdded tf.contrib.data.make_batched_features_dataset as replacement of tf.contrib...
Katherine Wu [Wed, 7 Mar 2018 23:03:32 +0000 (15:03 -0800)]
Added tf.contrib.data.make_batched_features_dataset as replacement of tf.contrib.learn.io.read_batch_features. Added warning about the deprecation of tf.contrib.data.read_batch_features.

PiperOrigin-RevId: 188240046

6 years agoMigrate AIS chain into `tfp.mcmc` and modularize its interface to take a TransitionKe...
Joshua V. Dillon [Wed, 7 Mar 2018 23:00:43 +0000 (15:00 -0800)]
Migrate AIS chain into `tfp.mcmc` and modularize its interface to take a TransitionKernel.

PiperOrigin-RevId: 188239559

6 years agopy_func attaches full stack traces when an error is raised.
Eugene Brevdo [Wed, 7 Mar 2018 22:53:49 +0000 (14:53 -0800)]
py_func attaches full stack traces when an error is raised.

This should help debugging errors that occur inside a py_func.

PiperOrigin-RevId: 188238495

6 years agoRemove unused parameter from GetQuantizationParamsFromMinMax.
A. Unique TensorFlower [Wed, 7 Mar 2018 22:42:36 +0000 (14:42 -0800)]
Remove unused parameter from GetQuantizationParamsFromMinMax.

PiperOrigin-RevId: 188236536

6 years agoFix GCS uploads occasionally failing when retrying.
Jonathan Hseu [Wed, 7 Mar 2018 22:33:07 +0000 (14:33 -0800)]
Fix GCS uploads occasionally failing when retrying.

GCS returns 400, invalid argument because it thinks the body is not empty. cURL, by default, sets "Transfer-Encoding: Chunked", which causes the server to ignore "Content-Length: 0":
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding

The server considers the HTTP request incomplete and may non-deterministically fail.

PiperOrigin-RevId: 188235030

6 years agoDon't populate linear_ with a logical index
Sanjoy Das [Wed, 7 Mar 2018 22:32:28 +0000 (14:32 -0800)]
Don't populate linear_ with a logical index

We use linear_ to directly emit array element access in some cases so populating
it with the logical linear index seems incorrect.

PiperOrigin-RevId: 188234902

6 years agoCreate mobile testing rules for TF Lite known-portable targets
Austin Anderson [Wed, 7 Mar 2018 22:30:00 +0000 (14:30 -0800)]
Create mobile testing rules for TF Lite known-portable targets

This CL tags all known-already-portable TF Lite tests as portable, and
(from those tests) tags those known as not portable.

Adding tflite_portable_test_suite() to the bottom of a package marks all
previous cc_tests as "intended to be portable". I've included all tests
that I was able to naively make buildable on Android with my previous
change that created a custom logging.h library. Most tests are buildable
on Android already, but there is something in the common dependencies
for the kernel tests that is not compatible with iOS.

Outside of Google, this change does nothing except tag tests that are
known to not be buildable on certain platforms.

PiperOrigin-RevId: 188234489

6 years ago[TF:XLA] Bump open source llvm revision to r326829
Sanjoy Das [Wed, 7 Mar 2018 22:02:38 +0000 (14:02 -0800)]
[TF:XLA] Bump open source llvm revision to r326829

PiperOrigin-RevId: 188229669

6 years ago[tf.data] Optimize `Dataset.filter()` when the predicate returns one of its args.
Derek Murray [Wed, 7 Mar 2018 22:02:15 +0000 (14:02 -0800)]
[tf.data] Optimize `Dataset.filter()` when the predicate returns one of its args.

This change avoids the overhead of function dispatch (~10--15us) when
the filter predicate simply returns one of its arguments directly. It
also adds a benchmark to track the performance of this optimization.

The checkpointing code required minor modifications to enable functions to be
instantiated in the `FilterDatasetOp::Compute()` method when an iterator is being
restored.

PiperOrigin-RevId: 188229570

6 years agoUpdate graph rewrites for host compute ops
A. Unique TensorFlower [Wed, 7 Mar 2018 21:56:05 +0000 (13:56 -0800)]
Update graph rewrites for host compute ops

PiperOrigin-RevId: 188228489

6 years ago[tpu.datasets]: Improve the performance of the StreamingFilesDataset.
Brennan Saeta [Wed, 7 Mar 2018 21:52:44 +0000 (13:52 -0800)]
[tpu.datasets]: Improve the performance of the StreamingFilesDataset.

In order to effectively pipeline the transfers, set num_parallel_calls=4.

PiperOrigin-RevId: 188227890

6 years agoFurther small support for quantized unfused LSTMs.
A. Unique TensorFlower [Wed, 7 Mar 2018 21:09:07 +0000 (13:09 -0800)]
Further small support for quantized unfused LSTMs.

PiperOrigin-RevId: 188221169

6 years agoInternal Change
A. Unique TensorFlower [Wed, 7 Mar 2018 20:38:18 +0000 (12:38 -0800)]
Internal Change

PiperOrigin-RevId: 188217110

6 years agoTFE_Context gets its local devices from the source instead of a session.
Alexandre Passos [Wed, 7 Mar 2018 20:30:47 +0000 (12:30 -0800)]
TFE_Context gets its local devices from the source instead of a session.

PiperOrigin-RevId: 188216178

6 years agoAdd support for padding tf.string tensors on CPU.
RJ Ryan [Wed, 7 Mar 2018 20:21:17 +0000 (12:21 -0800)]
Add support for padding tf.string tensors on CPU.

PiperOrigin-RevId: 188215092

6 years agoeager: Rename in_eager_mode to executing_eagerly and get rid of in_graph_mode.
Asim Shankar [Wed, 7 Mar 2018 20:03:56 +0000 (12:03 -0800)]
eager: Rename in_eager_mode to executing_eagerly and get rid of in_graph_mode.

This is in preparation to introduce one public, stable symbol: tf.executing_eagerly()
(i.e., part of moving APIs related to eager execution from "contrib" to a namespace
where we provide API stability guarantees)

PiperOrigin-RevId: 188212646

6 years agoConvert functions with multiple returns to use a single return.
A. Unique TensorFlower [Wed, 7 Mar 2018 20:01:42 +0000 (12:01 -0800)]
Convert functions with multiple returns to use a single return.

PiperOrigin-RevId: 188212324

6 years agoSupport for transpose convolution. Includes striding, and a reference implementation.
A. Unique TensorFlower [Wed, 7 Mar 2018 19:53:21 +0000 (11:53 -0800)]
Support for transpose convolution. Includes striding, and a reference implementation.

PiperOrigin-RevId: 188210975

6 years agoMaking sure that the proc FLR doesn't get deleted before lib_ (in FunctionBufferingRe...
Rohan Jain [Wed, 7 Mar 2018 19:27:12 +0000 (11:27 -0800)]
Making sure that the proc FLR doesn't get deleted before lib_ (in FunctionBufferingResource).

PiperOrigin-RevId: 188206611

6 years agoMove `tf.contrib.bayesflow.layers` to `tfp.layers`.
Joshua V. Dillon [Wed, 7 Mar 2018 19:12:11 +0000 (11:12 -0800)]
Move `tf.contrib.bayesflow.layers` to `tfp.layers`.

PiperOrigin-RevId: 188203941

6 years agoOptimizations to DepthwiseConv using 3x3 filters.
A. Unique TensorFlower [Wed, 7 Mar 2018 19:04:21 +0000 (11:04 -0800)]
Optimizations to DepthwiseConv using 3x3 filters.

PiperOrigin-RevId: 188202344

6 years agoProperly parse input strings in the dependency optimizer
Benoit Steiner [Wed, 7 Mar 2018 18:58:44 +0000 (10:58 -0800)]
Properly parse input strings in the dependency optimizer

PiperOrigin-RevId: 188201284

6 years agoDocs: Add simple_save section to SavedModel APIs, and add
Billy Lamberta [Wed, 7 Mar 2018 18:47:57 +0000 (10:47 -0800)]
Docs: Add simple_save section to SavedModel APIs, and add
to article intro. Rename headers to make consistent.

PiperOrigin-RevId: 188199437

6 years agoMigrate Halton Sequence sampler into tensorflow_probability.
Joshua V. Dillon [Wed, 7 Mar 2018 17:58:22 +0000 (09:58 -0800)]
Migrate Halton Sequence sampler into tensorflow_probability.

PiperOrigin-RevId: 188191091

6 years agoboosted_trees: fix the comments about gain by removing a confusing dash.
A. Unique TensorFlower [Wed, 7 Mar 2018 17:57:48 +0000 (09:57 -0800)]
boosted_trees: fix the comments about gain by removing a confusing dash.

PiperOrigin-RevId: 188191012

6 years ago[tf.data] Improve docstring for `tf.data.Dataset.padded_batch()`.
Derek Murray [Wed, 7 Mar 2018 17:53:52 +0000 (09:53 -0800)]
[tf.data] Improve docstring for `tf.data.Dataset.padded_batch()`.

PiperOrigin-RevId: 188190458

6 years agoSwitch the eager GAN MNIST example to object-based checkpointing
Allen Lavoie [Wed, 7 Mar 2018 17:51:14 +0000 (09:51 -0800)]
Switch the eager GAN MNIST example to object-based checkpointing

- Removes variable_scopes, since they're no longer necessary (duplicate variable names are OK)
- Switches up the counters a bit (global_step -> step_counter, checkpoint the epoch counter)

PiperOrigin-RevId: 188190128

6 years agoAdd missing equality assertion between the shape of the 2 inputs to the tile op.
Benoit Steiner [Wed, 7 Mar 2018 17:50:46 +0000 (09:50 -0800)]
Add missing equality assertion between the shape of the 2 inputs to the tile op.

PiperOrigin-RevId: 188190067

6 years agoAdd instrumentation interfaces to the GCS file system.
Brennan Saeta [Wed, 7 Mar 2018 17:34:44 +0000 (09:34 -0800)]
Add instrumentation interfaces to the GCS file system.

PiperOrigin-RevId: 188187793