platform/upstream/tensorflow.git
7 years ago[TF:JIT] Make :xla_device visible to public, which is necessary for 3rd party
Kay Zhu [Thu, 18 Jan 2018 19:30:02 +0000 (11:30 -0800)]
[TF:JIT] Make :xla_device visible to public, which is necessary for 3rd party
to use XLA. Also add a build target to tf/compiler/plugin/BUILD that depends on
:xla_device to help ensure it stays visible to public.

PiperOrigin-RevId: 182410844

7 years agoDisable flaky test
Allen Lavoie [Thu, 18 Jan 2018 19:09:26 +0000 (11:09 -0800)]
Disable flaky test

Due to a known input function issue.

PiperOrigin-RevId: 182407471

7 years ago[TF:XLA] Add support for atrous (RHS dilated) convolutions via the "dilations" attrib...
Peter Hawkins [Thu, 18 Jan 2018 18:51:41 +0000 (10:51 -0800)]
[TF:XLA] Add support for atrous (RHS dilated) convolutions via the "dilations" attribute on convolution operators.

PiperOrigin-RevId: 182404352

7 years agoWarn against using the name RELU1 again as an op.
Andrew Selle [Thu, 18 Jan 2018 18:45:25 +0000 (10:45 -0800)]
Warn against using the name RELU1 again as an op.

PiperOrigin-RevId: 182403185

7 years ago[XLA:AOT] Emit a .o file to hold the ProgramShape protobuf
Sanjoy Das [Thu, 18 Jan 2018 18:29:39 +0000 (10:29 -0800)]
[XLA:AOT] Emit a .o file to hold the ProgramShape protobuf

This changes tfcompile to emit two .o files, one containing the TF model, and
one containing "helpers" which for now only contains the relevant
xla::ProgramShape protobuf in serialized form.
PiperOrigin-RevId: 182400539

7 years agoAdds SUM_OVER_BATCH_SIZE in losses.Reduction.
A. Unique TensorFlower [Thu, 18 Jan 2018 18:24:13 +0000 (10:24 -0800)]
Adds SUM_OVER_BATCH_SIZE in losses.Reduction.

PiperOrigin-RevId: 182399706

7 years agoAllow numpy_input_fn to take an ndarray representing a single input feature.
A. Unique TensorFlower [Thu, 18 Jan 2018 18:10:07 +0000 (10:10 -0800)]
Allow numpy_input_fn to take an ndarray representing a single input feature.

PiperOrigin-RevId: 182397583

7 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Thu, 18 Jan 2018 16:47:09 +0000 (08:47 -0800)]
Go: Update generated wrapper functions for TensorFlow ops.

PiperOrigin-RevId: 182384458

7 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Thu, 18 Jan 2018 16:18:22 +0000 (08:18 -0800)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 182378232

7 years agoAdded matrix logarithm op to linear algebra ops.
A. Unique TensorFlower [Thu, 18 Jan 2018 16:10:50 +0000 (08:10 -0800)]
Added matrix logarithm op to linear algebra ops.

PiperOrigin-RevId: 182376730

7 years agoFix Markdown for examples in WarmStartSettings docstring.
A. Unique TensorFlower [Thu, 18 Jan 2018 15:27:48 +0000 (07:27 -0800)]
Fix Markdown for examples in WarmStartSettings docstring.

PiperOrigin-RevId: 182368459

7 years agoExpose Sequential as tfe.Sequential to go with the already exposed tfe.Network.
A. Unique TensorFlower [Thu, 18 Jan 2018 15:03:48 +0000 (07:03 -0800)]
Expose Sequential as tfe.Sequential to go with the already exposed tfe.Network.

PiperOrigin-RevId: 182365046

7 years agoBasic feature selection for boosted trees.
A. Unique TensorFlower [Thu, 18 Jan 2018 09:35:01 +0000 (01:35 -0800)]
Basic feature selection for boosted trees.

The idea is that we grow the trees normally until we reach the requested number of unique features, and once we reach that limit, we avoid using any new features.

PiperOrigin-RevId: 182336278

7 years ago[XLA] Add Pad to the local Python XLA client.
A. Unique TensorFlower [Thu, 18 Jan 2018 06:28:11 +0000 (22:28 -0800)]
[XLA] Add Pad to the local Python XLA client.

PiperOrigin-RevId: 182320104

