platform/upstream/tensorflow.git
6 years agoConvert Squeeze into Reshape: Support empty output shapes.
A. Unique TensorFlower [Mon, 12 Mar 2018 17:24:56 +0000 (10:24 -0700)]
Convert Squeeze into Reshape: Support empty output shapes.

PiperOrigin-RevId: 188740288

6 years agoSupporting quantization of Gather ops and removal of trivial Relu1s when quantized.
A. Unique TensorFlower [Mon, 12 Mar 2018 17:12:22 +0000 (10:12 -0700)]
Supporting quantization of Gather ops and removal of trivial Relu1s when quantized.

PiperOrigin-RevId: 188738133

6 years agoPlug a few more PyObject leaks, test for them.
Allen Lavoie [Mon, 12 Mar 2018 16:28:18 +0000 (09:28 -0700)]
Plug a few more PyObject leaks, test for them.

PiperOrigin-RevId: 188731961

6 years agoDon't let the grappler item builder fail if the graph contains unknown custom
Benoit Steiner [Mon, 12 Mar 2018 16:16:08 +0000 (09:16 -0700)]
Don't let the grappler item builder fail if the graph contains unknown custom
ops.

PiperOrigin-RevId: 188730560

6 years agoDon't remove identity nodes if they follow a device crossing and have consumers on...
A. Unique TensorFlower [Mon, 12 Mar 2018 16:12:41 +0000 (09:12 -0700)]
Don't remove identity nodes if they follow a device crossing and have consumers on a device different than themselves. They may be used to cache or route data between devices in a deliberate manner.

Simplify code in DependencyOptimizer a bit.

PiperOrigin-RevId: 188730185

6 years agoResourceScatterUpdate: Gracefully handle inconsistent indices and updates in
Asim Shankar [Mon, 12 Mar 2018 16:05:33 +0000 (09:05 -0700)]
ResourceScatterUpdate: Gracefully handle inconsistent indices and updates in
the kernel.

With graph execution, consistency between the shapes of the arguments to
ResourceScatterUpdate is validated by the shape inference functions at graph
construction time.

With eager execution, the shape inference logic isn't executed, so inconsistent
arguments could be provided to the kernel, which would result in a segmentation
fault prior to this change. As demonstrated by the added tests.

PiperOrigin-RevId: 188729154

6 years agoTurn on function optimization by default
Benoit Steiner [Mon, 12 Mar 2018 15:03:54 +0000 (08:03 -0700)]
Turn on function optimization by default

PiperOrigin-RevId: 188722505

6 years agoReuse the linear index when broadcasting a contiguous range of dimensions.
A. Unique TensorFlower [Mon, 12 Mar 2018 14:26:13 +0000 (07:26 -0700)]
Reuse the linear index when broadcasting a contiguous range of dimensions.

This potentially allows us to get rid of additional mod and div operations.

PiperOrigin-RevId: 188719238

6 years agoLint some files.
A. Unique TensorFlower [Mon, 12 Mar 2018 10:13:15 +0000 (03:13 -0700)]
Lint some files.

PiperOrigin-RevId: 188698275

6 years agothis test is also timing out in cuda so disabling for now
Olivia Nordquist [Mon, 12 Mar 2018 07:30:38 +0000 (00:30 -0700)]
this test is also timing out in cuda so disabling for now

PiperOrigin-RevId: 188685611

6 years agopropagate fix from tensorflow/models#3561
Mark Daoust [Mon, 12 Mar 2018 04:23:15 +0000 (21:23 -0700)]
propagate fix from tensorflow/models#3561

PiperOrigin-RevId: 188675327

6 years agoFix assets for the TF camera example.
Shashi Shekhar [Mon, 12 Mar 2018 03:20:45 +0000 (20:20 -0700)]
Fix assets for the TF camera example.

Mobile net model is downloaded from tf_http_archive("tf_mobilenet") rule and renaming the asset file in assets folder has no effect.

PiperOrigin-RevId: 188672531

6 years agodisable flaky asan test
Olivia Nordquist [Mon, 12 Mar 2018 02:35:34 +0000 (19:35 -0700)]
disable flaky asan test

PiperOrigin-RevId: 188670616

6 years agoFix typo in description of INTERNAL error code.
Derek Murray [Mon, 12 Mar 2018 00:49:34 +0000 (17:49 -0700)]
Fix typo in description of INTERNAL error code.

PiperOrigin-RevId: 188666142

