platform/upstream/tensorflow.git
6 years agoFix formatting of MKL URLs
Justine Tunney [Wed, 4 Apr 2018 04:33:58 +0000 (21:33 -0700)]
Fix formatting of MKL URLs

The github.com was missing in the mirror.bazel.build path.

PiperOrigin-RevId: 191544461

6 years agoHelp build_pip_package work without ./configure
Justine Tunney [Wed, 4 Apr 2018 04:25:20 +0000 (21:25 -0700)]
Help build_pip_package work without ./configure

If the ./configure tool isn't run this script won't exist. It should
be safe to ignore this file if it isn't present since the variable
expansion below will just default to whatever python is on the PATH.

PiperOrigin-RevId: 191543995

6 years agoremoving an old TODO
Olivia Nordquist [Wed, 4 Apr 2018 03:28:58 +0000 (20:28 -0700)]
removing an old TODO

PiperOrigin-RevId: 191540512

6 years agoEnable calling the C API by default.
Skye Wanderman-Milne [Wed, 4 Apr 2018 02:29:53 +0000 (19:29 -0700)]
Enable calling the C API by default.

Enabling the C API makes TensorFlow's Python code to call the TensorFlow C API for low-level graph construction. This should cause no noticeable changes for the most part. One known difference is improved static shape inference, meaning some shape errors will be surfaced during graph construction instead of at runtime.

Note that this can be disabled by setting the environment variable TF_C_API_GRAPH_CONSTRUCTION=0 (for now, eventually this option will be removed).

PiperOrigin-RevId: 191536563

6 years ago[TF:XLA] Add half precision support to test_utils.
Bixia Zheng [Wed, 4 Apr 2018 02:20:44 +0000 (19:20 -0700)]
[TF:XLA] Add half precision support to test_utils.

PiperOrigin-RevId: 191535944

6 years agoAttach an id for each cost node in virtual_cluster.
Rui Zhao [Wed, 4 Apr 2018 01:49:53 +0000 (18:49 -0700)]
Attach an id for each cost node in virtual_cluster.

PiperOrigin-RevId: 191533511

6 years agoExtra logging to help debug shape inference logic in optimizers.
Max Galkin [Wed, 4 Apr 2018 01:47:46 +0000 (18:47 -0700)]
Extra logging to help debug shape inference logic in optimizers.

PiperOrigin-RevId: 191533338

6 years agoFix error message that was displaying wrong shape
A. Unique TensorFlower [Wed, 4 Apr 2018 01:16:54 +0000 (18:16 -0700)]
Fix error message that was displaying wrong shape

PiperOrigin-RevId: 191530602

6 years ago[XLA] Reshape mover should only transform a reshape/transpose instruction if
Bixia Zheng [Wed, 4 Apr 2018 01:08:21 +0000 (18:08 -0700)]
[XLA] Reshape mover should only transform a reshape/transpose instruction if
all the users of the instruction can be transformed.

This is because if only part of the users of a reshape/transpose instruction are
reshape-move transformed, the original reshape/transpose instruction can't be
eliminated while a modified clone copy of the instruction is added to support
the transformation. As a result, the transformation increases the number of
reshape/transpose instructions in the kerenel and can potentially increase
memory consumption.

Add two test cases.

PiperOrigin-RevId: 191529681

6 years agoFix bug where name generated by Graph::NewName can conflict with generated Send node...
Skye Wanderman-Milne [Wed, 4 Apr 2018 00:57:08 +0000 (17:57 -0700)]
Fix bug where name generated by Graph::NewName can conflict with generated Send node name.

I fixed this very locally to avoid having to fix a bunch of tests
(this is currently blocking enabling the C API), but this should be
fixed more generally in the future.

PiperOrigin-RevId: 191528409

6 years agoReplace trivial backend calls with calls to underlying TensorFlow functions - Part 1
Pavithra Vijay [Wed, 4 Apr 2018 00:56:14 +0000 (17:56 -0700)]
Replace trivial backend calls with calls to underlying TensorFlow functions - Part 1

PiperOrigin-RevId: 191528321

6 years agoFix a shape inference bug.
Benoit Steiner [Wed, 4 Apr 2018 00:52:53 +0000 (17:52 -0700)]
Fix a shape inference bug.

PiperOrigin-RevId: 191528009