7 years ago[XLA:python] Simplify frame data extraction, fix Py3 compatibility bugs.
Chris Leary [Thu, 18 Jan 2018 05:25:40 +0000 (21:25 -0800)]
[XLA:python] Simplify frame data extraction, fix Py3 compatibility bugs.

PiperOrigin-RevId: 182315965

7 years agoAdd WarmStartSettings configuration for canned Estimators.
A. Unique TensorFlower [Thu, 18 Jan 2018 05:14:42 +0000 (21:14 -0800)]
Add WarmStartSettings configuration for canned Estimators.

PiperOrigin-RevId: 182315322

7 years agoSay SQLite BLOB protos are ideally temporary
Justine Tunney [Thu, 18 Jan 2018 04:55:46 +0000 (20:55 -0800)]
Say SQLite BLOB protos are ideally temporary

We ideally want a schema that's pure SQL and doesn't embed
protos. However some protos we don't have time to translate
quite yet. So we put a BLOB as the last field so it can be
migrated later.

Please note there might end up being some things highly
specific to TensorFlow and/or Google that end up here. In
those cases we might consider keeping the proto blobs
permanently, if they're difficult to express in SQL.

PiperOrigin-RevId: 182313847

7 years agoSlightly tune the usage of ctx to be consistent with other places.
Jianwei Xie [Thu, 18 Jan 2018 02:56:27 +0000 (18:56 -0800)]
Slightly tune the usage of ctx to be consistent with other places.

PiperOrigin-RevId: 182305106

7 years agoDynamically print helper message based on user queries.
A. Unique TensorFlower [Thu, 18 Jan 2018 01:49:23 +0000 (17:49 -0800)]
Dynamically print helper message based on user queries.

PiperOrigin-RevId: 182298241

7 years agointernal change
A. Unique TensorFlower [Thu, 18 Jan 2018 01:13:03 +0000 (17:13 -0800)]
internal change

PiperOrigin-RevId: 182294233

7 years agoNicer error messages when missing filesystem.
Brennan Saeta [Thu, 18 Jan 2018 01:07:11 +0000 (17:07 -0800)]
Nicer error messages when missing filesystem.

PiperOrigin-RevId: 182293612

7 years agoAdd range encode and decode to new tensorflow contrib.
Sung Jin Hwang [Thu, 18 Jan 2018 01:05:21 +0000 (17:05 -0800)]
Add range encode and decode to new tensorflow contrib.

PiperOrigin-RevId: 182293433

7 years agoChanges the CapturedFunction implementation to not create a new FunctionLibraryRuntim...
Rohan Jain [Thu, 18 Jan 2018 00:56:14 +0000 (16:56 -0800)]
Changes the CapturedFunction implementation to not create a new FunctionLibraryRuntime etc. and just re-use the existing one provided. This allows for Dataset ops to run cross device and cross process.

PiperOrigin-RevId: 182292325

7 years ago[XLA] Add source mapping support to SWIG API.
Chris Leary [Thu, 18 Jan 2018 00:54:30 +0000 (16:54 -0800)]
[XLA] Add source mapping support to SWIG API.

PiperOrigin-RevId: 182292142

7 years agoUse explicit broadcasts in ResizeBilinear Kernel creation to make fusion easier.
Blake Hechtman [Thu, 18 Jan 2018 00:49:54 +0000 (16:49 -0800)]
Use explicit broadcasts in ResizeBilinear Kernel creation to make fusion easier.

PiperOrigin-RevId: 182291519

7 years agoUpdate contrib/all_reduce/python/all_reduce.py in consequence of
A. Unique TensorFlower [Thu, 18 Jan 2018 00:30:21 +0000 (16:30 -0800)]
Update contrib/all_reduce/python/all_reduce.py in consequence of
earlier change to nccl.broadcast function signature.

PiperOrigin-RevId: 182288943

7 years agoCombine host and device memory proto fields.
Yuefeng Zhou [Wed, 17 Jan 2018 23:58:10 +0000 (15:58 -0800)]
Combine host and device memory proto fields.

PiperOrigin-RevId: 182284426

7 years agoMake _check_bazel_version_at_least in workspace.bzl public.
Kiril Gorovoy [Wed, 17 Jan 2018 23:28:25 +0000 (15:28 -0800)]
Make _check_bazel_version_at_least in workspace.bzl public.

PiperOrigin-RevId: 182280342

7 years agoPrune away Identity nodes without regular outputs. (Addresses TODO from cl/175780178).
A. Unique TensorFlower [Wed, 17 Jan 2018 23:07:39 +0000 (15:07 -0800)]
Prune away Identity nodes without regular outputs. (Addresses TODO from cl/175780178).