6 years agoRemoved duplicate statement.
A. Unique TensorFlower [Sun, 11 Mar 2018 23:22:47 +0000 (16:22 -0700)]
Removed duplicate statement.

PiperOrigin-RevId: 188663018

6 years agoFixes a race condition in function instantiation.
Derek Murray [Sun, 11 Mar 2018 22:38:16 +0000 (15:38 -0700)]
Fixes a race condition in function instantiation.

Previously, if the same function was being concurrently instantiated
and released:

1. Thread one could begin to instantiate the function, determine
   that it already existed in the runtime, then be preempted.
2. Thread two could release the handle on the function, causing it to
   be freed and removed from the `FunctionLibraryRuntime::items_` map.
3. Thread one could then incorrectly assume that the function still
   existed, and fail to find it in the `FunctionLibraryRuntime::items_`
   map, causing a segfault when it attempted to increment the refcount
   on an uninitialized object.

PiperOrigin-RevId: 188661500

6 years agoSpecify the `maximum_iterations` to tf.while_loop in tf.scan to be compatible with...
A. Unique TensorFlower [Sun, 11 Mar 2018 17:44:02 +0000 (10:44 -0700)]
Specify the `maximum_iterations` to tf.while_loop in tf.scan to be compatible with XLA.

PiperOrigin-RevId: 188652533

6 years agoSelectively re-enable bfloat16 tests for the GPU backend.
Bixia Zheng [Sun, 11 Mar 2018 17:15:18 +0000 (10:15 -0700)]
Selectively re-enable bfloat16 tests for the GPU backend.

PiperOrigin-RevId: 188651655

6 years agoImprove errors raised when an object does not match the RNNCell interface.
A. Unique TensorFlower [Sun, 11 Mar 2018 17:00:02 +0000 (10:00 -0700)]
Improve errors raised when an object does not match the RNNCell interface.

PiperOrigin-RevId: 188651070

6 years agoFix windows GPU build scripts.
Gunhan Gulsoy [Sun, 11 Mar 2018 06:18:23 +0000 (22:18 -0800)]
Fix windows GPU build scripts.

PiperOrigin-RevId: 188629017

6 years agoAdds a warning to help user to debug the TPU program hanging for predict() call.
Jianwei Xie [Sun, 11 Mar 2018 03:44:13 +0000 (19:44 -0800)]
Adds a warning to help user to debug the TPU program hanging for predict() call.

PiperOrigin-RevId: 188624174

6 years agoTurn the following ops into Identity.
A. Unique TensorFlower [Sat, 10 Mar 2018 20:03:19 +0000 (12:03 -0800)]
Turn the following ops into Identity.
 * Slice when the Size input matches the size of the input tensor
 * Tile when the multiples input is a tensor of '1'
 * Pad/PadV2 when the paddings input is a tensor of 0
 * Squeeze when the squeeze dimensions are known to be > 1

PiperOrigin-RevId: 188609800

6 years agoIncrement node_ids when merging CostGraphDef.
Rui Zhao [Sat, 10 Mar 2018 08:29:37 +0000 (00:29 -0800)]
Increment node_ids when merging CostGraphDef.

PiperOrigin-RevId: 188586552

6 years ago[XLA] Speed up colocated buffer merging.
Michael Kuperstein [Sat, 10 Mar 2018 06:49:30 +0000 (22:49 -0800)]
[XLA] Speed up colocated buffer merging.

PiperOrigin-RevId: 188581202

6 years agoFix DepthToSpace and SpaceToDepth to silently return instead of failing when the...
A. Unique TensorFlower [Sat, 10 Mar 2018 06:43:51 +0000 (22:43 -0800)]
Fix DepthToSpace and SpaceToDepth to silently return instead of failing when the input tensor is empty.

PiperOrigin-RevId: 188580972

6 years agoFix docstring for `embedding_lookup_sparse`.
A. Unique TensorFlower [Sat, 10 Mar 2018 04:50:32 +0000 (20:50 -0800)]
Fix docstring for `embedding_lookup_sparse`.

Example with weighted mean combiner implies that single-key embeddings not normalized (the weighted sum answer). However, the code and test shows normalization regardless of number of keys.

PiperOrigin-RevId: 188575982

6 years agoUnified test util PlaceHolderFloat() into PlaceHolder(), and extended the latter
Mingsheng Hong [Sat, 10 Mar 2018 03:07:44 +0000 (19:07 -0800)]
Unified test util PlaceHolderFloat() into PlaceHolder(), and extended the latter
to take a TF_DataType param.