6 years ago[TF:XLA] Add INTEL_MKL_ML MatMul method to XLA/CPU backend
Tony Wang [Wed, 4 Apr 2018 00:45:18 +0000 (17:45 -0700)]
[TF:XLA] Add INTEL_MKL_ML MatMul method to XLA/CPU backend

The INTEL GEMM API provides 32-bit and 64-bit MatMul. With INTEL_MKL flag set,
XLA backend emits runtime call to INTEL GEMM MatMul instead of Eigen.

PiperOrigin-RevId: 191527251

6 years agoAdd testcase for convert.
Jacques Pienaar [Wed, 4 Apr 2018 00:36:10 +0000 (17:36 -0700)]
Add testcase for convert.

PiperOrigin-RevId: 191526297

6 years agoRefactors the eager guide to be more researcher-friendly.
Alexandre Passos [Wed, 4 Apr 2018 00:35:54 +0000 (17:35 -0700)]
Refactors the eager guide to be more researcher-friendly.

 * Shows how to build layers
 * Orders the topics as they'd be ordered in a normal model

PiperOrigin-RevId: 191526275

6 years agoFix Conv3D shape inference.
Reed Wanderman-Milne [Wed, 4 Apr 2018 00:26:16 +0000 (17:26 -0700)]
Fix Conv3D shape inference.

Before, the stride rows and columns were mixed up, causing shape inference to output the wrong shape.

PiperOrigin-RevId: 191525254

6 years agoAdd max_constant_size_in_bytes parameter for ConstantFolding transform that sets...
A. Unique TensorFlower [Wed, 4 Apr 2018 00:08:57 +0000 (17:08 -0700)]
Add max_constant_size_in_bytes parameter for ConstantFolding transform that sets the maximum size of each created constant.

PiperOrigin-RevId: 191523208

6 years ago[XLA] Redesign: implement and test Send, Recv.
A. Unique TensorFlower [Wed, 4 Apr 2018 00:08:19 +0000 (17:08 -0700)]
[XLA] Redesign: implement and test Send, Recv.

PiperOrigin-RevId: 191523125

6 years ago[TF:XLA] Add test for scalar dynamic-update-slice.
A. Unique TensorFlower [Tue, 3 Apr 2018 23:56:25 +0000 (16:56 -0700)]
[TF:XLA] Add test for scalar dynamic-update-slice.

PiperOrigin-RevId: 191521429

6 years agoThis is a cosmetic change to logging, which makes it easier to understand this messag...
A. Unique TensorFlower [Tue, 3 Apr 2018 23:46:29 +0000 (16:46 -0700)]
This is a cosmetic change to logging, which makes it easier to understand this message when TPU nodes have a huge number of devices attached.

PiperOrigin-RevId: 191520116

6 years agoMinor touch-ups to the eager programming guide.
Akshay Agrawal [Tue, 3 Apr 2018 23:35:49 +0000 (16:35 -0700)]
Minor touch-ups to the eager programming guide.

PiperOrigin-RevId: 191518771

6 years agoFold more constants
Benoit Steiner [Tue, 3 Apr 2018 23:20:15 +0000 (16:20 -0700)]
Fold more constants

PiperOrigin-RevId: 191516861

6 years ago[TF]Disable memory sanitizer for compilation_passes_test while the problem is being
Bixia Zheng [Tue, 3 Apr 2018 23:18:19 +0000 (16:18 -0700)]
[TF]Disable memory sanitizer for compilation_passes_test while the problem is being

PiperOrigin-RevId: 191516643

6 years agoAdd forward_from_array to OpKernelContext::Params.
A. Unique TensorFlower [Tue, 3 Apr 2018 22:58:06 +0000 (15:58 -0700)]
Add forward_from_array to OpKernelContext::Params.

This is an optional reservation on the forwarding of a particular
input tensor to a particular output that will be used by future
optimizations.

PiperOrigin-RevId: 191513782

6 years agoAdd Group Normalization to tf.contrib.layers.
Jon Shlens [Tue, 3 Apr 2018 22:55:59 +0000 (15:55 -0700)]
Add Group Normalization to tf.contrib.layers.

# Example usage: NHWC
outputs = tf.contrib.layers.group_norm(inputs, groups=32, channels_axis=-1, reduction_axes=[-3, -2])
# Example usage: NCHW
outputs = tf.contrib.layers.group_norm(inputs, groups=32, channels_axis=-3, reduction_axes=[-2, -1])
PiperOrigin-RevId: 191513496