PiperOrigin-RevId: 182277131

7 years agoDisabling flaky replicate_model_fn_test.py for cmake.
Amit Patankar [Wed, 17 Jan 2018 22:44:17 +0000 (14:44 -0800)]
Disabling flaky replicate_model_fn_test.py for cmake.

PiperOrigin-RevId: 182273024

7 years agoAdd functionality to auto-discover project and zone when they are not supplied to...
Frank Chen [Wed, 17 Jan 2018 22:29:30 +0000 (14:29 -0800)]
Add functionality to auto-discover project and zone when they are not supplied to the TPUClusterResolver

PiperOrigin-RevId: 182270565

7 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Wed, 17 Jan 2018 22:23:28 +0000 (14:23 -0800)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 182269654

7 years agoK-FAC: Fixes problem where initial eigendecomposition used by RNN classes would be...
A. Unique TensorFlower [Wed, 17 Jan 2018 21:58:05 +0000 (13:58 -0800)]
K-FAC: Fixes problem where initial eigendecomposition used by RNN classes would be computed during the call to instantiate_factors (via the "registration"  functions) instead of the call to make_inverse_update_ops.  This messed up the device placement of these ops and interacted badly with other parts of the code.

Also changed how covariance op creation is done in ConvDiagonalFactor in anticipation of similar problems in the future.

As of this CL, none of the op creation methods will modify the state of the class, and no ops will be created outside of the op creation methods.  We should try to follow this convention going forward.

PiperOrigin-RevId: 182265266

7 years agoAdd TF_GraphNumFunctions and TF_GraphGetFunctions
Igor Ganichev [Wed, 17 Jan 2018 21:46:17 +0000 (13:46 -0800)]
Add TF_GraphNumFunctions and TF_GraphGetFunctions

PiperOrigin-RevId: 182263576

7 years ago[TF:XLA] Bump open source llvm revision to r322618
Sanjoy Das [Wed, 17 Jan 2018 21:41:05 +0000 (13:41 -0800)]
[TF:XLA] Bump open source llvm revision to r322618

PiperOrigin-RevId: 182262817

7 years agoAdding support for to resolve constant FloorDiv, FloorMod, StridedSlice, Stack, Rank...
A. Unique TensorFlower [Wed, 17 Jan 2018 21:29:50 +0000 (13:29 -0800)]
Adding support for to resolve constant FloorDiv, FloorMod, StridedSlice, Stack, Rank and Range.

PiperOrigin-RevId: 182261052

7 years agoMerge changes from github.
Sourabh Bajaj [Wed, 17 Jan 2018 21:14:48 +0000 (13:14 -0800)]
Merge changes from github.

PiperOrigin-RevId: 182258809

7 years ago * Adds rank-3 ReduceWindow computation to the reference util test suite.
Tayo Oguntebi [Wed, 17 Jan 2018 20:55:00 +0000 (12:55 -0800)]
  * Adds rank-3 ReduceWindow computation to the reference util test suite.
  * Adds rank-3 test harness for ReduceWindow, along with some test cases.
  * Minor style correction.

PiperOrigin-RevId: 182256143

7 years agoMake int64 inputs workable, and testable in generate_examples_test.
Yu-Cheng Ling [Wed, 17 Jan 2018 20:28:46 +0000 (12:28 -0800)]
Make int64 inputs workable, and testable in generate_examples_test.

PiperOrigin-RevId: 182252829

7 years ago[XLA:GPU] Fix a problem in calculating the address of the memory used to
A. Unique TensorFlower [Wed, 17 Jan 2018 20:20:20 +0000 (12:20 -0800)]
[XLA:GPU] Fix a problem in calculating the address of the memory used to
implement small data type atomic operations.

To calculate the address of the enclosing 4 byte memory,
output_address&(-2) was used while it should be output_address&(-4).

Add a test case.

PiperOrigin-RevId: 182251760

7 years agoTFE: Improve spinn/README.md
Shanqing Cai [Wed, 17 Jan 2018 19:51:07 +0000 (11:51 -0800)]
TFE: Improve spinn/README.md

PiperOrigin-RevId: 182247687

7 years agoMake `replicate_model_fn` friendlier to distributed training.
Igor Saprykin [Wed, 17 Jan 2018 19:37:48 +0000 (11:37 -0800)]
Make `replicate_model_fn` friendlier to distributed training.