PiperOrigin-RevId: 188570493

6 years agoPropagate min/max for StridedSlice
A. Unique TensorFlower [Sat, 10 Mar 2018 02:54:41 +0000 (18:54 -0800)]
Propagate min/max for StridedSlice

PiperOrigin-RevId: 188569611

6 years agoMove optimizations to arithmetic optimizer stages
A. Unique TensorFlower [Sat, 10 Mar 2018 02:50:06 +0000 (18:50 -0800)]
Move optimizations to arithmetic optimizer stages

1) Redundant Bitcast
2) Redundant Cast
3) Remove inverse transpose

PiperOrigin-RevId: 188569367

6 years agoAdd experimental Session::MakeCallable() API and implement it for DirectSession.
Derek Murray [Sat, 10 Mar 2018 02:12:02 +0000 (18:12 -0800)]
Add experimental Session::MakeCallable() API and implement it for DirectSession.

The intent of this new API matches the Python `tf.Session.make_callable()`
method: it splits the two roles of the `Session::Run()` method into separate
methods:

1. `Session::MakeCallable()` takes information about a subgraph (such as the
   names of nodes to feed and fetch), and prunes and optimizes that graph,
   returning a simple handle.
2. `Session::RunCallable()` takes that handle, plus any values to be fed,
   and executes the graph, returning whatever outputs are produced.

This split moves string processing off the critical path of running a
step. We also add a new method `Session::ReleaseCallable()` that makes
it possible to free the resources associated with a cached subgraph,
and could be useful for seldom-executed graphs such as initializers.

PiperOrigin-RevId: 188566635

6 years agoFix flakiness in common_runtime/function_test.cc.
Derek Murray [Sat, 10 Mar 2018 02:00:26 +0000 (18:00 -0800)]
Fix flakiness in common_runtime/function_test.cc.

The flakiness was due to nondeterministic names being chosen for
folded constants; the fix was to split out the source of the
nondetermism into a separate test.

PiperOrigin-RevId: 188565362

6 years agoAllowing ReorderActivationFunctions to reorder output arrays and adding support for...
A. Unique TensorFlower [Sat, 10 Mar 2018 00:34:42 +0000 (16:34 -0800)]
Allowing ReorderActivationFunctions to reorder output arrays and adding support for propagating activation functions into Gather ops and as constant ops.

PiperOrigin-RevId: 188556574

6 years ago[XLA] Add a whole graph execution interface.
A. Unique TensorFlower [Sat, 10 Mar 2018 00:17:08 +0000 (16:17 -0800)]
[XLA] Add a whole graph execution interface.

PiperOrigin-RevId: 188554206

6 years agoProcFLR: Include the remote function target in the function_key
Brennan Saeta [Fri, 9 Mar 2018 23:39:11 +0000 (15:39 -0800)]
ProcFLR: Include the remote function target in the function_key

PiperOrigin-RevId: 188548941

6 years agoMove a utility function into the eager C internal API
Akshay Modi [Fri, 9 Mar 2018 23:34:44 +0000 (15:34 -0800)]
Move a utility function into the eager C internal API

PiperOrigin-RevId: 188548393

6 years agoCopy `replicate_model_fn` to core.
Igor Saprykin [Fri, 9 Mar 2018 23:28:15 +0000 (15:28 -0800)]
Copy `replicate_model_fn` to core.

PiperOrigin-RevId: 188547527

6 years agoMigrate tf.contrib.bayesflow.optimizers to tfp.optimziers.
Joshua V. Dillon [Fri, 9 Mar 2018 23:27:50 +0000 (15:27 -0800)]
Migrate tf.contrib.bayesflow.optimizers to tfp.optimziers.

PiperOrigin-RevId: 188547477

6 years agoEager: Fix a Dimension PyObject leak, test for it.
Allen Lavoie [Fri, 9 Mar 2018 22:42:51 +0000 (14:42 -0800)]
Eager: Fix a Dimension PyObject leak, test for it.

PiperOrigin-RevId: 188540944

6 years agoInternal Change.
Michael Case [Fri, 9 Mar 2018 22:41:06 +0000 (14:41 -0800)]
Internal Change.

PiperOrigin-RevId: 188540659

6 years agoPart of the update of tf.keras to the Keras 2.1.5 API.
Francois Chollet [Fri, 9 Mar 2018 22:40:18 +0000 (14:40 -0800)]
Part of the update of tf.keras to the Keras 2.1.5 API.