6 years agoAdd ability to pass symbolic tensors as inputs and targets in calls to Model training...
Francois Chollet [Tue, 3 Apr 2018 22:39:02 +0000 (15:39 -0700)]
Add ability to pass symbolic tensors as inputs and targets in calls to Model training and evaluation methods.

This also works for eager tensors, but due to a slicing behavior difference between eager tensors and Numpy arrays, we have to implement a workaround (with a performance cost).

PiperOrigin-RevId: 191511215

6 years agoCheckpointable: Utility to split a dependency for saving/loading
Allen Lavoie [Tue, 3 Apr 2018 22:28:27 +0000 (15:28 -0700)]
Checkpointable: Utility to split a dependency for saving/loading

Useful when a single op produces Tensors which should each be saved under
different objects (or when Tensors saved with many different objects need to be
restored together as inputs to a single op).

I plan to use this for cuDNN RNN saving, which currently relies heavily on name
matching to allow cuDNN cells to be swapped out for CPU-compatible RNN
cells. This change has just the utility and some tests for it.

PiperOrigin-RevId: 191509664

6 years agoAdd bfloat16 to GPU types.
Jacques Pienaar [Tue, 3 Apr 2018 22:25:16 +0000 (15:25 -0700)]
Add bfloat16 to GPU types.

PiperOrigin-RevId: 191509090

6 years agoRemove unused #includes
A. Unique TensorFlower [Tue, 3 Apr 2018 22:20:58 +0000 (15:20 -0700)]
Remove unused #includes

PiperOrigin-RevId: 191508478

6 years agoImplementing make_initializatable_iterator for the PrefetchToDeviceDataset.
Rohan Jain [Tue, 3 Apr 2018 22:08:51 +0000 (15:08 -0700)]
Implementing make_initializatable_iterator for the PrefetchToDeviceDataset.

PiperOrigin-RevId: 191506754

6 years agoAccept toco ModelFlags protos on the command line.
A. Unique TensorFlower [Tue, 3 Apr 2018 22:03:44 +0000 (15:03 -0700)]
Accept toco ModelFlags protos on the command line.

PiperOrigin-RevId: 191505886

6 years agoInternal change
A. Unique TensorFlower [Tue, 3 Apr 2018 22:01:09 +0000 (15:01 -0700)]
Internal change

PiperOrigin-RevId: 191505262

6 years ago[XLA] Redesign: implement and test dynamic slice.
A. Unique TensorFlower [Tue, 3 Apr 2018 21:42:31 +0000 (14:42 -0700)]
[XLA] Redesign: implement and test dynamic slice.

PiperOrigin-RevId: 191502312

6 years agoDisabled some tests on Windows
A. Unique TensorFlower [Tue, 3 Apr 2018 20:53:00 +0000 (13:53 -0700)]
Disabled some tests on Windows

PiperOrigin-RevId: 191494857

6 years agoUse double for arrays extra info min/max to match toco type.
A. Unique TensorFlower [Tue, 3 Apr 2018 20:43:05 +0000 (13:43 -0700)]
Use double for arrays extra info min/max to match toco type.

PiperOrigin-RevId: 191493450

6 years ago[XLA] Redesign: migrate slice_test.
A. Unique TensorFlower [Tue, 3 Apr 2018 20:28:37 +0000 (13:28 -0700)]
[XLA] Redesign: migrate slice_test.

PiperOrigin-RevId: 191491425

6 years agoOnly create a min/max from extra arrays info if provided.
A. Unique TensorFlower [Tue, 3 Apr 2018 19:40:51 +0000 (12:40 -0700)]
Only create a min/max from extra arrays info if provided.

PiperOrigin-RevId: 191484470

6 years agoUse PyLong_AsLongLong instead of PyInt_AsLong to guarantee 64-bit output.
Skye Wanderman-Milne [Tue, 3 Apr 2018 19:38:54 +0000 (12:38 -0700)]
Use PyLong_AsLongLong instead of PyInt_AsLong to guarantee 64-bit output.

A C long is 32 bits on some platforms, which can cause the
PyInt_AsLong call in PyInt64ListToVector to
overflow. large_concat_op_test exposes this bug on such platforms.

PiperOrigin-RevId: 191484167

6 years agoAdd convert f32 to s64 test.
Jacques Pienaar [Tue, 3 Apr 2018 18:52:23 +0000 (11:52 -0700)]
Add convert f32 to s64 test.

