platform/upstream/tensorflow.git
6 years agoAdd some python wrapper for TF_ApiDefMap.
A. Unique TensorFlower [Fri, 11 May 2018 21:24:47 +0000 (14:24 -0700)]
Add some python wrapper for TF_ApiDefMap.

PiperOrigin-RevId: 196308677

6 years agoMake the elemental ir emitter for dot operations respect contraction dims
Sanjoy Das [Fri, 11 May 2018 21:05:38 +0000 (14:05 -0700)]
Make the elemental ir emitter for dot operations respect contraction dims

PiperOrigin-RevId: 196305803

6 years agoAllow zero initializer by default for string variables (no reason not to)
Alexandre Passos [Fri, 11 May 2018 20:42:31 +0000 (13:42 -0700)]
Allow zero initializer by default for string variables (no reason not to)

PiperOrigin-RevId: 196302302

6 years agoReads the L2 and L3 cache sizes from the system instead of using hard-coded constants.
A. Unique TensorFlower [Fri, 11 May 2018 19:55:55 +0000 (12:55 -0700)]
Reads the L2 and L3 cache sizes from the system instead of using hard-coded constants.

PiperOrigin-RevId: 196296096

6 years agoUpdate HeapSimulator to use BufferValue.
Jeremy Lau [Fri, 11 May 2018 19:39:40 +0000 (12:39 -0700)]
Update HeapSimulator to use BufferValue.

PiperOrigin-RevId: 196293610

6 years agoChange default number of threads to 1.
Shashi Shekhar [Fri, 11 May 2018 19:36:40 +0000 (12:36 -0700)]
Change default number of threads to 1.

PiperOrigin-RevId: 196293227

6 years agoUpdating the descriptions for TensorFlow.
Amit Patankar [Fri, 11 May 2018 19:27:40 +0000 (12:27 -0700)]
Updating the descriptions for TensorFlow.

PiperOrigin-RevId: 196291844