PiperOrigin-RevId: 188540513

6 years agoAutomated g4 rollback of changelist 188501394
A. Unique TensorFlower [Fri, 9 Mar 2018 22:17:03 +0000 (14:17 -0800)]
Automated g4 rollback of changelist 188501394

PiperOrigin-RevId: 188536863

6 years ago[TF:XLA] Bump open source llvm revision to r326989
Sanjoy Das [Fri, 9 Mar 2018 22:15:23 +0000 (14:15 -0800)]
[TF:XLA] Bump open source llvm revision to r326989

PiperOrigin-RevId: 188536576

6 years agoAdd smart_case that calls smart_cond.
Skye Wanderman-Milne [Fri, 9 Mar 2018 22:00:23 +0000 (14:00 -0800)]
Add smart_case that calls smart_cond.

PiperOrigin-RevId: 188534066

6 years agoRemove the nondeterminism from a test for initializing variables from checkpoints.
A. Unique TensorFlower [Fri, 9 Mar 2018 21:54:17 +0000 (13:54 -0800)]
Remove the nondeterminism from a test for initializing variables from checkpoints.

PiperOrigin-RevId: 188533156

6 years ago[XLA:Doc] Fix an typo "Alternately" -> "Alternatively".
Kay Zhu [Fri, 9 Mar 2018 21:47:36 +0000 (13:47 -0800)]
[XLA:Doc] Fix an typo "Alternately" -> "Alternatively".

PiperOrigin-RevId: 188532135

6 years agoLSTM support: Add non-uint8 quantized operators.
A. Unique TensorFlower [Fri, 9 Mar 2018 21:26:41 +0000 (13:26 -0800)]
LSTM support: Add non-uint8 quantized operators.

PiperOrigin-RevId: 188529107

6 years agoInternal Change
A. Unique TensorFlower [Fri, 9 Mar 2018 21:24:23 +0000 (13:24 -0800)]
Internal Change

PiperOrigin-RevId: 188528771

6 years agoAutomated g4 rollback of changelist 188492233
A. Unique TensorFlower [Fri, 9 Mar 2018 21:00:12 +0000 (13:00 -0800)]
Automated g4 rollback of changelist 188492233

PiperOrigin-RevId: 188525453

6 years agoAutomated g4 rollback of changelist 188433328
Gunhan Gulsoy [Fri, 9 Mar 2018 20:57:56 +0000 (12:57 -0800)]
Automated g4 rollback of changelist 188433328

PiperOrigin-RevId: 188525171

6 years agoMove warm_starting_util from third_party/tensorflow/python/estimator to third_party...
A. Unique TensorFlower [Fri, 9 Mar 2018 20:39:41 +0000 (12:39 -0800)]
Move warm_starting_util from third_party/tensorflow/python/estimator to third_party/tensorflow/python/training (move WarmStartSettings definition to third_party/tensorflow/python/estimator/estimator.py), and make _warm_start() public under tf.train.warm_start().  WarmStartSettings and VocabInfo are both available under tf.estimator, and VocabInfo is also available under tf.train.

PiperOrigin-RevId: 188522820

6 years agoAllowing for FunctionLibraryRuntime::Run calls to not be provided with a runner to...
Rohan Jain [Fri, 9 Mar 2018 20:20:32 +0000 (12:20 -0800)]
Allowing for FunctionLibraryRuntime::Run calls to not be provided with a runner to execute kernels with. In that case, it defaults to using the threadpool provided by the device.
Also makes sure each device has a default threadpool to fall back on.

PiperOrigin-RevId: 188520648

6 years agoAdd more debugging output, filtering by int_type in XLA test, more tests.
Jacques Pienaar [Fri, 9 Mar 2018 19:37:04 +0000 (11:37 -0800)]
Add more debugging output, filtering by int_type in XLA test, more tests.

PiperOrigin-RevId: 188513895

6 years agoAdd bool type for tflite.
Mingxing Tan [Fri, 9 Mar 2018 19:29:40 +0000 (11:29 -0800)]
Add bool type for tflite.

PiperOrigin-RevId: 188512706

6 years ago[XLA:GPU] Don't fuse get-tuple-element.
Justin Lebar [Fri, 9 Mar 2018 19:11:44 +0000 (11:11 -0800)]
[XLA:GPU] Don't fuse get-tuple-element.

Fusing GTE works, but it's slower than not fusing.  (In some sense, GTE
is *always* fused; it's just that our "implicit fusion" implementation
is faster than our explicit fusion implementation.)