PiperOrigin-RevId: 191476199

6 years agoTurn no-op split/splitv operators into identity.
A. Unique TensorFlower [Tue, 3 Apr 2018 18:15:29 +0000 (11:15 -0700)]
Turn no-op split/splitv operators into identity.

PiperOrigin-RevId: 191469655

6 years agotf.map_fn: Improve error messaging when elems consists of scalars.
Asim Shankar [Tue, 3 Apr 2018 17:51:57 +0000 (10:51 -0700)]
tf.map_fn: Improve error messaging when elems consists of scalars.

Fixes #17694
Prior to this change, when tf.map_fn was provided with scalars, the error would
be something like:

Traceback (most recent call last):
  File "/tensorflow/python/kernel_tests/functional_ops_test.py", line 165, in testMapOverScalarErrors
    functional_ops.map_fn(lambda x: x, [1, 2])
  File "/tensorflow/python/ops/functional_ops.py", line 368, in map_fn
    n = elems_flat[0].shape[0].value or array_ops.shape(elems_flat[0])[0]
  File "/tensorflow/python/framework/tensor_shape.py", line 609, in __getitem__
    return self._dims[key]
IndexError: list index out of range
PiperOrigin-RevId: 191465183

6 years ago[TF:XLA] Add DT_HALF to the supported data types for the CPU and GPU devices.
Bixia Zheng [Tue, 3 Apr 2018 17:47:37 +0000 (10:47 -0700)]
[TF:XLA] Add DT_HALF to the supported data types for the CPU and GPU devices.

Add a test case to compilation_passes_test for DT_HALF data type.

PiperOrigin-RevId: 191464288

6 years agoThree operators are added that can be used to decrease the number of
A. Unique TensorFlower [Tue, 3 Apr 2018 17:35:00 +0000 (10:35 -0700)]
Three operators are added that can be used to decrease the number of
transpose/reshape occurences. These operators are:
- Swap elementwise
- Swap reshape-transpose
- Fuse transpose-reshape

Swap elementwise groups operations that operate on value, and move values. This
allows all movement operations (reshape, transpose, etc) to group at one
portion of the graph while value manipulations group on the other end.

Swap reshape/transpose finds cases where the reshape-transpose can be reorderd.
This allows the reshape-transpose-reshape case to be transformed to
transpose-reshape-reshape, which can then merge the reshape-reshape.

Finally the transpose-reshape merge allows cases where, when reshape maintains
the same dimensions and does not affect memory ordering, the transpose and
reshape can be merged into a single transpose operator.

PiperOrigin-RevId: 191462038

6 years agoAdd 8bit strided slice op to tflite
A. Unique TensorFlower [Tue, 3 Apr 2018 17:32:57 +0000 (10:32 -0700)]
Add 8bit strided slice op to tflite

PiperOrigin-RevId: 191461696

6 years agoDon't call context function either in the fastpath.
Akshay Modi [Tue, 3 Apr 2018 17:06:32 +0000 (10:06 -0700)]
Don't call context function either in the fastpath.

Also add a slowpath benchmark for identity.

PiperOrigin-RevId: 191457407

6 years agoApply "Raise exception in SWIG on bad TF_Status" to base.i
Akshay Modi [Tue, 3 Apr 2018 17:04:47 +0000 (10:04 -0700)]
Apply "Raise exception in SWIG on bad TF_Status" to base.i

Minor fixes to make this work.

PiperOrigin-RevId: 191457070

6 years ago[tf.data] Fix handling of nested structures in `tf.contrib.data.prefetch_to_device()`.
Derek Murray [Tue, 3 Apr 2018 17:00:02 +0000 (10:00 -0700)]
[tf.data] Fix handling of nested structures in `tf.contrib.data.prefetch_to_device()`.

PiperOrigin-RevId: 191456191

6 years agoBug Fix: If num_uses > 0 the the inputs tensor need not be a list but can be reshaped to
A. Unique TensorFlower [Tue, 3 Apr 2018 17:00:00 +0000 (10:00 -0700)]
Bug Fix: If num_uses > 0 the the inputs tensor need not be a list but can be reshaped to
[batch_size*num_uses, input_size]. `num_uses` should be incremented by one in this case.'

PiperOrigin-RevId: 191456184

6 years agoEnable C++ warnings on a few targets.
Shashi Shekhar [Tue, 3 Apr 2018 16:47:18 +0000 (09:47 -0700)]
Enable C++ warnings on a few targets.