I verified that async distributed training works as is.  One quirk is that when replicating over a single GPU, variables end up being placed on /gpu:0 on PSs, which works correctly only thanks to allow_soft_placement=True.
For sync distributed training using SyncReplicasOptimizer the only quirk is that SyncReplicasOptimizerHook insists on SyncReplicasOptimizer.apply_gradients to be called.  That happens only in the last tower, yet any tower could create the hook.  To accommodate that requirement hooks from the last tower are taken as part of this CL. Before this, hooks from the first tower were taken.

SyncReplicasOptimizer doesn't behave perfectly in tests.  The queue keeps hanging waiting for new token to arrive until `stop_grace_period_seconds` which is set for 120 seconds.  The latter isn't exposed through the Estimator interface, which means the test is slower.

PiperOrigin-RevId: 182245657

7 years agoAdd tf.contrib.image.connected_components.
Dan Ringwalt [Wed, 17 Jan 2018 19:33:12 +0000 (11:33 -0800)]
Add tf.contrib.image.connected_components.

Comparable to scipy.ndimage.measurements.label.

PiperOrigin-RevId: 182244926

7 years agoAllow specifying the device in CreateParameterAndTransferLiteral.
Yuanzhong Xu [Wed, 17 Jan 2018 19:32:05 +0000 (11:32 -0800)]
Allow specifying the device in CreateParameterAndTransferLiteral.

PiperOrigin-RevId: 182244708

7 years agoInternal change.
A. Unique TensorFlower [Wed, 17 Jan 2018 19:05:24 +0000 (11:05 -0800)]
Internal change.

PiperOrigin-RevId: 182240175

7 years agoMake logging more accurate
A. Unique TensorFlower [Wed, 17 Jan 2018 17:55:59 +0000 (09:55 -0800)]
Make logging more accurate

PiperOrigin-RevId: 182229043

7 years agoAdds regularization_losses in canned heads.
A. Unique TensorFlower [Wed, 17 Jan 2018 17:49:03 +0000 (09:49 -0800)]
Adds regularization_losses in canned heads.

PiperOrigin-RevId: 182228149

7 years agoAdd instruction count method to HloModule.
Mark Heffernan [Wed, 17 Jan 2018 17:41:43 +0000 (09:41 -0800)]
Add instruction count method to HloModule.

PiperOrigin-RevId: 182227249

7 years agoCreate support for div and sub in tensorflow lite.
Andrew Selle [Wed, 17 Jan 2018 17:36:55 +0000 (09:36 -0800)]
Create support for div and sub in tensorflow lite.

PiperOrigin-RevId: 182226574

7 years agoexport_strategy: Add strip_default_attrs to ExportStrategy and it's export_fn signature.
A. Unique TensorFlower [Wed, 17 Jan 2018 16:22:06 +0000 (08:22 -0800)]
export_strategy: Add strip_default_attrs to ExportStrategy and it's export_fn signature.

This allows for a single place (ExportStrategy) where the config for strip_default_attrs is stored. If the export_fn callback accepts the `strip_default_attrs` argument, it can
then propagate the `strip_default_attrs` arg to estimator.export_savedmodel().

Also changed the default for `strip_default_attrs` in the ExportStrategy factory methods (saved_model_export_utils.py) to None. This allows clients that process a given ExportStrategy object to determine if a value has been provided for ExportStrategy.strip_default_attrs field (i.e., `is not None`).
If no value has been provided, those clients can then use whatever default they wish to use.

PiperOrigin-RevId: 182217376

7 years agoRename the newly introduced TF_SetAttrFunc function to make it clear that it is
A. Unique TensorFlower [Wed, 17 Jan 2018 16:11:09 +0000 (08:11 -0800)]
Rename the newly introduced TF_SetAttrFunc function to make it clear that it is
setting the attribute to a function name.  This permits future patches to add
things like TF_SetAttrFuncAttrList if necessary later.

PiperOrigin-RevId: 182216098

7 years agoK-FAC: Expose protected functions from fisher_blocks and fisher_factors and constant...
A. Unique TensorFlower [Wed, 17 Jan 2018 13:03:05 +0000 (05:03 -0800)]
K-FAC: Expose protected functions from fisher_blocks and fisher_factors and constant strings from layer_collection in their respective library modules. This allows consistent development of blocks and factors outside tensorflow.contrib.kfac.

PiperOrigin-RevId: 182197356