6 years agoRELNOTES: This allows the use of '.' in variables (e.g. "hparams.parse('a.b=1.0'...
A. Unique TensorFlower [Fri, 11 May 2018 18:04:33 +0000 (11:04 -0700)]
RELNOTES: This allows the use of '.' in variables (e.g. "hparams.parse('a.b=1.0')"), which would previously raise an error. This will correspond to an attribute name with an embedded '.' symbol (e.g. 'a.b'), which can only be accessed indirectly (e.g. through getattr and setattr).  To set this up the user will first need to explicitly add the variable to the hparam object (e.g. "hparams.add_hparam(name='a.b', value=0.0)").

NOTE: the use of '.' in variable names is now allowed, but it is not recommended.
PiperOrigin-RevId: 196278660

6 years agoAllow communicating instructions within a kCall computation.
A. Unique TensorFlower [Fri, 11 May 2018 18:04:22 +0000 (11:04 -0700)]
Allow communicating instructions within a kCall computation.

PiperOrigin-RevId: 196278635

6 years ago[XLA] Fix a doc that still mentioned computation_builder.
A. Unique TensorFlower [Fri, 11 May 2018 18:01:30 +0000 (11:01 -0700)]
[XLA] Fix a doc that still mentioned computation_builder.

PiperOrigin-RevId: 196278086

6 years agoMove fn_args utility into core TensorFlow from Estimator.
Michael Case [Fri, 11 May 2018 17:58:17 +0000 (10:58 -0700)]
Move fn_args utility into core TensorFlow from Estimator.

Working on untangling TF/Estimator deps. Some core TF code depends on Estimator
by using the fn_args utility function within Estimator.

PiperOrigin-RevId: 196277612

6 years agoIntroduce ordered_inputs option to graph_matcher to allow simpler matching of commuta...
Suharsh Sivakumar [Fri, 11 May 2018 17:51:24 +0000 (10:51 -0700)]
Introduce ordered_inputs option to graph_matcher to allow simpler matching of commutative operations.

#18919

PiperOrigin-RevId: 196276502

6 years agoUse Identity instead of Snapshot when the graph does not contain ops that modify...
A. Unique TensorFlower [Fri, 11 May 2018 17:43:30 +0000 (10:43 -0700)]
Use Identity instead of Snapshot when the graph does not contain ops that modify their inputs.

PiperOrigin-RevId: 196275133

6 years ago[XLA] Redesign: delete ComputationBuilder.
A. Unique TensorFlower [Fri, 11 May 2018 17:42:50 +0000 (10:42 -0700)]
[XLA] Redesign: delete ComputationBuilder.

PiperOrigin-RevId: 196275032

6 years agoAdds code examples in public head methods.
A. Unique TensorFlower [Fri, 11 May 2018 17:25:02 +0000 (10:25 -0700)]
Adds code examples in public head methods.

PiperOrigin-RevId: 196272143

6 years agoArithmeticOptimizer assumes valid feeds in aggressive mode.
Jingyue Wu [Fri, 11 May 2018 16:27:13 +0000 (09:27 -0700)]
ArithmeticOptimizer assumes valid feeds in aggressive mode.

ArithmeticOptimizer depends heavily on shapes in some stages.

PiperOrigin-RevId: 196264319

6 years agoMake core:device_tracer private to core/BUILD.
A. Unique TensorFlower [Fri, 11 May 2018 14:51:14 +0000 (07:51 -0700)]
Make core:device_tracer private to core/BUILD.

PiperOrigin-RevId: 196254936

6 years agoAdd NNAPI 1.1 Div/Mul/Pad/Mean nodes.
A. Unique TensorFlower [Fri, 11 May 2018 11:33:38 +0000 (04:33 -0700)]
Add NNAPI 1.1 Div/Mul/Pad/Mean nodes.

PiperOrigin-RevId: 196240584

6 years agoFixing 'nothing to do' test in depthwise backward filter kernel for GPU.
A. Unique TensorFlower [Fri, 11 May 2018 09:39:15 +0000 (02:39 -0700)]
Fixing 'nothing to do' test in depthwise backward filter kernel for GPU.

PiperOrigin-RevId: 196233957

6 years agoRemove 'using' of dnn types in CudnnSupport implementation file.
A. Unique TensorFlower [Fri, 11 May 2018 09:38:54 +0000 (02:38 -0700)]
Remove 'using' of dnn types in CudnnSupport implementation file.

PiperOrigin-RevId: 196233933

6 years agoAdded eval_dir to Estimator so that user does not need to guess which directory conta...
Mustafa Ispir [Fri, 11 May 2018 05:46:15 +0000 (22:46 -0700)]
Added eval_dir to Estimator so that user does not need to guess which directory contains evaluation summaries.

PiperOrigin-RevId: 196218167

6 years agoAdd missing #include. tensorflow::FunctionDef only happens to be available in this...
A. Unique TensorFlower [Fri, 11 May 2018 05:34:52 +0000 (22:34 -0700)]
Add missing #include. tensorflow::FunctionDef only happens to be available in this header because it happens to be forward-declared in one of the other .proto.h headers, but it's not actually used there and will go away.

PiperOrigin-RevId: 196217574

6 years agoCorrect accidental code reversion.
A. Unique TensorFlower [Fri, 11 May 2018 05:05:13 +0000 (22:05 -0700)]
Correct accidental code reversion.

PiperOrigin-RevId: 196216176

6 years ago[XLA] Roll forward fix to use TF macro.
Chris Leary [Fri, 11 May 2018 04:15:35 +0000 (21:15 -0700)]
[XLA] Roll forward fix to use TF macro.

PiperOrigin-RevId: 196213299

6 years agoDisable flaky batch_dataset_op_test
Gunhan Gulsoy [Fri, 11 May 2018 03:55:55 +0000 (20:55 -0700)]
Disable flaky batch_dataset_op_test

PiperOrigin-RevId: 196212027

6 years ago[XLA] Break out literal comparisons from testonly target.
Chris Leary [Fri, 11 May 2018 03:10:34 +0000 (20:10 -0700)]
[XLA] Break out literal comparisons from testonly target.

Moves methods from LiteralTestUtil::* to Literal::* where they have nothing
to do with test infrastructure.

Pares down the "void" variants of the LiteralTestUtil methods and consolidates
to the version that return success/failure such that the values can be
EXPECT_TRUE / ASSERT_TRUE asserted in the caller test cases.

This way the literal comparison functionality can be used from cc_libraries
that are not test only / cc_binary.

PiperOrigin-RevId: 196209410

6 years ago[XLA:GPU] Remove unused Thunk::ShouldBlockFutureThunks function.
Justin Lebar [Fri, 11 May 2018 02:28:35 +0000 (19:28 -0700)]
[XLA:GPU] Remove unused Thunk::ShouldBlockFutureThunks function.

PiperOrigin-RevId: 196206896

6 years agoInternal change
Smit Hinsu [Fri, 11 May 2018 02:05:45 +0000 (19:05 -0700)]
Internal change

PiperOrigin-RevId: 196205436

6 years agoCheckpointable: Have RNN wrappers add their cells as dependencies
Allen Lavoie [Fri, 11 May 2018 01:28:24 +0000 (18:28 -0700)]
Checkpointable: Have RNN wrappers add their cells as dependencies

Also marks _SlimRNNCell as not checkpointable, and adds a more convenient way to tag such classes.

Ideally adding a wrapper around a cell wouldn't break a checkpoint. This could look like RNN cell wrappers inheriting the dependencies of the cell they're wrapping. Possible to add that later if there's demand, or users can just add a dependency on wrapper._cell in addition to/instead of the wrapper when modifying programs.

Fixes #19208.

PiperOrigin-RevId: 196202366

6 years agoA test fix on Windows.
Younghee Kwon [Fri, 11 May 2018 01:17:33 +0000 (18:17 -0700)]
A test fix on Windows.

PiperOrigin-RevId: 196201610

6 years agoPartial update of tf.keras to the Keras 2.1.6 API.
Francois Chollet [Fri, 11 May 2018 00:42:27 +0000 (17:42 -0700)]
Partial update of tf.keras to the Keras 2.1.6 API.

This covers the following features and associated unit tests:
- multi-output layer where `compute_output_mask` returns `None`.
- saving to, and loading from, an existing hdf5 file.
- `verbose` argument (1/0) in `evaluate_generator`.
- stateful metrics with generator methods.
- `data_format` argument in `Flatten`.
- `constants` argument in Bidirectional's `__call__`.

PiperOrigin-RevId: 196198134

6 years ago[TPU]: If the $TPU_NAME env var is set, fallback to that.
Brennan Saeta [Fri, 11 May 2018 00:32:40 +0000 (17:32 -0700)]
[TPU]: If the $TPU_NAME env var is set, fallback to that.

PiperOrigin-RevId: 196196939

6 years agoPipe through warm_start_from parameter
A. Unique TensorFlower [Fri, 11 May 2018 00:07:21 +0000 (17:07 -0700)]
Pipe through warm_start_from parameter

PiperOrigin-RevId: 196194069

6 years agoAdd a HLO evaluator test case for gather
Sanjoy Das [Fri, 11 May 2018 00:06:27 +0000 (17:06 -0700)]
Add a HLO evaluator test case for gather

PiperOrigin-RevId: 196193959

6 years agoFix some races detected by the analysis tool.
A. Unique TensorFlower [Thu, 10 May 2018 23:56:13 +0000 (16:56 -0700)]
Fix some races detected by the analysis tool.

collective_rma_distributed: Return WorkerInterface to cache
prior to invoking RecvFromPeer callback, instead of after.

broadcaster: put status_ updates inside mutex.
PiperOrigin-RevId: 196192631

6 years ago[XLA] Redesign: change the docs to describe the new interfaces. This change is simply...
A. Unique TensorFlower [Thu, 10 May 2018 23:34:09 +0000 (16:34 -0700)]
[XLA] Redesign: change the docs to describe the new interfaces. This change is simply about replacing keywords and formatting files.
- s/ComputationDataHandle/XlaOp/
- s/ComputationBuilder/XlaBuilder/
- s/\<Computation\>/XlaComputation/
- s/client\/computation\.h/client\/xla_client\/xla_computation\.h/
- s/client\/computation_builder\.h/client\/xla_client\/xla_builder\.h/

PiperOrigin-RevId: 196189890

6 years agoring_reducer.cc errata:
A. Unique TensorFlower [Thu, 10 May 2018 23:18:20 +0000 (16:18 -0700)]
ring_reducer.cc errata:
1. Block in the current (blockable) thread when pre-copying input to
output rather than continuing in the callback which cannot block.
2. Clear RingField array on exit to more promptly release Refs on
output tensor buffer.
3. Properly set the forward_from_array parameter in SubContext.

PiperOrigin-RevId: 196188047

6 years agoEnable support for crops in BatchToSpaceNd
A. Unique TensorFlower [Thu, 10 May 2018 23:09:00 +0000 (16:09 -0700)]
Enable support for crops in BatchToSpaceNd

PiperOrigin-RevId: 196186750

6 years agoExport GCS object statting streamz metrics. Fix the wrong #define Guard name in gcs_f...
Ruoxin Sang [Thu, 10 May 2018 22:56:54 +0000 (15:56 -0700)]
Export GCS object statting streamz metrics. Fix the wrong #define Guard name in gcs_file_system.h.

PiperOrigin-RevId: 196184962

6 years agoDo not differentiate integers in the eager backprop API.
Alexandre Passos [Thu, 10 May 2018 22:54:13 +0000 (15:54 -0700)]
Do not differentiate integers in the eager backprop API.

(with bugfix)

PiperOrigin-RevId: 196184587

6 years agoRemove cancelling pairs of transposes that are separated by a non-branching chain...
A. Unique TensorFlower [Thu, 10 May 2018 22:43:55 +0000 (15:43 -0700)]
Remove cancelling pairs of transposes that are separated by a non-branching chain of ops that preserve value, order, and shape. Off by default.

PiperOrigin-RevId: 196183111

6 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Thu, 10 May 2018 22:20:53 +0000 (15:20 -0700)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 196179875

6 years agoFix bug due to incorrect nesting of return statement in eager iterator evaluation.
Pavithra Vijay [Thu, 10 May 2018 22:20:37 +0000 (15:20 -0700)]
Fix bug due to incorrect nesting of return statement in eager iterator evaluation.

PiperOrigin-RevId: 196179837

6 years agoAdd Nearest Neighbor sampling to tf.image.crop_and_resize() op
A. Unique TensorFlower [Thu, 10 May 2018 22:06:52 +0000 (15:06 -0700)]
Add Nearest Neighbor sampling to tf.image.crop_and_resize() op
- Prevent smearing when crop resize integer labels
- Faster than Bilinear sampling

PiperOrigin-RevId: 196177762

6 years agoRemoved duplicate implementation of Select, updated quant support for
A. Unique TensorFlower [Thu, 10 May 2018 21:46:24 +0000 (14:46 -0700)]
Removed duplicate implementation of Select, updated quant support for
select.

PiperOrigin-RevId: 196174442

6 years agoAutomated g4 rollback of changelist 195899829
Akshay Modi [Thu, 10 May 2018 21:39:02 +0000 (14:39 -0700)]
Automated g4 rollback of changelist 195899829

PiperOrigin-RevId: 196173343

6 years agoReplace SymbolicGradientEnv with FunctionOptimizerContext.
A. Unique TensorFlower [Thu, 10 May 2018 21:34:37 +0000 (14:34 -0700)]
Replace SymbolicGradientEnv with FunctionOptimizerContext.

Do not construct FunctionLibraryDefinition twice.

PiperOrigin-RevId: 196172648

6 years agoEnable Model training/eval from generator in eager execution. Fixes #18287
Francois Chollet [Thu, 10 May 2018 21:27:40 +0000 (14:27 -0700)]
Enable Model training/eval from generator in eager execution. Fixes #18287

PiperOrigin-RevId: 196171525

6 years agoStarted work on a shape optimizer
Benoit Steiner [Thu, 10 May 2018 21:22:51 +0000 (14:22 -0700)]
Started work on a shape optimizer

PiperOrigin-RevId: 196170800

6 years agoIncrease size of test //third_party/tensorflow/contrib/distributions:distribution_tes...
A. Unique TensorFlower [Thu, 10 May 2018 20:56:34 +0000 (13:56 -0700)]
Increase size of test //third_party/tensorflow/contrib/distributions:distribution_test to avoid flaky timeouts

PiperOrigin-RevId: 196166582

6 years agoOptimizations to DepthwiseConv
A. Unique TensorFlower [Thu, 10 May 2018 20:53:29 +0000 (13:53 -0700)]
Optimizations to DepthwiseConv

PiperOrigin-RevId: 196166118

6 years agoAdd missing FlatSet::insert(Key&&) overload.
Justin Lebar [Thu, 10 May 2018 20:28:33 +0000 (13:28 -0700)]
Add missing FlatSet::insert(Key&&) overload.

PiperOrigin-RevId: 196162544

6 years agoFix a bug about getting arguments of partial functions.
A. Unique TensorFlower [Thu, 10 May 2018 19:46:29 +0000 (12:46 -0700)]
Fix a bug about getting arguments of partial functions.

PiperOrigin-RevId: 196157095

6 years agoMake FlatSet and FlatMap movable.
Justin Lebar [Thu, 10 May 2018 19:38:27 +0000 (12:38 -0700)]
Make FlatSet and FlatMap movable.

PiperOrigin-RevId: 196156010

6 years agoBUGFIX: correctly propagate dtype in distributions.special_math.
Joshua V. Dillon [Thu, 10 May 2018 19:38:21 +0000 (12:38 -0700)]
BUGFIX: correctly propagate dtype in distributions.special_math.

PiperOrigin-RevId: 196155994

6 years agoDT_TEXTREL set by -Wl,-z,notext is incompatible with indirect functions (IFUNC).
A. Unique TensorFlower [Thu, 10 May 2018 19:37:29 +0000 (12:37 -0700)]
DT_TEXTREL set by -Wl,-z,notext is incompatible with indirect functions (IFUNC).
NVFlex.o in cuda_9_0/lib64/libculibos.a has buggy .eh_frame, which overlaps with .rela.rodata R_X86_64_PC32 relocations and makes it not able to be linked with LLD.

PiperOrigin-RevId: 196155873

6 years agoBreak out node loop from ConstantFolding::SimplifyGraph.
Rob Sloan [Thu, 10 May 2018 19:28:29 +0000 (12:28 -0700)]
Break out node loop from ConstantFolding::SimplifyGraph.

PiperOrigin-RevId: 196154571

6 years agoMake sure default GPU context is used within CollectiveRemoteAccessLocal::MemCpyAsync
A. Unique TensorFlower [Thu, 10 May 2018 19:16:29 +0000 (12:16 -0700)]
Make sure default GPU context is used within CollectiveRemoteAccessLocal::MemCpyAsync
when not explicitly set.

PiperOrigin-RevId: 196152927

6 years agoImplementation of the unidirectional_sequence_rnn TFLite Op using the symmetric quant...
A. Unique TensorFlower [Thu, 10 May 2018 19:14:52 +0000 (12:14 -0700)]
Implementation of the unidirectional_sequence_rnn TFLite Op using the symmetric quantization.

PiperOrigin-RevId: 196152754

6 years agoUse distribution_util.arguments instead of locals. This fixes a bug in newer python...
A. Unique TensorFlower [Thu, 10 May 2018 18:57:20 +0000 (11:57 -0700)]
Use distribution_util.arguments instead of locals. This fixes a bug in newer python version
where locals is a dynamic list.

PiperOrigin-RevId: 196150149

6 years agoAdds BaseLineEstimator, which accepts a user-specified head.
A. Unique TensorFlower [Thu, 10 May 2018 18:54:00 +0000 (11:54 -0700)]
Adds BaseLineEstimator, which accepts a user-specified head.

PiperOrigin-RevId: 196149694

6 years agoAdds metric_class_ids argument in multi_label_head.
A. Unique TensorFlower [Thu, 10 May 2018 18:49:31 +0000 (11:49 -0700)]
Adds metric_class_ids argument in multi_label_head.

PiperOrigin-RevId: 196149006

6 years agoExtracts PartialAssocOpConstFolding into a method.
A. Unique TensorFlower [Thu, 10 May 2018 18:35:22 +0000 (11:35 -0700)]
Extracts PartialAssocOpConstFolding into a method.

PiperOrigin-RevId: 196146716

6 years agoOptimizations for broadcast add operator.
A. Unique TensorFlower [Thu, 10 May 2018 18:30:50 +0000 (11:30 -0700)]
Optimizations for broadcast add operator.

PiperOrigin-RevId: 196145896

6 years agoImplementation of the basic_rnn TFLite Op using the symmetric quantization.
A. Unique TensorFlower [Thu, 10 May 2018 18:22:20 +0000 (11:22 -0700)]
Implementation of the basic_rnn TFLite Op using the symmetric quantization.

PiperOrigin-RevId: 196144379

6 years agoTraverse through control dependencies.
Suharsh Sivakumar [Thu, 10 May 2018 17:58:11 +0000 (10:58 -0700)]
Traverse through control dependencies.

PiperOrigin-RevId: 196139886

6 years agoFix inaccurate docstring of Orthogonal initializer.
Francois Chollet [Thu, 10 May 2018 17:51:23 +0000 (10:51 -0700)]
Fix inaccurate docstring of Orthogonal initializer.

PiperOrigin-RevId: 196138675

6 years agoUpdate documentation of ServingInputReceiver when a non-dict is passed as argument.
A. Unique TensorFlower [Thu, 10 May 2018 17:49:20 +0000 (10:49 -0700)]
Update documentation of ServingInputReceiver when a non-dict is passed as argument.

PiperOrigin-RevId: 196138375

6 years agoRemoving expected softmax test failure and improving logging.
A. Unique TensorFlower [Thu, 10 May 2018 17:26:06 +0000 (10:26 -0700)]
Removing expected softmax test failure and improving logging.

PiperOrigin-RevId: 196134704

6 years agoRegister XLA device kernel for IdentityN op.
A. Unique TensorFlower [Thu, 10 May 2018 17:21:02 +0000 (10:21 -0700)]
Register XLA device kernel for IdentityN op.

PiperOrigin-RevId: 196133882

6 years agoIncrease shard count yet more for tensorflow/contrib/metrics:metric_ops_test to avoid...
A. Unique TensorFlower [Thu, 10 May 2018 16:50:54 +0000 (09:50 -0700)]
Increase shard count yet more for tensorflow/contrib/metrics:metric_ops_test to avoid flaky timeouts

PiperOrigin-RevId: 196129385

6 years agoAdd citation for TF-Slim.
Sergio Guadarrama [Thu, 10 May 2018 16:49:50 +0000 (09:49 -0700)]
Add citation for TF-Slim.

PiperOrigin-RevId: 196129248

6 years agoFor Estimators, SavedModels for multiple modes should be exported into the same
Karmel Allison [Thu, 10 May 2018 16:47:37 +0000 (09:47 -0700)]
For Estimators, SavedModels for multiple modes should be exported into the same
file.

PiperOrigin-RevId: 196128943

6 years agoAutomated g4 rollback of changelist 195878952
Asim Shankar [Thu, 10 May 2018 16:38:11 +0000 (09:38 -0700)]
Automated g4 rollback of changelist 195878952

PiperOrigin-RevId: 196127751

6 years agoAdd EvaluateNodes to tests: AddOpsRewrite_AddOpsOfIdenticalShape, AddOpsRewrite_Multi...
A. Unique TensorFlower [Thu, 10 May 2018 16:20:55 +0000 (09:20 -0700)]
Add EvaluateNodes to tests: AddOpsRewrite_AddOpsOfIdenticalShape, AddOpsRewrite_MultiplePasses, AddOpsRewrite_AddInputMultipleTimes, AddOpsRewrite_AddOpsOfSymbolicallyEqualShape, AddOpsRewrite_MinimizeBCast, AddOpsRewrite_MinimizeBCastWithSymbolicShapes, RemoveNegation, MinimizeBroadcasts_SimpleSwap, MinimizeBroadcasts_FlattenTallGraph, MinimizeBroadcasts_BuildTreeUp

PiperOrigin-RevId: 196125583

6 years agoSupport differing dimensions for strided_slice
Zhixian Yan [Thu, 10 May 2018 11:38:15 +0000 (04:38 -0700)]
Support differing dimensions for strided_slice

PiperOrigin-RevId: 196101232

6 years ago[XLA] Add log1p/expm1
David Majnemer [Thu, 10 May 2018 06:21:19 +0000 (23:21 -0700)]
[XLA] Add log1p/expm1

A new HLO seems prudent as it allows implementations to use fancy techniques to
compute accurate results for small inputs.

PiperOrigin-RevId: 196078115

6 years agoIncrease size of test tensorflow/contrib/learn:graph_io_test to medium to avoid flaky...
A. Unique TensorFlower [Thu, 10 May 2018 03:32:13 +0000 (20:32 -0700)]
Increase size of test tensorflow/contrib/learn:graph_io_test to medium to avoid flaky timeouts

PiperOrigin-RevId: 196068593

6 years agoDon't call into Eigen unless the input and output tensors are aligned
Sanjoy Das [Thu, 10 May 2018 02:39:58 +0000 (19:39 -0700)]
Don't call into Eigen unless the input and output tensors are aligned

We teach TargetMachineFeatures about the alignment required for Eigen GEMM and
Conv and then pipe TargetMachineFeatures through the places that need to decide
whether a dot or a conv needs to be lowered to a call to Eigen.

I also had to fix a minor bug in our LLVM IR implementation for convolution.

PiperOrigin-RevId: 196065557

6 years agoPartial update of tf.keras to the Keras 2.1.6 API.
Pavithra Vijay [Thu, 10 May 2018 01:51:06 +0000 (18:51 -0700)]
Partial update of tf.keras to the Keras 2.1.6 API.

Changes included are:
- Update docs on preprocessing image and text.
- Allow shift_range to be 1-D array-like or int in ImageDataGenerator.
- Add a test for image preprocessing function for flow_from_directory.
- Fix for off by one error in TimeSeriesGenerator.
- Correct tokenization with multi-character `split` in text_to_word_sequence.

PiperOrigin-RevId: 196062625

6 years agoImplement sin operator
A. Unique TensorFlower [Thu, 10 May 2018 01:45:13 +0000 (18:45 -0700)]
Implement sin operator

PiperOrigin-RevId: 196062186

6 years agoIncrease shard count for //third_party/tensorflow/contrib/learn:kmeans_test to avoid...
A. Unique TensorFlower [Thu, 10 May 2018 01:35:50 +0000 (18:35 -0700)]
Increase shard count for //third_party/tensorflow/contrib/learn:kmeans_test to avoid flaky timeouts

PiperOrigin-RevId: 196061508

6 years agoIncrease size of test tensorflow/contrib/distributions:mvn_tril_test to medium to...
A. Unique TensorFlower [Thu, 10 May 2018 01:14:41 +0000 (18:14 -0700)]
Increase size of test tensorflow/contrib/distributions:mvn_tril_test to medium to avoid flaky timeouts

PiperOrigin-RevId: 196059863

6 years ago[TF:XLA] Speed up HLO CSE.
A. Unique TensorFlower [Thu, 10 May 2018 00:41:58 +0000 (17:41 -0700)]
[TF:XLA] Speed up HLO CSE.

Use a hash set to find equivalent instructions. This avoids worst-case n^2
instruction comparisons. Instead of checking all users of operand(0) for equivalent instructions, do a lookup in a hash set.

PiperOrigin-RevId: 196056689

6 years agoClarify error message.
Adam Roberts [Thu, 10 May 2018 00:38:41 +0000 (17:38 -0700)]
Clarify error message.

PiperOrigin-RevId: 196056372

6 years agoFix FreezeSavedModel to handle traversal of operations with multiple outputs.
Suharsh Sivakumar [Thu, 10 May 2018 00:30:30 +0000 (17:30 -0700)]
Fix FreezeSavedModel to handle traversal of operations with multiple outputs.

PiperOrigin-RevId: 196055377

6 years agoImprove error status message in scoped_allocator_ops.cc.
A. Unique TensorFlower [Wed, 9 May 2018 23:58:54 +0000 (16:58 -0700)]
Improve error status message in scoped_allocator_ops.cc.

PiperOrigin-RevId: 196051520

6 years ago[XLA] Make hlo deserialization stable for HloModule by sorting by ids when creating...
A. Unique TensorFlower [Wed, 9 May 2018 23:40:03 +0000 (16:40 -0700)]
[XLA] Make hlo deserialization stable for HloModule by sorting by ids when creating from proto.

Also, delete the HloModule parameter HloInstruction::CreateFromProto, it's not used anywhere.

Also, in ToProto, set sharding to proto if there is sharding.

PiperOrigin-RevId: 196049173

6 years agoIncrease shard count for tensorflow/contrib/distributions:vector_diffeomixture_test...
A. Unique TensorFlower [Wed, 9 May 2018 23:18:45 +0000 (16:18 -0700)]
Increase shard count for tensorflow/contrib/distributions:vector_diffeomixture_test to avoid flaky timeouts

PiperOrigin-RevId: 196046333

6 years agoAdd missing update of node map in the Mul(x,x) => Square(x) rewrite. This is what...
A. Unique TensorFlower [Wed, 9 May 2018 22:58:28 +0000 (15:58 -0700)]
Add missing update of node map in the Mul(x,x) => Square(x) rewrite. This is what caused a failure in //photos/vision/object_detection/ranking:brain_embedder_test when the concat/split hoisting was enabled.

PiperOrigin-RevId: 196043455

6 years agoSupport saving Python state with object-based checkpoints
Allen Lavoie [Wed, 9 May 2018 22:56:43 +0000 (15:56 -0700)]
Support saving Python state with object-based checkpoints

Allows SaveableObjects to specify feed dict addition callbacks for object-based saving.

For now just saves get_config() with Layers. Doesn't do any loading, and there isn't quite enough information to reconstruct a Model yet (needs topology).

My plan is to get Models to the point where they can be reconstructed from object-based checkpoints (probably one more change), add in SavedModel export (assuming no dynamic control flow for now), then add this "SavedModel+Python" format to Model.save / load_model.

PiperOrigin-RevId: 196043183

6 years agoAllowing trivial passthrough ops to be turned into reshapes when they otherwise canno...
A. Unique TensorFlower [Wed, 9 May 2018 22:44:13 +0000 (15:44 -0700)]
Allowing trivial passthrough ops to be turned into reshapes when they otherwise cannot be removed.

PiperOrigin-RevId: 196041444

6 years agoFix bug in which the ConvLSTM2D layer could not be cloned.
Francois Chollet [Wed, 9 May 2018 22:36:34 +0000 (15:36 -0700)]
Fix bug in which the ConvLSTM2D layer could not be cloned.

PiperOrigin-RevId: 196040413

6 years agoAdd option to set more generic module name filter for API generation.
Michael Case [Wed, 9 May 2018 22:07:40 +0000 (15:07 -0700)]
Add option to set more generic module name filter for API generation.

PiperOrigin-RevId: 196036164

6 years agoRun tensorflow/python/kernel_tests:conv2d_backprop_filter_grad_test only when omptimz...
A. Unique TensorFlower [Wed, 9 May 2018 21:41:23 +0000 (14:41 -0700)]
Run tensorflow/python/kernel_tests:conv2d_backprop_filter_grad_test only when omptimzing to avoid flaky timeouts

PiperOrigin-RevId: 196031762

6 years ago[XLA] Allow HloInstructionMap and HloInstructionSet to contain null keys.
A. Unique TensorFlower [Wed, 9 May 2018 21:20:39 +0000 (14:20 -0700)]
[XLA] Allow HloInstructionMap and HloInstructionSet to contain null keys.

Null HloInstruction* keys may be useful for representing sentinel values.

PiperOrigin-RevId: 196028425

6 years agoUse easy_install for pip installation for RBE images.
A. Unique TensorFlower [Wed, 9 May 2018 21:14:48 +0000 (14:14 -0700)]
Use easy_install for pip installation for RBE images.

We will remove python-pip deb packages from rbe-{debian8, ubuntu16_04}:
  https://github.com/bazelbuild/bazel-toolchains/pull/46
So that we don't we have pip install by deb packages and Python's own package system (and they conflict with each other)

We only install pip by easy_install.

PiperOrigin-RevId: 196027421

6 years agoFix default direction to left when almost no sparsity for a sparse inequality split.
A. Unique TensorFlower [Wed, 9 May 2018 21:07:17 +0000 (14:07 -0700)]
Fix default direction to left when almost no sparsity for a sparse inequality split.

PiperOrigin-RevId: 196026149

6 years agoInternal change.
Anna R [Wed, 9 May 2018 20:55:47 +0000 (13:55 -0700)]
Internal change.

PiperOrigin-RevId: 196024130

6 years agoWhen using static_state_saving_rnn(..) in the following manner
A. Unique TensorFlower [Wed, 9 May 2018 20:55:20 +0000 (13:55 -0700)]
When using static_state_saving_rnn(..) in the following manner

    _, state = tf.nn.static_state_saving_rnn(..)

the runtime will be blocked after some time, because the save_state method of the state_saver object won't be executed as a part of the graph (that part depends only on output node in the current implementation).
Now it should depend on state as well, so the above implementation won't be blocked.

PiperOrigin-RevId: 196024050