PiperOrigin-RevId: 191454435

6 years agoMake batch_sequences_with_states_test.py work with the C API enabled, take 2.
Skye Wanderman-Milne [Tue, 3 Apr 2018 16:09:13 +0000 (09:09 -0700)]
Make batch_sequences_with_states_test.py work with the C API enabled, take 2.

It turns out the error can depend on what sequence comes first in the
input dict. This change internally sorts the input to make the error
predictable (this is useful for this test, as well as any users who
may run into this).

PiperOrigin-RevId: 191449214

6 years agocholesky_solve_with_broadcast, matrix_solve_with_broadcast and matrix_triangular_solv...
Ian Langmore [Tue, 3 Apr 2018 15:59:08 +0000 (08:59 -0700)]
cholesky_solve_with_broadcast, matrix_solve_with_broadcast and matrix_triangular_solve_with_broadcast added to linear_operator_util.py

PiperOrigin-RevId: 191447378

6 years agoChanges loss_reduction default to SUM_OVER_BATCH_SIZE for regression_head and poisson...
A. Unique TensorFlower [Tue, 3 Apr 2018 15:54:01 +0000 (08:54 -0700)]
Changes loss_reduction default to SUM_OVER_BATCH_SIZE for regression_head and poisson_regression_head.

PiperOrigin-RevId: 191446787

6 years ago[TF:XLA] Bump open source llvm revision to r329057
Benjamin Kramer [Tue, 3 Apr 2018 14:28:40 +0000 (07:28 -0700)]
[TF:XLA] Bump open source llvm revision to r329057

DataTypes.h is no longer a generated header. X86DisassemblerDecoderCommon.h is now part of :support.

PiperOrigin-RevId: 191438031

6 years agoUpdate LLVM API usage to match upstream change.
A. Unique TensorFlower [Tue, 3 Apr 2018 12:52:03 +0000 (05:52 -0700)]
Update LLVM API usage to match upstream change.

PiperOrigin-RevId: 191428965

6 years agoRemove "-lpthread" when building tests on macos.
Gunhan Gulsoy [Tue, 3 Apr 2018 08:01:16 +0000 (01:01 -0700)]
Remove "-lpthread" when building tests on macos.
In most cases it seems to be not used.

PiperOrigin-RevId: 191407383

6 years agoAutomated g4 rollback of changelist 191385909
Gunhan Gulsoy [Tue, 3 Apr 2018 06:44:24 +0000 (23:44 -0700)]
Automated g4 rollback of changelist 191385909

PiperOrigin-RevId: 191401933

6 years agoClarify OpDef.is_stateful flag definition
Igor Ganichev [Tue, 3 Apr 2018 05:24:14 +0000 (22:24 -0700)]
Clarify OpDef.is_stateful flag definition

PiperOrigin-RevId: 191396824

6 years agoRe-enable Gather and Slice estimators with output size check.
Max Galkin [Tue, 3 Apr 2018 04:03:06 +0000 (21:03 -0700)]
Re-enable Gather and Slice estimators with output size check.

PiperOrigin-RevId: 191391805

6 years agoBUG_FIX: Allow Uniform pdf to work on float64 inputs.
A. Unique TensorFlower [Tue, 3 Apr 2018 04:02:40 +0000 (21:02 -0700)]
BUG_FIX: Allow Uniform pdf to work on float64 inputs.
PiperOrigin-RevId: 191391778

6 years agoWindows: Enable tensorflow/contrib in Bazel build (Second try)
A. Unique TensorFlower [Tue, 3 Apr 2018 03:50:39 +0000 (20:50 -0700)]
Windows: Enable tensorflow/contrib in Bazel build (Second try)

This reverts commit 4e108ef30d7cd7ae5e1c550ec5ae27e79b8c6e39.

PiperOrigin-RevId: 191391075

6 years agoDeleted a special case
Benoit Steiner [Tue, 3 Apr 2018 02:32:45 +0000 (19:32 -0700)]
Deleted a special case

PiperOrigin-RevId: 191385909

6 years agoAutomated g4 rollback of changelist 191037166
Anna R [Tue, 3 Apr 2018 02:20:53 +0000 (19:20 -0700)]
Automated g4 rollback of changelist 191037166

PiperOrigin-RevId: 191385075