PiperOrigin-RevId: 188509801

6 years agoMake SetNumThreads apply to the eigen threads. (This creates a dependency on eigen!)
A. Unique TensorFlower [Fri, 9 Mar 2018 18:39:50 +0000 (10:39 -0800)]
Make SetNumThreads apply to the eigen threads. (This creates a dependency on eigen!)

PiperOrigin-RevId: 188504172

6 years agoAutomated g4 rollback of changelist 188397087
A. Unique TensorFlower [Fri, 9 Mar 2018 18:33:28 +0000 (10:33 -0800)]
Automated g4 rollback of changelist 188397087

PiperOrigin-RevId: 188503184

6 years ago[XLA:GPU] Convert FusionMergerTest to use module strings.
Justin Lebar [Fri, 9 Mar 2018 18:30:25 +0000 (10:30 -0800)]
[XLA:GPU] Convert FusionMergerTest to use module strings.

This is a nice cleanup, but it also makes this a proper unit test -- the
module strings we use are post fusion.  (Without module strings, fusion
computations are a real pain to create.)

PiperOrigin-RevId: 188502642

6 years agoImplement partial constant folding for Concat.
A. Unique TensorFlower [Fri, 9 Mar 2018 18:22:16 +0000 (10:22 -0800)]
Implement partial constant folding for Concat.

PiperOrigin-RevId: 188501394

6 years agoEnsure that the rank of the input to tf.Unique is 1 as shape inference time instead...
Benoit Steiner [Fri, 9 Mar 2018 17:48:05 +0000 (09:48 -0800)]
Ensure that the rank of the input to tf.Unique is 1 as shape inference time instead of letting the kernel catch invalid inputs.

PiperOrigin-RevId: 188496351

6 years agoUse the multithreaded conv only when threads are available.
A. Unique TensorFlower [Fri, 9 Mar 2018 17:39:21 +0000 (09:39 -0800)]
Use the multithreaded conv only when threads are available.

PiperOrigin-RevId: 188495357

6 years agoEnable the Grappler arithmetic optimizer for all python tests.
A. Unique TensorFlower [Fri, 9 Mar 2018 17:13:14 +0000 (09:13 -0800)]
Enable the Grappler arithmetic optimizer for all python tests.

PiperOrigin-RevId: 188492233

6 years agoDesugar IfExp nodes
A. Unique TensorFlower [Fri, 9 Mar 2018 17:06:30 +0000 (09:06 -0800)]
Desugar IfExp nodes

PiperOrigin-RevId: 188491604

6 years agoAdding support for constant Gather ops.
A. Unique TensorFlower [Fri, 9 Mar 2018 14:45:57 +0000 (06:45 -0800)]
Adding support for constant Gather ops.

PiperOrigin-RevId: 188478173

6 years agoConvert Squeeze into Reshape and support squeezes on all dimensions.
A. Unique TensorFlower [Fri, 9 Mar 2018 14:41:33 +0000 (06:41 -0800)]
Convert Squeeze into Reshape and support squeezes on all dimensions.

PiperOrigin-RevId: 188477922

6 years ago[StreamExecutor] Remove ThenDoHostCallbackForTest -- it's identical to ThenDoHostCall...
Justin Lebar [Fri, 9 Mar 2018 10:16:53 +0000 (02:16 -0800)]
[StreamExecutor] Remove ThenDoHostCallbackForTest -- it's identical to ThenDoHostCallback.

The reason this came about is: ThenDoHostCallback was once private, and
ThenDoHostCallbackForTest was public.  Then at some point
ThenDoHostCallback became public, but the *ForTest one was never
removed.

PiperOrigin-RevId: 188459741

6 years agoFix misleading comment.
Sanjoy Das [Fri, 9 Mar 2018 08:09:03 +0000 (00:09 -0800)]
Fix misleading comment.

PiperOrigin-RevId: 188450336

6 years agoRemove a layer of templatization
Sanjoy Das [Fri, 9 Mar 2018 07:28:53 +0000 (23:28 -0800)]
Remove a layer of templatization

With this change

 - HloTestBase always calls HloRunner with an array of non-owning Literal
   pointers as arguments
 - HloRunner no longer has a general LiteralPtr, but just provides explicit
   overloads for std::unique_ptr<Literal> and Literal*

This was prompted by a dependent change that needs to call
HloTestBase::RunAndCompare with Literal* arguments.
PiperOrigin-RevId: 188446331

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