Commit Graph

43677 Commits

Author SHA1 Message Date
Michael Case
ed2c7cdf01 Add tensorflow/python/platform/__init__.py for clearer error msg.
Without this init file, when trying to import tensorflow python code
from the source tree you get this error....

File "tensorflow/tensorflow/python/pywrap_tensorflow.py", line 25, in <module>
  from tensorflow.python.platform import self_check
ImportError: No module named platform

With this init file you get a much clearer error message telling you
not to do this...

File "tensorflow/tensorflow/python/pywrap_tensorflow.py", line 25, in <module>
  from tensorflow.python.platform import self_check
File "tensorflow/tensorflow/python/platform/self_check.py", line 27, in <module>
    raise ImportError("Could not import tensorflow. Do not import tensorflow "
ImportError: Could not import tensorflow. Do not import tensorflow from its source directory; change directory to outside the TensorFlow source tree, and relaunch your Python interpreter from there.
PiperOrigin-RevId: 221662931
2018-11-15 12:24:30 -08:00
Taylor Robie
79e73ee229 Move name argument to the end of the shape, size, and sparse.concat functions.
Add a rewrite rule for `sparse_concat` to `sparse.concat`.

PiperOrigin-RevId: 221662719
2018-11-15 12:20:30 -08:00
Dan Moldovan
87ca7af692 Break down the tests in optimizer_v2_test to work around the bug in inspect.getsource that manifests in windows builds.
PiperOrigin-RevId: 221662383
2018-11-15 12:14:44 -08:00
Dan Moldovan
24a06a1220 Add additional guidance for errors that can possibly be caused by buggy inspect.getsource.
PiperOrigin-RevId: 221661908
2018-11-15 12:05:35 -08:00
Justin Lebar
d936113449 Update documentation to reflect that XLA_FLAGS and TF_XLA_FLAGS are now split.
PiperOrigin-RevId: 221661379
2018-11-15 12:01:43 -08:00
Rohan Jain
af832feff7 Changing public feature column method imports to come from feature_column_lib rather than the base feature_column file. This enables better file management of the feature column repository.
PiperOrigin-RevId: 221661326
2018-11-15 11:57:49 -08:00
A. Unique TensorFlower
02d069baba Removes another potential noisy error message from gradient tape.
PiperOrigin-RevId: 221660789
2018-11-15 11:54:14 -08:00
Andiry Xu
4ea51ae99c Change _Send/_Recv attrs in VirtualScheduler
Change src_device_ to send_device and dst_device_ to recv_device. This complies
with tensorflow naming, so that VirtualScheduler can handle graphs generated
on inspectz with _Send/_Recv nodes and AutoGrappler does not need to remove
them.

PiperOrigin-RevId: 221660625
2018-11-15 11:49:00 -08:00
Frank Chen
dcf390ede4 Add abstract methods/properties to the base Cluster Resolver class.
Also fixes a bug in KubernetesClusterResolver.master() where we were not getting the attribute correctly and added a test for it.

PiperOrigin-RevId: 221660325
2018-11-15 11:43:50 -08:00
Francois Chollet
e0ef2053ac Fix and test issue with incorrect target shape assumption check.
PiperOrigin-RevId: 221660032
2018-11-15 11:38:44 -08:00
A. Unique TensorFlower
8aff5e540a Apply EIGEN_STRONG_INLINE to all tf_custom_op_library when --define=override_eigen_strong_inline=true
This avoids hitting  for tensorflow/contrib/rnn/kernels/lstm_ops.cc

PiperOrigin-RevId: 221657546
2018-11-15 11:31:10 -08:00
A. Unique TensorFlower
2e21bcf118 Avoid constant folding partial output of a node. It fixes issues . Its root cause is that tf only fold values but not indices when running TopK on GPU with dtype float. TopK generates different results on GPU and CPU.
PiperOrigin-RevId: 221657401
2018-11-15 11:27:56 -08:00
Amit Patankar
c7d57d435c Update the arguments for tf.nn.sufficient_statistics and exporting in v2. Renaming
'keep_dims' argument to 'keepdims'.

PiperOrigin-RevId: 221654843
2018-11-15 11:23:30 -08:00
TensorFlower Gardener
e500ab5f8b Merge pull request from zldrobit:patch-2
PiperOrigin-RevId: 221654513
2018-11-15 11:19:26 -08:00
Eugene Zhulenev
76d204f387 Keep side effectful ops in grappler function items
PiperOrigin-RevId: 221653198
2018-11-15 11:13:44 -08:00
Rohan Jain
1ffa8477eb Changing public feature column method imports to come from feature_column_lib rather than the base feature_column file. This enables better file management of the feature column repository.
PiperOrigin-RevId: 221652243
2018-11-15 11:10:28 -08:00
A. Unique TensorFlower
181b59b220 Fix SIGFPE when concatenating two "empty" ragged tensors.
PiperOrigin-RevId: 221652186
2018-11-15 11:06:06 -08:00
Rohan Jain
7ba1642f78 Changing public feature column method imports to come from feature_column_lib rather than the base feature_column file. This enables better file management of the feature column repository.
PiperOrigin-RevId: 221651041
2018-11-15 11:01:49 -08:00
Ayush Dubey
406591972c Make the API of tf.nn.fractional_*_pool ops consistent with other random ops.
Before this change, fractional_avg_pool and fractional_max_pool would take 3
randomness-related args: `seed`, `seed2`, and `deterministic`.  The intended
behavior was to get a deterministic execution if `deterministic` was true using
`seed` and `seed2`.

After this change, these ops take a single `seed` arg.  If `seed` is zero, the
execution is random.  Otherwise, we use the graph-level random ops to generate
seed and seed2 from `seed`, and pass that to the kernel with deterministic set
to True.

PiperOrigin-RevId: 221648311
2018-11-15 10:57:08 -08:00
Eugene Zhulenev
ffde93148d [Grappler] Remapper optimizer for Conv2D+FusedBatchNorm:
(1) Conv2D + FusedBatchNorm
 (2) Conv2D + FusedBatchNorm + Relu

PiperOrigin-RevId: 221646158
2018-11-15 10:49:47 -08:00
A. Unique TensorFlower
56e2c8224e Automated rollback of commit 82eb2d85c1
PiperOrigin-RevId: 221645406
2018-11-15 10:45:52 -08:00
A. Unique TensorFlower
73e3215c3a Apparently some users still haven't migrated to cuda 9. Fixes for them.
Automated rollback of commit 6f0f058bce

PiperOrigin-RevId: 221644777
2018-11-15 10:35:30 -08:00
Sanjoy Das
0e5e47022f Fix two bugs in IncreaseDynamismForAutoJitPass:
- We'd miscompile rewriteable slices that have other rewritable slices as
   input.  This was because we were caching the slice inputs from the first time
   we looked at a rewriteable Slice when a rewrite could have changed one of the
   inputs to that Slice.  Fix this by not caching SliceInputs.

 - We'd sometimes try to create (trivial) ConcatV2 nodes with one input, which
   isn't legal.  Fix this by not creating these trivial ConcatV2 nodes.

PiperOrigin-RevId: 221644004
2018-11-15 10:30:53 -08:00
Justin Lebar
829a53908b [XLA] Split XLA_FLAGS out from TF_XLA_FLAGS, and die if an unknown flag is passed.
PiperOrigin-RevId: 221640411
2018-11-15 10:01:05 -08:00
Amit Patankar
e68d8bb2f5 Update the arguments for tf.nn.separable_conv2d and exporting in v2. Renaming
'rate' argument to 'dilations'.

PiperOrigin-RevId: 221640289
2018-11-15 09:56:27 -08:00
Dan Moldovan
9771acf677 Break down function_test a bit more.
PiperOrigin-RevId: 221639302
2018-11-15 09:51:09 -08:00
Skye Wanderman-Milne
299469c1eb cond_v2: make FakeParam output tensor with correct size and device.
Allocating tensors of the expected size is necessary for adding them
to TensorLists in the case of cond_v2 nested in while_v2.

PiperOrigin-RevId: 221637330
2018-11-15 09:38:00 -08:00
Derek Murray
a302885171 Add the default worker name to AbortedError messages.
This should help track down which worker is "this worker" in "this worker has restarted" errors.

PiperOrigin-RevId: 221635865
2018-11-15 09:30:25 -08:00
A. Unique TensorFlower
82eb2d85c1 Automated rollback of commit 89fa3c5ed6
PiperOrigin-RevId: 221630636
2018-11-15 08:55:08 -08:00
Mihai Maruseac
ec5a704905 Add tests for ast_edits.
PiperOrigin-RevId: 221628173
2018-11-15 08:35:58 -08:00
Anna R
1696d69b07 Add a comment in tf_upgrade_v2.py to indicate order of arguments in
self.function_reorders should match old order as opposed to new order.

PiperOrigin-RevId: 221626603
2018-11-15 08:23:33 -08:00
TensorFlower Gardener
e922377470 Merge pull request from sby:tflite
PiperOrigin-RevId: 221624950
2018-11-15 08:10:16 -08:00
James Keeling
7705616378 Improve coverage of server_lib.cc testing
We add one more test method to cover the successful case. Testing now covers all lines except the LOG(ERROR) statement.

PiperOrigin-RevId: 221622246
2018-11-15 07:49:16 -08:00
A. Unique TensorFlower
5704cba577 Make DatasetV2 an abc again.
PiperOrigin-RevId: 221620796
2018-11-15 07:37:29 -08:00
Chris Jones
cfdfcc311c Rename ReplicaContext.replica_id to replica_id_in_sync_group.
PiperOrigin-RevId: 221602399
2018-11-15 04:31:11 -08:00
A. Unique TensorFlower
9a608da836 compat: Update forward compatibility horizon to 2018-11-15
PiperOrigin-RevId: 221581897
2018-11-15 01:07:35 -08:00
Yuefeng Zhou
fa5e5ecd88 Add make_input_fn_iterator method to distribution strategies which takes an input function and (will, in a following cl,) return an iterator object
Add InputContext class which will be an argument for input_fn to the `make_input_fn_iterator` method.

PiperOrigin-RevId: 221581165
2018-11-15 01:02:16 -08:00
Bixia Zheng
387a062dd3 [XLA:GPU] Miscellaneous clean up for 0-2-1 transpose related code.
We use the terms reduced shape and unreduced shape to refer to the logical
shapes and the original shapes of a 0-2-1 tranpose. Since reduced shape and
unreduced shape could also refer to the result shape and source shape of a
reduction operation, the purpose of this CL is mainly to change the 0-2-1
transpose related code outside reduction implementation to use the words
normalized/unnormalized instead of reduced/unreduced. The reduction
implementation will be fixed in another CL that migrates the implementation to
use the kernel mapping scheme.

PiperOrigin-RevId: 221575772
2018-11-15 00:02:02 -08:00
Derek Murray
8dd83e34a0 [tf.data] Add UnaryUnchangedStructureDataset.
This reduces the structure-handling boilerplate in `Dataset` implementations that have matching input and output structure.

PiperOrigin-RevId: 221569355
2018-11-14 22:27:22 -08:00
A. Unique TensorFlower
6f0f058bce Automated rollback of commit 1c2d515477
PiperOrigin-RevId: 221563772
2018-11-14 21:08:31 -08:00
Derek Murray
bf705e98d1 Avoid using offsetof in ValueAndTensorBuffer because it raises a warning before C++17.
Also define a class-specific placement deallocation function for `ValueAndTensorBuffer`, because some compilers warn if it is not present.

PiperOrigin-RevId: 221562487
2018-11-14 20:50:55 -08:00
Derek Murray
5b61eed600 [tf.data] Duplicate the internal Dataset class into DatasetV1 and DatasetV2.
The implementation of `tf.data.Dataset` now depends on the version of
TensorFlow: in 1.x we export `DatasetV1` and in 2.x we export `DatasetV2`.
Currently, the internal `dataset_ops.Dataset` symbol maps to `DatasetV1`, but
this will change after all internal tests are updated to 2.x compatibility.

This change also removes the deprecated `Dataset.from_sparse_tensor_slices()`
method from `DatasetV2`, since its replacement has long been available in
`Dataset.from_tensor_slices()`.

PiperOrigin-RevId: 221560852
2018-11-14 20:28:14 -08:00
Priya Gupta
35228fbf0c Use new enum ReduceOp for all callers of strategy.reduce. Also use it for loss reduction as well as OutputContext which were previously using VariableAggregation.
PiperOrigin-RevId: 221558489
2018-11-14 19:58:09 -08:00
RJ Ryan
ddfa238d6e Remove tf.signal's __init__.py.
An attempt to avoid conflicts with the Python standard library 'signal' module.

PiperOrigin-RevId: 221557063
2018-11-14 19:41:01 -08:00
Sanjoy Das
eedc97615c Split partially_decluster_pass.cc into two namespaces
This reflects the two reasons why we decluster nodes:

 - To reduce device to host copies
 - To reduce recompilations

I'm about to add a third so I thought this cleanup made sense.

PiperOrigin-RevId: 221553369
2018-11-14 18:59:37 -08:00
Ian Langmore
f18df6b5c3 Small updates to LinearOperatorComposition. Noticed while writing
LinearOperatorInversion.

PiperOrigin-RevId: 221553102
2018-11-14 18:55:48 -08:00
Anna R
8c41a3aa72 Change __init__.py file names under _api/v1 and _api/v2 to v1.py or v2.py. We
copy this file over to tensorflow/ directory. Basically, we have tensorflow/__init__.py and tensorflow/compat/<v1 or v2>/__init__.py which is the same file. This is both confusing and causes issues.

PiperOrigin-RevId: 221552254
2018-11-14 18:45:18 -08:00
Justin Lebar
010199ab1a [TF:XLA] Consolidate TF:XLA flags into a single file.
Preparation for rejecting unknown TF_XLA_FLAGS.

PiperOrigin-RevId: 221550561
2018-11-14 18:29:48 -08:00
A. Unique TensorFlower
2c3c2f47e2 Modify ShouldUseRunHandlerPool() to also be used when
session_inter_op_thread_pool() option is enabled in SessionConfig. Use it while
running session-run(s) on the default inter_op_thread_pool() = 0.

PiperOrigin-RevId: 221549960
2018-11-14 18:24:44 -08:00
A. Unique TensorFlower
f1e2b518e1 Add cholesky factorization to LinearOperator.
PiperOrigin-RevId: 221549742
2018-11-14 18:20:22 -08:00