6 years agoAdd int64 to Variant mutable hash table variants.
A. Unique TensorFlower [Tue, 3 Apr 2018 01:33:11 +0000 (18:33 -0700)]
Add int64 to Variant mutable hash table variants.

PiperOrigin-RevId: 191380970

6 years ago[XLA] Redesign: migrate while_test to use XlaBuilder, and implement the ops needed...
A. Unique TensorFlower [Tue, 3 Apr 2018 01:18:11 +0000 (18:18 -0700)]
[XLA] Redesign: migrate while_test to use XlaBuilder, and implement the ops needed to pass the tests, including: While, Slice, DynamicUpdateSlice, Dot, DotGeneral, ConvertElementType, Rng, and Reduce.

Also, when a module has embedded computaitons, the service side would complain if the instruction names are not unique in the scope of the module. To ensure instruction names are unique in module, use both the computation id and instruction id as suffix.

PiperOrigin-RevId: 191379697

6 years agoDon't use session context manager when we need session to outlive the context block.
Skye Wanderman-Milne [Tue, 3 Apr 2018 00:50:12 +0000 (17:50 -0700)]
Don't use session context manager when we need session to outlive the context block.

PiperOrigin-RevId: 191376772

6 years agoInternal change.
Anna R [Tue, 3 Apr 2018 00:31:47 +0000 (17:31 -0700)]
Internal change.

PiperOrigin-RevId: 191374719

6 years agoTFTS: Add a OneShotPredictionHead with no model state in its serving signature.
Allen Lavoie [Tue, 3 Apr 2018 00:21:41 +0000 (17:21 -0700)]
TFTS: Add a OneShotPredictionHead with no model state in its serving signature.

PiperOrigin-RevId: 191373516

6 years ago[XLA] Redesign: implement ExecuteGraphParallel.
A. Unique TensorFlower [Tue, 3 Apr 2018 00:08:27 +0000 (17:08 -0700)]
[XLA] Redesign: implement ExecuteGraphParallel.

PiperOrigin-RevId: 191371793

6 years agoAdd a config option to run Grappler optimizers more than once.
A. Unique TensorFlower [Mon, 2 Apr 2018 23:45:16 +0000 (16:45 -0700)]
Add a config option to run Grappler optimizers more than once.
Don't crash in layout optimizer if no cluster is given.
Clean up Cluster::DisableOptimizer() so it actually turns all current optimizers off.

PiperOrigin-RevId: 191368433

6 years agoClarify ResourceVariable specification
Igor Ganichev [Mon, 2 Apr 2018 23:21:37 +0000 (16:21 -0700)]
Clarify ResourceVariable specification

PiperOrigin-RevId: 191365224

6 years agoJava: Update to 1.7.0
Asim Shankar [Mon, 2 Apr 2018 22:55:01 +0000 (15:55 -0700)]
Java: Update to 1.7.0

PiperOrigin-RevId: 191361364

6 years agoAutomated g4 rollback of changelist 191326767
Anna R [Mon, 2 Apr 2018 22:51:21 +0000 (15:51 -0700)]
Automated g4 rollback of changelist 191326767

PiperOrigin-RevId: 191360905

6 years agoAdd support for resource variables
Benoit Steiner [Mon, 2 Apr 2018 22:48:04 +0000 (15:48 -0700)]
Add support for resource variables

PiperOrigin-RevId: 191360477

6 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Mon, 2 Apr 2018 22:46:34 +0000 (15:46 -0700)]
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 191360220

6 years agoAdd tf.math.polyval that evaluates an element-wise polynomial using Horner's method...
A. Unique TensorFlower [Mon, 2 Apr 2018 22:39:35 +0000 (15:39 -0700)]
Add tf.math.polyval that evaluates an element-wise polynomial using Horner's method. This is equivalent to numpy.polyval.

PiperOrigin-RevId: 191359241

6 years ago[XLA] Set trace for the operand of a trace instruction when creating the instruction...
A. Unique TensorFlower [Mon, 2 Apr 2018 22:27:24 +0000 (15:27 -0700)]
[XLA] Set trace for the operand of a trace instruction when creating the instruction directly or creating from proto. Also implement XlaBuidler::Trace.