7 years ago[XLA] Make the hlo_evaluator handle reduce window in the same ways as the cpu backend...
A. Unique TensorFlower [Wed, 17 Jan 2018 06:55:02 +0000 (22:55 -0800)]
[XLA] Make the hlo_evaluator handle reduce window in the same ways as the cpu backend. Also,
- Added a test that would fail without this change.
- Enabled reduce_window_test_interpreter.
- Added the DISALBED_ON_INTERPRETER macro and disalbed large tests on the interpreter.

The evaluator assumed the input value to be 0 when out of bound, which is likely to produce wrong output when the reduction function is not Add.

PiperOrigin-RevId: 182164740

7 years agoBump the size of keras:core_test as it is flakily timing out.
Gunhan Gulsoy [Wed, 17 Jan 2018 05:48:26 +0000 (21:48 -0800)]
Bump the size of keras:core_test as it is flakily timing out.

PiperOrigin-RevId: 182159937

7 years agoAutomated g4 rollback of changelist 182127737
A. Unique TensorFlower [Wed, 17 Jan 2018 04:47:19 +0000 (20:47 -0800)]
Automated g4 rollback of changelist 182127737

PiperOrigin-RevId: 182155292

7 years ago[TF:XLA] Remove workaround for b/37575001.
A. Unique TensorFlower [Wed, 17 Jan 2018 03:52:30 +0000 (19:52 -0800)]
[TF:XLA] Remove workaround for b/37575001.

The lowering bug has been long fixed, so the workaround of constructing R3s is no longer required.

PiperOrigin-RevId: 182150664

7 years agoIntroduce a new C API entrypoint to set a 'func' attribute on an op
A. Unique TensorFlower [Wed, 17 Jan 2018 03:02:15 +0000 (19:02 -0800)]
Introduce a new C API entrypoint to set a 'func' attribute on an op
description.

PiperOrigin-RevId: 182146876

7 years agoDisable exceptions in TensorFlow jsoncpp build
Justine Tunney [Wed, 17 Jan 2018 02:25:34 +0000 (18:25 -0800)]
Disable exceptions in TensorFlow jsoncpp build

This is necessary to compile with Clang. Since the TF GCP code doesn't have any
try/catch statements, this could be a bug fix.

PiperOrigin-RevId: 182143536

7 years agoMake SQLite binary smaller in TensorFlow
Justine Tunney [Wed, 17 Jan 2018 02:24:54 +0000 (18:24 -0800)]
Make SQLite binary smaller in TensorFlow

This makes it 400kB smaller. This is worth it because even
-O6 would only make SQLite 3% faster.

https://www.sqlite.org/footprint.html

PiperOrigin-RevId: 182143488

7 years agoAdd decay/epsilon/updates_collections parameters to Inception v3 arg_scope
A. Unique TensorFlower [Wed, 17 Jan 2018 02:24:39 +0000 (18:24 -0800)]
Add decay/epsilon/updates_collections parameters to Inception v3 arg_scope

PiperOrigin-RevId: 182143473

7 years agoRemove a duplicate bfloat16 registration.
A. Unique TensorFlower [Wed, 17 Jan 2018 02:20:02 +0000 (18:20 -0800)]
Remove a duplicate bfloat16 registration.

PiperOrigin-RevId: 182143007

7 years agoK-FAC: Example using tf.estimator and K-FAC.
A. Unique TensorFlower [Wed, 17 Jan 2018 01:21:12 +0000 (17:21 -0800)]
K-FAC: Example using tf.estimator and K-FAC.
- Removes FisherEstimator.inv_updates_dict. Users should create directly from
  FisherEstimator.inv_update_ops.
- Adds (cov|inv)_update_(thunks|ops) to KfacOptimizer.

PiperOrigin-RevId: 182135826

7 years agoAllow ReorderAxes to work on QUINT8 arrays. This will be necessary in order to suppor...
A. Unique TensorFlower [Wed, 17 Jan 2018 00:48:56 +0000 (16:48 -0800)]
Allow ReorderAxes to work on QUINT8 arrays. This will be necessary in order to support models that include tensorflow's DequantizeOp (such models were "quantized" using tensorflow's transform_graph tool).

PiperOrigin-RevId: 182131833

7 years agoFix flakiness of dataset_constructor_op_test and flat_map_dataset_op_test due to
Saurabh Saxena [Wed, 17 Jan 2018 00:43:13 +0000 (16:43 -0800)]
Fix flakiness of dataset_constructor_op_test and flat_map_dataset_op_test due to
timeouts.

PiperOrigin-RevId: 182131168

7 years ago[TF] Fix XLA Control Flow gradient stacks max_size creation.
Eugene Brevdo [Wed, 17 Jan 2018 00:17:36 +0000 (16:17 -0800)]
[TF] Fix XLA Control Flow gradient stacks max_size creation.

Stack creation uses tf.while_loop's maximum_iterations iff the while_loop
was created inside an XLA/TPU context.  Added several error checks to ensure
this provides useful error messages if the limited use case is not supported.

PiperOrigin-RevId: 182128135

7 years agoInternal Change.
Michael Case [Wed, 17 Jan 2018 00:14:57 +0000 (16:14 -0800)]
Internal Change.

PiperOrigin-RevId: 182127737

7 years agoIntroducing RF computation considering models with specific input resolution. Previou...
A. Unique TensorFlower [Tue, 16 Jan 2018 23:53:35 +0000 (15:53 -0800)]
Introducing RF computation considering models with specific input resolution. Previously, the input resolution was not taken into account, which led to undefined padding for many well-known models (since those rely on SAME padding, and in some cases SAME padding depends on input resolution).

This change also redesigns many aspects of the topological sorting and layer parsing functions, introducing new modules and tests.

PiperOrigin-RevId: 182124694

7 years agoEnable bfloat16 for CPU kernels
A. Unique TensorFlower [Tue, 16 Jan 2018 23:52:12 +0000 (15:52 -0800)]
Enable bfloat16 for CPU kernels

PiperOrigin-RevId: 182124532

7 years agoSwitch default `replicate_model_fn.loss_reduction` to SUM_BY_NONZERO_WEIGHTS.
Igor Saprykin [Tue, 16 Jan 2018 23:39:34 +0000 (15:39 -0800)]
Switch default `replicate_model_fn.loss_reduction` to SUM_BY_NONZERO_WEIGHTS.

Users of weighted losses need loss_reduction=SUM, otherwise the most common choice is SUM_BY_NONZERO_WEIGHTS.  Estimator class doesn't have visibility into whether weighted losses are used, so the default was assumed to be SUM, because it's correct-ish in either case.  This change sets the default to SUM_BY_NONZERO_WEIGHTS to accomodate the most common case.

PiperOrigin-RevId: 182122737

7 years agoDon't assign Tensor._shape in control_flow_ops.py
Skye Wanderman-Milne [Tue, 16 Jan 2018 23:37:05 +0000 (15:37 -0800)]
Don't assign Tensor._shape in control_flow_ops.py

I'm not totally sure why this was done to begin with. However, nothing
seems to break with it removed. I'd like to remove this since setting
_shape won't work with the C API enabled.

PiperOrigin-RevId: 182122350

7 years agoLog all valid visible cuda gpu id in one line.
Guangda Lai [Tue, 16 Jan 2018 23:33:35 +0000 (15:33 -0800)]
Log all valid visible cuda gpu id in one line.

PiperOrigin-RevId: 182121746

7 years agoExit previously entered sub-context-managers whenever any __enter__() call
A. Unique TensorFlower [Tue, 16 Jan 2018 23:19:36 +0000 (15:19 -0800)]
Exit previously entered sub-context-managers whenever any __enter__() call
throws an exception in tf.name_scope() and tf.variable_scope().

The previous conversion from generator style context managers translated a
nested with block like

    with context_a, context_b:
      yield

into the following pair of __enter__()/__exit__() methods:

    def __enter__(self):
      self.context_a.__enter__()
      self.context_b.__enter__()

    def __exit__(self, *args):
      self.context_b.__exit__(*args)
      self.context_a.__exit__(*args)
      return False

This translation is only correct when self.context_b.__enter__() does not throw
an exception. In the context of tf.name_scope() and tf.variable_scope(),
context_a is the default graph stack, and context_b is the actual scope to
enter. Entering an actual scope throws a ValueError when the scope name is
invalid. In that case, the above implementation leaves __enter__() without
popping the default graph stack. Sub-sequent calls to pop the stack will thus
fail, obscuring the actual exception that was raised in entering the scope.

PiperOrigin-RevId: 182119816

7 years agoAdjust setup to fix Tensorboard entrypoint (run_main -> main).
Russell Power [Tue, 16 Jan 2018 23:19:04 +0000 (15:19 -0800)]
Adjust setup to fix Tensorboard entrypoint (run_main -> main).

PiperOrigin-RevId: 182119760