PiperOrigin-RevId: 191357376

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Mon, 2 Apr 2018 22:17:59 +0000 (15:17 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 191356007

6 years agoFix assertion error in Graph._create_op_from_tf_operation.
Skye Wanderman-Milne [Mon, 2 Apr 2018 22:00:40 +0000 (15:00 -0700)]
Fix assertion error in Graph._create_op_from_tf_operation.

_create_op_from_tf_operation would raise an assertion error if a node
was imported with the same name as an unused name_scope. This isn't
really an error, so this change removes the assert.

Note that with this change, the affected node will have a different
name with the C API enabled, but this seems ok especially considering
this is an edge case.

PiperOrigin-RevId: 191353116

6 years ago[TF] Copy-on-write for Resource Variant assign op.
Eugene Brevdo [Mon, 2 Apr 2018 21:48:21 +0000 (14:48 -0700)]
[TF] Copy-on-write for Resource Variant assign op.

PiperOrigin-RevId: 191351293

6 years agoReplaced calls to deprecated tensorflow::StringPiece methods with their
A. Unique TensorFlower [Mon, 2 Apr 2018 21:46:13 +0000 (14:46 -0700)]
Replaced calls to deprecated tensorflow::StringPiece methods with their
tensorflow::str_util equivalents.

This will allow the deprecated methods to be removed.

PiperOrigin-RevId: 191350894

6 years agoResourceHandleShapeAndType returns bytes, not unicode.
Skye Wanderman-Milne [Mon, 2 Apr 2018 21:40:37 +0000 (14:40 -0700)]
ResourceHandleShapeAndType returns bytes, not unicode.

This could cause failures when enabling the C API with python3.

PiperOrigin-RevId: 191350031

6 years agoExport "VERSION" as "__version__" as well
Anna R [Mon, 2 Apr 2018 21:19:42 +0000 (14:19 -0700)]
Export "VERSION" as "__version__" as well

PiperOrigin-RevId: 191346647

6 years agoExport the rest of If, While, and For.
Patrick Nguyen [Mon, 2 Apr 2018 21:03:53 +0000 (14:03 -0700)]
Export the rest of If, While, and For.

We keep _If and _While. This moves the tests and python generators.
The operators are not part of the public tensorflow API.

PiperOrigin-RevId: 191344237

6 years agoDon't bypass reshape nodes that anchor control dependencies
Benoit Steiner [Mon, 2 Apr 2018 20:53:52 +0000 (13:53 -0700)]
Don't bypass reshape nodes that anchor control dependencies

PiperOrigin-RevId: 191342646

6 years agoVerify that a %send and a %recv on the same channel, don't end up landing on the...
A. Unique TensorFlower [Mon, 2 Apr 2018 20:41:26 +0000 (13:41 -0700)]
Verify that a %send and a %recv on the same channel, don't end up landing on the same device.
Also verify that send/send-done and recv/recv-done are on the same device/module.

PiperOrigin-RevId: 191340724

6 years agoReduce overhead for eager ops
Akshay Modi [Mon, 2 Apr 2018 20:17:14 +0000 (13:17 -0700)]
Reduce overhead for eager ops

- Call _context_handle in the fastpath. Fall back to slow path if it is not
  initialized.
  A better fix would be to not initialize handle and devices lazily (and not
  have to pay that function call in the slow path either), but that
  seems to break all GPU/TPU tests. I'm not as yet really familiar with how
  devices are recognized, but I'd be happy to hear any ideas you may have to
  fix this.
- context.context() is monkey patched to remove the "is None" check once we
  know the context is correctly initialized. Ideally we would be able to remove
  this function call as well.
- Maintain is_eager instead of doing the comparison every time. Also, in the
  fastpath, inline the check directly instead of paying the function call cost.
- Inline _eager_context.device_name instead of get the device_name property to
  not pay the function call cost

gen_array_ops.identity Old: 216706.923837 examples/sec (4.61452722549)
gen_array_ops.identity New: 290819.129714 examples/sec (3.43856334686)

PiperOrigin-RevId: 191336857

6 years agoeager: Tweak error message.
Asim Shankar [Mon, 2 Apr 2018 19:58:52 +0000 (12:58 -0700)]
eager: Tweak error message.

Motivated by
https://stackoverflow.com/questions/49616532/a-tensorflow-eager-gpu-error/49617069

PiperOrigin-RevId: 191334050

6 years agoRewrite Add/AddN subgraph, minimizing number of required broadcasts.
A. Unique TensorFlower [Mon, 2 Apr 2018 19:41:59 +0000 (12:41 -0700)]
Rewrite Add/AddN subgraph, minimizing number of required broadcasts.

1) Collect to AddOpsGroup inputs of symbolically defined
   shapes, that can be broadcasted to the root shape
2) Rewrite equal shapes with AddN(s)
3) Build Add tree from aggegations of different shapes,
   minimizing the cost of broadcast

PiperOrigin-RevId: 191331566

6 years agoFix a bug in AvgPoolGrad op cost in extracting input x's shape. AvgPoolGrad
A. Unique TensorFlower [Mon, 2 Apr 2018 19:36:08 +0000 (12:36 -0700)]
Fix a bug in AvgPoolGrad op cost in extracting input x's shape. AvgPoolGrad
takes a shape tensor; hence, a value should be parsed from inputs(0) to extract
correct shape of x.

PiperOrigin-RevId: 191330762

6 years agoSwitch to the TensorFlow API generation based on ApiDef's and tf_export
Anna R [Mon, 2 Apr 2018 19:07:16 +0000 (12:07 -0700)]
Switch to the TensorFlow API generation based on ApiDef's and tf_export
decorators.

PiperOrigin-RevId: 191326767

6 years agoFix #18180
Asim Shankar [Mon, 2 Apr 2018 19:01:32 +0000 (12:01 -0700)]
Fix #18180

tf.size() was not respecting the `out_type` argument when eager execution was
enabled.

PiperOrigin-RevId: 191326039

6 years agoTFTS: Clean up the cold start SignatureDef.
Allen Lavoie [Mon, 2 Apr 2018 18:53:37 +0000 (11:53 -0700)]
TFTS: Clean up the cold start SignatureDef.

Removes state where it wasn't used.

PiperOrigin-RevId: 191324834

6 years ago[XLA] Redesign: improve error handling:
A. Unique TensorFlower [Mon, 2 Apr 2018 18:35:00 +0000 (11:35 -0700)]
[XLA] Redesign: improve error handling:
- For every op creation method, check whether there's any existing error, if so, don't do anything and returns an empty op. To do this efficiently, make the NoteErrorOrReturn method accept a lambda, and check first_error_ before evaluating the lambda.
- Return error instead of TF_CHECK_RET, because the second seems to always print ERROR logs.

PiperOrigin-RevId: 191322082

6 years agoSwitched to using TensorFlow's true dilated convolution support now that it is implem...
A. Unique TensorFlower [Mon, 2 Apr 2018 18:17:56 +0000 (11:17 -0700)]
Switched to using TensorFlow's true dilated convolution support now that it is implemented, and removed emulated dilated convolution support.

PiperOrigin-RevId: 191319505

6 years agoReplaced calls to deprecated tensorflow::StringPiece methods with their
A. Unique TensorFlower [Mon, 2 Apr 2018 18:03:18 +0000 (11:03 -0700)]
Replaced calls to deprecated tensorflow::StringPiece methods with their
tensorflow::str_util equivalents.

This will allow the deprecated methods to be removed.

PiperOrigin-RevId: 191316903

6 years agoImproves the documentation of control_dependencies.
Alexandre Passos [Mon, 2 Apr 2018 17:51:13 +0000 (10:51 -0700)]
Improves the documentation of control_dependencies.

PiperOrigin-RevId: 191314766

6 years agoReplaced calls to deprecated tensorflow::StringPiece methods with their
A. Unique TensorFlower [Mon, 2 Apr 2018 17:50:09 +0000 (10:50 -0700)]
Replaced calls to deprecated tensorflow::StringPiece methods with their
tensorflow::str_util equivalents.

This will allow the deprecated methods to be removed.

PiperOrigin-RevId: 191314576

6 years agoRemove reshape of sparse tensor indices in for maybe_batch.
A. Unique TensorFlower [Mon, 2 Apr 2018 17:27:12 +0000 (10:27 -0700)]
Remove reshape of sparse tensor indices in for maybe_batch.

PiperOrigin-RevId: 191310753

6 years agoAdditional arg scope test that demonstrate how nested arg_scope objects behave.
A. Unique TensorFlower [Mon, 2 Apr 2018 17:14:35 +0000 (10:14 -0700)]
Additional arg scope test that demonstrate how nested arg_scope objects behave.

PiperOrigin-RevId: 191308666

6 years agoAutomated g4 rollback of changelist 191127281
Sergio Guadarrama [Mon, 2 Apr 2018 16:49:35 +0000 (09:49 -0700)]
Automated g4 rollback of changelist 191127281

PiperOrigin-RevId: 191305220