7 years agoCheck for existence of attrs when making a `TFDecorator`.
Akshay Agrawal [Tue, 16 Jan 2018 23:18:35 +0000 (15:18 -0800)]
Check for existence of attrs when making a `TFDecorator`.

Fixes a bug that arose when the supplied target to `make_decorator` was
a callable that did not have a `__name__` member.

PiperOrigin-RevId: 182119694

7 years agoEnable saving/restoring state of ParallelMapDataset.
Saurabh Saxena [Tue, 16 Jan 2018 23:10:45 +0000 (15:10 -0800)]
Enable saving/restoring state of ParallelMapDataset.
Also actively reset input_impl_ when it is exhausted.

PiperOrigin-RevId: 182118637

7 years agoInternal Change
A. Unique TensorFlower [Tue, 16 Jan 2018 22:34:09 +0000 (14:34 -0800)]
Internal Change

PiperOrigin-RevId: 182112914

7 years agoExpose _log_and_record method to allow easier subclassing of StepCounter
Russell Power [Tue, 16 Jan 2018 22:29:15 +0000 (14:29 -0800)]
Expose _log_and_record method to allow easier subclassing of StepCounter

PiperOrigin-RevId: 182112167

7 years agoMake toco_convert work with int8 output.
A. Unique TensorFlower [Tue, 16 Jan 2018 22:27:01 +0000 (14:27 -0800)]
Make toco_convert work with int8 output.

PiperOrigin-RevId: 182111798

7 years agoAdd experimental `FunctionLibraryRuntime::InstantiateOptions::state_handle`.
Derek Murray [Tue, 16 Jan 2018 22:15:33 +0000 (14:15 -0800)]
Add experimental `FunctionLibraryRuntime::InstantiateOptions::state_handle`.

This new argument allows function instantiators to provide a unique
string that identifies the state that is associated with the
instantiated function (i.e. typically in stateful kernels).

PiperOrigin-RevId: 182110020

7 years agoDNN and Tree estimator doesn't work on GPUs. Tag the test for it to avoid running...
A. Unique TensorFlower [Tue, 16 Jan 2018 21:24:40 +0000 (13:24 -0800)]
DNN and Tree estimator doesn't work on GPUs. Tag the test for it to avoid running it with GPU config.

PiperOrigin-RevId: 182102413

7 years agoFully qualify string methods to avoid future conflicts with Abseil.
A. Unique TensorFlower [Tue, 16 Jan 2018 21:11:06 +0000 (13:11 -0800)]
Fully qualify string methods to avoid future conflicts with Abseil.

PiperOrigin-RevId: 182100616

7 years agoImproves the eager compatibility with tf.contrib.lookup.
Alexandre Passos [Tue, 16 Jan 2018 21:00:13 +0000 (13:00 -0800)]
Improves the eager compatibility with tf.contrib.lookup.

Fixes #16160

PiperOrigin-RevId: 182098964

7 years agoMake generated_examples_zip_test runnable on Android
Austin Anderson [Tue, 16 Jan 2018 20:57:03 +0000 (12:57 -0800)]
Make generated_examples_zip_test runnable on Android

PiperOrigin-RevId: 182098537

7 years agoAutomated g4 rollback of changelist 181553949
A. Unique TensorFlower [Tue, 16 Jan 2018 20:54:12 +0000 (12:54 -0800)]
Automated g4 rollback of changelist 181553949

PiperOrigin-RevId: 182098104

7 years ago[XLA] add ReduceWindow and SelectAndScatter to the local Python XLA client.
A. Unique TensorFlower [Tue, 16 Jan 2018 20:26:07 +0000 (12:26 -0800)]
[XLA] add ReduceWindow and SelectAndScatter to the local Python XLA client.

PiperOrigin-RevId: 182094260

7 years agoEnable the removal of redundant reshapes on fed models. Previously this was only...
Benoit Steiner [Tue, 16 Jan 2018 19:57:12 +0000 (11:57 -0800)]
Enable the removal of redundant reshapes on fed models. Previously this was only turned on by default for models without feed nodes.

PiperOrigin-RevId: 182090076

7 years agoRemove private Operation._input_dtypes alias.
Skye Wanderman-Milne [Tue, 16 Jan 2018 19:35:51 +0000 (11:35 -0800)]
Remove private Operation._input_dtypes alias.

This isn't necessary for anything, but it limits the surface area of
private API abuse.

PiperOrigin-RevId: 182086883

7 years agoHave _check_bazel_version_at_least compare versions as ints, not strings.
Sanjoy Das [Tue, 16 Jan 2018 19:27:45 +0000 (11:27 -0800)]
Have _check_bazel_version_at_least compare versions as ints, not strings.

This prevents issues like https://github.com/bazelbuild/bazel/issues/4425

PiperOrigin-RevId: 182085505

7 years agoUse multiple passes to improve memory since a single pass is often not enough.
Benoit Steiner [Tue, 16 Jan 2018 19:21:29 +0000 (11:21 -0800)]
Use multiple passes to improve memory since a single pass is often not enough.

PiperOrigin-RevId: 182084336

7 years agoInternal API to optionally compile a template's function into a graph function.
Akshay Agrawal [Tue, 16 Jan 2018 19:10:58 +0000 (11:10 -0800)]
Internal API to optionally compile a template's function into a graph function.

(1) Adds a function `make_template_internal` that takes an optional keyword
argument `create_graph_function_` that controls whether or not `func_` is
compiled into and executed as a graph function.

(2) Exposes `make_template_internal` as `tfe.make_template`, so users may
write something like
`
compiled = tfe.make_template("my_op", func, create_graph_function_=True)
`
to obtain a templatized version of func that is executed as a graph
function.

(3) Simplifies the implementation of (Eager)Template's _call_func and __call__
methods in a minor way.

PiperOrigin-RevId: 182082866

7 years agoMake TFLite iOS build scripts executable from anywhere.
Yu-Cheng Ling [Tue, 16 Jan 2018 18:59:43 +0000 (10:59 -0800)]
Make TFLite iOS build scripts executable from anywhere.

PiperOrigin-RevId: 182080904

7 years agoRestrict the type info analysis to avoid inference on objects created inside a contro...
A. Unique TensorFlower [Tue, 16 Jan 2018 18:07:41 +0000 (10:07 -0800)]
Restrict the type info analysis to avoid inference on objects created inside a control structure. The type of such object cannot be reliably inferred.

PiperOrigin-RevId: 182072568

7 years agoSwitch testing/... to use new test specification format
A. Unique TensorFlower [Tue, 16 Jan 2018 18:07:15 +0000 (10:07 -0800)]
Switch testing/... to use new test specification format

PiperOrigin-RevId: 182072485

7 years agoAdd one single target to bundle jar & so for TensorFlow Lite
A. Unique TensorFlower [Tue, 16 Jan 2018 18:03:00 +0000 (10:03 -0800)]
Add one single target to bundle jar & so for TensorFlow Lite

PiperOrigin-RevId: 182071549

7 years agoRemoving unused ops before applying other transformations to prevent cross input...
A. Unique TensorFlower [Tue, 16 Jan 2018 17:04:25 +0000 (09:04 -0800)]
Removing unused ops before applying other transformations to prevent cross input/output array optimizations.

PiperOrigin-RevId: 182063294

7 years agoBatchnorm returns a tuple, but when batchnorm partitioning was implemented tuple...
A. Unique TensorFlower [Tue, 16 Jan 2018 14:05:41 +0000 (06:05 -0800)]
Batchnorm returns a tuple, but when batchnorm partitioning was implemented tuple shardings were not.

PiperOrigin-RevId: 182043879

7 years agoFixes nccl_ops_test error introduced in CL 181736230.
A. Unique TensorFlower [Tue, 16 Jan 2018 13:15:00 +0000 (05:15 -0800)]
Fixes nccl_ops_test error introduced in CL 181736230.

PiperOrigin-RevId: 182039394

7 years agoDelete InputTypesTest in framework/ops_test.py
Skye Wanderman-Milne [Tue, 16 Jan 2018 07:34:10 +0000 (23:34 -0800)]
Delete InputTypesTest in framework/ops_test.py

_set_device now works with the C API enabled, so we no longer need
this explicit test coverage.

PiperOrigin-RevId: 182014804

7 years agoRaise error when unable to parse VariantTensorDataProto in BundleReader.
Saurabh Saxena [Tue, 16 Jan 2018 04:42:54 +0000 (20:42 -0800)]
Raise error when unable to parse VariantTensorDataProto in BundleReader.

PiperOrigin-RevId: 182007077

7 years ago[XLA] Remove RngBernoulli from the local Python XLA client.
Roy Frostig [Tue, 16 Jan 2018 04:09:01 +0000 (20:09 -0800)]
[XLA] Remove RngBernoulli from the local Python XLA client.

PiperOrigin-RevId: 182005780