platform/upstream/tensorflow.git
6 years agoRemove duplicate imports in several places
Yong Tang [Tue, 17 Apr 2018 21:33:27 +0000 (21:33 +0000)]
Remove duplicate imports in several places

Wrote a script to scan throught the python files in the repo,
and found the remaining duplicate imports in some python files like:
```
 from tensorflow.python.ops import random_ops
-from tensorflow.python.ops import random_ops
 from tensorflow.python.util.deprecation import deprecated
```
This fix removed all of them for duplicate imports.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoMerge pull request #18504 from akshaym/eager-custom-ops
Akshay Modi [Tue, 17 Apr 2018 21:40:32 +0000 (14:40 -0700)]
Merge pull request #18504 from akshaym/eager-custom-ops

Use eager compatible wrappers in load_library for custom ops

6 years agoMerge pull request #18614 from yongtang/04172018-duplicate-import
Martin Wicke [Tue, 17 Apr 2018 21:14:41 +0000 (14:14 -0700)]
Merge pull request #18614 from yongtang/04172018-duplicate-import

Remove duplicate import in compat.py

6 years agoMerge pull request #18561 from yongtang/18529-doc-cast
Martin Wicke [Tue, 17 Apr 2018 20:34:33 +0000 (13:34 -0700)]
Merge pull request #18561 from yongtang/18529-doc-cast

Update docs for tf.cast with supported types

6 years agoMerge pull request #18563 from yongtang/04162018-gemmlowp
Martin Wicke [Tue, 17 Apr 2018 20:33:05 +0000 (13:33 -0700)]
Merge pull request #18563 from yongtang/04162018-gemmlowp

Update gemmlowp version for cmake build

6 years agoMerge pull request #17562 from giuscri/typo
Martin Wicke [Tue, 17 Apr 2018 20:18:06 +0000 (13:18 -0700)]
Merge pull request #17562 from giuscri/typo

Fix markdown error in layers tutorial.

6 years agoMerge pull request #17512 from imsheridan/fix_broken_link_graph
Martin Wicke [Tue, 17 Apr 2018 20:17:41 +0000 (13:17 -0700)]
Merge pull request #17512 from imsheridan/fix_broken_link_graph

Fix broken link of distributed in graphs.md

6 years agoMerge pull request #17395 from facaiy/ENH/adamax_optimizer
annarev [Tue, 17 Apr 2018 19:54:30 +0000 (12:54 -0700)]
Merge pull request #17395 from facaiy/ENH/adamax_optimizer

add AdaMax optimizer

6 years agoDuplicate imports in histogram_ops.py
Yong Tang [Tue, 17 Apr 2018 19:48:42 +0000 (19:48 +0000)]
Duplicate imports in histogram_ops.py

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoRemove duplicate import in compat.py
Yong Tang [Tue, 17 Apr 2018 19:47:25 +0000 (19:47 +0000)]
Remove duplicate import in compat.py

Noticed there are a couple of places in compat.py that
have duplicate import:
```
from tensorflow.python.util.tf_export import tf_export
from tensorflow.python.util.tf_export import tf_export
```

This fix remove duplicate imports.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoComplement cmake script to compile tensorflow with mkl and mkldnn on Windows (#16936)
Tang, Wenyi [Tue, 17 Apr 2018 19:17:48 +0000 (03:17 +0800)]
Complement cmake script to compile tensorflow with mkl and mkldnn on Windows (#16936)

* Add build batch for windows

* Automaticaly find python, cuda, mkl runtimes in PATH

* auto select cmake generator

* Add external library mkldnn. Add options for mkl and mkldnn

* fix syntax error in make.bat

* Fix errorlevel syntex bug in make.bat

* Add /arch:avx2 flags to enable avx2 on windows

* Revert to keep `tensprflow_WIN_CPU_SIMD_OPTIONS` unchanged, add an option `tensorflow_ENABLE_MKL_SUPPORT` to include MKL compilation. Still specify SIMD flags by setting `tensorflow_WIN_CPU_SIMD_OPTIONS` to such as '/arch:AVX2'

* Fix a mistake of CUDA path in make.bat

* resolve conflict in mkl_cpu_allocator.h

* Improve error detection

* Use where /Q to detect cmd environment

* fix "ELSE IF" the syntax error in make.bat

* update README.md, wrap windows based codes by #ifdef _WIN32

* unistd.h is not needed in mkl_cpu_allocator.h any more in master branch

* Remove inline of kMaxLimitStr, which causes compile error in VS2015

* Add static_cast in  to fix compile error

* remove make.bat

* Removed make.bat description part

6 years agoMerge pull request #18601 from yongtang/18598-tf.compat.as_str
Martin Wicke [Tue, 17 Apr 2018 18:54:48 +0000 (11:54 -0700)]
Merge pull request #18601 from yongtang/18598-tf.compat.as_str

Fix tf.compat.as_str returns bytes issue in Python 3

6 years agoMerge pull request #18581 from ManHyuk/fix_typo
Martin Wicke [Tue, 17 Apr 2018 18:52:39 +0000 (11:52 -0700)]
Merge pull request #18581 from ManHyuk/fix_typo

Fix typo

6 years agoEnable consumption of GIT_TAG_OVERRIDE env var in release build script. (#18579)
Yifei Feng [Tue, 17 Apr 2018 17:53:07 +0000 (10:53 -0700)]
Enable consumption of GIT_TAG_OVERRIDE env var in release build script. (#18579)

Enable consumption of GIT_TAG_OVERRIDE env var in release build script.

6 years agoPylint fix
Yong Tang [Tue, 17 Apr 2018 16:15:20 +0000 (16:15 +0000)]
Pylint fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoRemoved unnneded tf_export
Yong Tang [Tue, 17 Apr 2018 16:14:50 +0000 (16:14 +0000)]
Removed unnneded tf_export

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoFix tf.compat.as_str returns bytes issue in Python 3
Yong Tang [Tue, 17 Apr 2018 16:10:27 +0000 (16:10 +0000)]
Fix tf.compat.as_str returns bytes issue in Python 3

This fix tries to address the issue raised in 18598 where
tf.compat.as_str returns bytes (vs. str) in Python 3.
The issue was that `tf_export` decorator:
```
@tf_export('compat.as_bytes', 'compat.as_str')
```
could not be assigned to `as_bytes` or `as_text`
based on python 2 or 3.
This fix invokes tf_export explicitly based on `_six.PY2`
(for python 2/3) so that `as_str` calls `as_bytes` or `as_text`
conditionally.

This fix fixes 18598.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agofix typo
manhyuk [Tue, 17 Apr 2018 01:52:16 +0000 (10:52 +0900)]
fix typo

6 years agofix typo
manhyuk [Tue, 17 Apr 2018 01:48:52 +0000 (10:48 +0900)]
fix typo

6 years agofix typo
manhyuk [Tue, 17 Apr 2018 01:46:37 +0000 (10:46 +0900)]
fix typo

6 years agoMerge pull request #18575 from miaout17/fix-fft
Martin Wicke [Tue, 17 Apr 2018 00:00:03 +0000 (17:00 -0700)]
Merge pull request #18575 from miaout17/fix-fft

Fix TFLite Makefile FFT2D dependency.

6 years agoMerge pull request #17443 from yongtang/16263-softmax_cross_entropy-doc
Martin Wicke [Mon, 16 Apr 2018 23:30:50 +0000 (16:30 -0700)]
Merge pull request #17443 from yongtang/16263-softmax_cross_entropy-doc

Update the documentation of `softmax_cross_entropy`

6 years agoMerge branch 'master' into typo
Mark Daoust [Mon, 16 Apr 2018 22:56:41 +0000 (15:56 -0700)]
Merge branch 'master' into typo

6 years agoCurly-brace id's are inconsistently supported.
Mark Daoust [Mon, 16 Apr 2018 22:53:08 +0000 (15:53 -0700)]
Curly-brace id's are inconsistently supported.

Curly-brace id's are inconsistently supported.
linking to the id of an html tag seems to be supported everywhere.

6 years agoFix TFLite Makefile FFT2D dependency.
Yu-Cheng Ling [Mon, 16 Apr 2018 22:34:50 +0000 (15:34 -0700)]
Fix TFLite Makefile FFT2D dependency.

FFT2D dependency was introduced a while ago so Makefile no longer works
until this fix.

6 years agoFix lite and makefile issue
Yong Tang [Mon, 16 Apr 2018 21:34:38 +0000 (21:34 +0000)]
Fix lite and makefile issue

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoMerge pull request #18558 from imsheridan/fix_argmax_dimension
Martin Wicke [Mon, 16 Apr 2018 21:28:00 +0000 (14:28 -0700)]
Merge pull request #18558 from imsheridan/fix_argmax_dimension

Fix tf.argmax warnings on dimension argument by using axis instead

6 years agoMerge pull request #18547 from imsheridan/fix_deprecated_softmax
Martin Wicke [Mon, 16 Apr 2018 21:27:48 +0000 (14:27 -0700)]
Merge pull request #18547 from imsheridan/fix_deprecated_softmax

Fix the doc strings of nn.sampled_softmax_loss since it was deprecated

6 years agoMerge pull request #18570 from yongtang/18106-Bahdanau-normalized-dtype
Martin Wicke [Mon, 16 Apr 2018 21:25:16 +0000 (14:25 -0700)]
Merge pull request #18570 from yongtang/18106-Bahdanau-normalized-dtype

Fix the issue with Bahdanau attention when normalized=True and dtype = float16/32

6 years agoUpdate bazel
Yong Tang [Mon, 16 Apr 2018 20:16:06 +0000 (20:16 +0000)]
Update bazel

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoMerge pull request #18562 from yongtang/04152018-png
Martin Wicke [Mon, 16 Apr 2018 20:48:33 +0000 (13:48 -0700)]
Merge pull request #18562 from yongtang/04152018-png

Update libpng to v1.6.34 for cmake build

6 years agoAdd gemmlowp to whitelist
Yong Tang [Mon, 16 Apr 2018 20:02:46 +0000 (20:02 +0000)]
Add gemmlowp to whitelist

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoTemporary comment out mirror.bazel.build for gemmlowp
Yong Tang [Mon, 16 Apr 2018 19:40:43 +0000 (19:40 +0000)]
Temporary comment out mirror.bazel.build for gemmlowp

Will reenable once the mirror is propagated.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoUpdate gemmlowp on bazel to sync cmake changes
Yong Tang [Mon, 16 Apr 2018 19:25:05 +0000 (19:25 +0000)]
Update gemmlowp on bazel to sync cmake changes

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoUpdate gemmlowp version for cmake build
Yong Tang [Mon, 16 Apr 2018 16:27:50 +0000 (16:27 +0000)]
Update gemmlowp version for cmake build

The gemmlowp has been updated in bazel, though
cmake version was not updated. This fix updates
gemmlowp in cmake so that cmake and bazel versions
are synced.

The fix has been tested on Linux:
```
tensorflow/tools/ci_build/ci_build.sh CMAKE tensorflow/tools/ci_build/builds/cmake.sh
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoFix pylint issue
Yong Tang [Sun, 1 Apr 2018 02:08:53 +0000 (02:08 +0000)]
Fix pylint issue

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoAdd test case for Bahdanau attention when normalized=True and dtype = float16/32
Yong Tang [Sun, 1 Apr 2018 02:07:30 +0000 (02:07 +0000)]
Add test case for Bahdanau attention when normalized=True and dtype = float16/32

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoFix the issue with Bahdanau attention when normalized=True and dtype = float16/32
Yong Tang [Sun, 1 Apr 2018 02:01:47 +0000 (02:01 +0000)]
Fix the issue with Bahdanau attention when normalized=True and dtype = float16/32

While revisiting 18016 I noticed that Bahdanau attention has a similiar
dtype mismatch issue when normalized=True. The issue comes from:
```
     g = variable_scope.get_variable(
         "attention_g", dtype=dtype,
         initializer=math.sqrt((1. / num_units)))
```
where the initializer value does not work well with differnt dtype.

This fix converts changes the initializer to `init_ops.constant_initializer`
to address the issue, and adds additional test cases for it.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoAdd missing header pnglibconf.h
Yong Tang [Sat, 14 Apr 2018 19:05:28 +0000 (19:05 +0000)]
Add missing header pnglibconf.h

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoUpdate library file names `libpng12` -> `libpng16`
Yong Tang [Sat, 14 Apr 2018 19:04:52 +0000 (19:04 +0000)]
Update library file names `libpng12` -> `libpng16`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoUpdate libpng to v1.6.34 for cmake
Yong Tang [Sat, 14 Apr 2018 19:00:36 +0000 (19:00 +0000)]
Update libpng to v1.6.34 for cmake

The libpng has been updated from v1.2.53 to v1.6.34 in PR 18299.
However, the cmake version of libpng has not been updated yet.
This fix updates the libpng for cmake to v1.6.34.

The fix is tested with cmake on linux:
```
tensorflow/tools/ci_build/ci_build.sh CMAKE tensorflow/tools/ci_build/builds/cmake.sh
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoMerge pull request #18569 from annarev/merge_branch
Martin Wicke [Mon, 16 Apr 2018 19:19:57 +0000 (12:19 -0700)]
Merge pull request #18569 from annarev/merge_branch

Merge branch

6 years agoMerge pull request #17800 from yongtang/03152018-deprecated_argument_lookup
Martin Wicke [Mon, 16 Apr 2018 19:17:40 +0000 (12:17 -0700)]
Merge pull request #17800 from yongtang/03152018-deprecated_argument_lookup

Enhancement with deprecated_argument_lookup for argmax/argmin

6 years agoMerge pull request #18568 from case540/enable_git_tag_override
Martin Wicke [Mon, 16 Apr 2018 18:56:46 +0000 (11:56 -0700)]
Merge pull request #18568 from case540/enable_git_tag_override

Add ability to override git tag in __git_version__ string.

6 years agoMerge pull request #18544 from ManHyuk/fix_typo
Martin Wicke [Mon, 16 Apr 2018 18:40:18 +0000 (11:40 -0700)]
Merge pull request #18544 from ManHyuk/fix_typo

Fix typo

6 years agoMerging r1.8 into master
Anna R [Mon, 16 Apr 2018 18:04:52 +0000 (11:04 -0700)]
Merging r1.8 into master

6 years agoFix Exception syntax.
Michael Case [Mon, 16 Apr 2018 17:41:49 +0000 (10:41 -0700)]
Fix Exception syntax.

6 years agoAdd ability to override git tag in __git_version__ string.
Michael Case [Mon, 16 Apr 2018 16:40:40 +0000 (09:40 -0700)]
Add ability to override git tag in __git_version__ string.

Adding this functionality to make release process smoother. It will
allow us to create the release builds before creating the git
release tag.

6 years agoUpdate docs for tf.cast with respect to complex types
Yong Tang [Mon, 16 Apr 2018 17:17:06 +0000 (17:17 +0000)]
Update docs for tf.cast with respect to complex types

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoUpdate docs for return values as well
Yong Tang [Mon, 16 Apr 2018 15:00:51 +0000 (15:00 +0000)]
Update docs for return values as well

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoUpdate docs for tf.cast with supported types
Yong Tang [Sun, 15 Apr 2018 18:42:45 +0000 (18:42 +0000)]
Update docs for tf.cast with supported types

This fix tries to address the issue raised in 18529 where
there are some confusion over supported types for `tf.cast`.
This fix updates the docs with explicitly supported numeric
type for `tf.cast`:
```
`uint8`, `int8`, `uint16`, `int16`, `int32`, `int64`,
`float16`, `float32`, `float64`, `complex64`, `complex128`, `bfloat16`.
```

This fix fixes 18529.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoUpdate pydoc for several tfdbg hooks (#18533)
Harald Husum [Mon, 16 Apr 2018 14:21:23 +0000 (16:21 +0200)]
Update pydoc for several tfdbg hooks (#18533)

For classes:
Specify that tfdbg.LocalCLIDebugHook can be used to debug instances
of tf.estimator.Estimator. Remove mentions of
tf.contrib.learn.Estimator and tf.contrib.learn.Experiment, as
they are deprecated.

For __init__ method of LocalCLIDebugHook:
Clarify purpose of ui_type argument.

6 years agoFix tf.argmax warnings on dimension parameter with axis
imsheridan [Mon, 16 Apr 2018 14:08:02 +0000 (22:08 +0800)]
Fix tf.argmax warnings on dimension parameter with axis

6 years agoMerge pull request #18500 from jameswex/closure_proto_library
James Wexler [Mon, 16 Apr 2018 13:47:01 +0000 (09:47 -0400)]
Merge pull request #18500 from jameswex/closure_proto_library

closure proto library for example protos

6 years agoMerge branch 'master' into closure_proto_library
James Wexler [Mon, 16 Apr 2018 13:33:59 +0000 (09:33 -0400)]
Merge branch 'master' into closure_proto_library

6 years agoFix the doc strings of nn.sampled_softmax_loss since it was deprecated by nn.sampled_...
imsheridan [Mon, 16 Apr 2018 07:39:45 +0000 (15:39 +0800)]
Fix the doc strings of nn.sampled_softmax_loss since it was deprecated by nn.sampled_softmax_loss_v2

6 years agofix typo
manhyuk [Mon, 16 Apr 2018 05:53:17 +0000 (14:53 +0900)]
fix typo

6 years agoMerge branch 'fix_typo' of https://github.com/ManHyuk/tensorflow into fix_typo
manhyuk [Mon, 16 Apr 2018 05:52:16 +0000 (14:52 +0900)]
Merge branch 'fix_typo' of https://github.com/ManHyuk/tensorflow into fix_typo

6 years agoFix embedding_ops doc formatting (#18520)
Yuan (Terry) Tang [Mon, 16 Apr 2018 02:30:34 +0000 (22:30 -0400)]
Fix embedding_ops doc formatting (#18520)

* Fix embedding_ops doc formatting

* Add missing indentation

6 years agoexport tflite::Intepreter's UseNNAPI() and setNumThreads() to java (#16065)
freedom" Koan-Sin Tan [Mon, 16 Apr 2018 02:24:14 +0000 (10:24 +0800)]
export tflite::Intepreter's  UseNNAPI() and setNumThreads() to java (#16065)

* export UseNNAPI() and setNumThreads() to java

Export tflite::Intepreter's UseNNAPI() and SetNumThreads() to Java
and modify the Android TfLiteCameraDemo app to use them.

* change CheckedChangeListener accordingly

* add error checking to setNumThreads()

6 years agoAllow `~/` in path for transform_graph (#15894)
Yong Tang [Mon, 16 Apr 2018 02:23:53 +0000 (19:23 -0700)]
Allow `~/` in path for transform_graph (#15894)

* Allow `~/` in path for transform_graph

This fix tries to address the issue raised in 13211 where
it was not possible to specify `~` (e.g., `~/`, `~user/`, etc)
for the path used in transform_graph. This fix adds
the support of `~` transform_graph on Linux.

This fix fixes 13211.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Reformat transform_graph.cc with clang-format

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoadding ps_strategy to run_config to enable different placement strate… (#15640)
Siu Kei, Muk [Mon, 16 Apr 2018 02:23:20 +0000 (10:23 +0800)]
adding ps_strategy to run_config to enable different placement strate… (#15640)

* adding ps_strategy to run_config to enable different placement strategy in estimator

* 1. Moved estimator._device_fn to RunConfig as @property
2. Made RunConfig.device_fn to return custom device function if one is specified, otherwise the result from `tf.train.replica_device_setter` call is used
3. Added some basic unit tests, may need further tests.

* 1. Removing ps_strategy.
2. Modified estimator to take overriden device_fn from  if set.
3. Removed ps_strategy related unit tests.

* Adding manual initialization of _device_fn in legacy RunConfig class

* Updated estimator golden API through
1. bazel build //tensorflow/tools/api/tests:api_compatibility_test
2. bazel-bin/tensorflow/tools/api/tests/api_compatibility_test --update_goldens True

* fixing code styles

6 years agoAdd support for explicit broadcasting in TensorFlow (#15243)
Yong Tang [Mon, 16 Apr 2018 02:22:39 +0000 (19:22 -0700)]
Add support for explicit broadcasting in TensorFlow (#15243)

* Add support for explicit broadcasting in TensorFlow

This fix tries to adds support for explicit broadcasting in TensorFlow,
as was suggested in 14509. This fix adds the op of tf.broadcast_to,
which is equivalent to the numpy.broadcast_to in numpy.

This fix fixes 14509.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Register BroadcastTo op in array_ops.cc

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Sanitize with clang-format -i

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test cases for tf.broadcast_to

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Sanitize bazel BUILD and python.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Split broadcast_to_ops_test from array_ops_test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Support int64 shape

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Improve shape inference for broadcast_to

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add scalar input support for broadcast_to

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update API defs tensorflow/core/api_def/update_api_def.sh

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update API golden

```
bazel-bin/tensorflow/tools/api/tests/api_compatibility_test
           --update_goldens True
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update docstring for broadcast_to

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Enable GPU kernel for BroadcastTo

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Enable use_gpu=True for test cases

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Hiden the ops and export to tf.contrib.framework for now.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add the op to the _allowed_symbol in tf.contrib.framework

Otherwise the symbole will be hidden

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Fix pylint sanity issue.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoSupport passing layer instances to produce attentional hidden states (#14974)
Guillaume Klein [Mon, 16 Apr 2018 02:21:29 +0000 (04:21 +0200)]
Support passing layer instances to produce attentional hidden states (#14974)

* Support passing Layer instances to the AttentionWrapper.

* Use _compute_output_shape to get the attention layer depth

* compute_output_shape is now a public method

* Move new argument at the end

6 years agoExpose Scaffold.default_local_init_op as a public static method. (#18398)
David T.H. Kao [Mon, 16 Apr 2018 02:11:25 +0000 (19:11 -0700)]
Expose Scaffold.default_local_init_op as a public static method. (#18398)

* Expose Scaffold.default_local_init_op as a public static method.

* update api

* Add a docstring.

* Add a returns section.

6 years agoImproving S3 documentation. (#18406)
Elson Rodriguez [Mon, 16 Apr 2018 02:10:50 +0000 (19:10 -0700)]
Improving S3 documentation. (#18406)

* Improving S3 documentation.

Added a copy-pastable guide on the variables, and also provided usable examples that give immediate feedback.

* Updating docs based on feedback.

Added back old configuration section, moved s3 implementations to bottom of document.

* Rearranged documentation before example, renamed sections to be more clear.

6 years agoFix typo (#18416)
ManHyuk [Mon, 16 Apr 2018 02:10:17 +0000 (11:10 +0900)]
Fix typo (#18416)

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* fix typo

* Improve comment

6 years agoUpdate sqlite version for cmake build (#18524)
Yong Tang [Sun, 15 Apr 2018 20:23:47 +0000 (13:23 -0700)]
Update sqlite version for cmake build (#18524)

The sqlite has been updated in bazel, though
cmake version was not updated. This fix updates
sqlite in cmake so that cmake and bazel versions
are synced.

The fix has been tested on Linux:
```
tensorflow/tools/ci_build/ci_build.sh CMAKE tensorflow/tools/ci_build/builds/cmake.sh
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoAdd shape validation for tag input of StatsDataset (#18462)
Yong Tang [Sat, 14 Apr 2018 16:58:38 +0000 (09:58 -0700)]
Add shape validation for tag input of StatsDataset (#18462)

* Add shape validation for tag input of StatsDataset

The tag field of the StatsDataset needs to be a scalar.
However, there was no check in the shape function. This
fix adds the check of the tag shape.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test case for tag shape check with BytesProducedStatsDataset

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add tag shape check for LatencyStatsDataset

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test case for tag shape check with LatencyStatsDataset

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Fix pylint issue

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoCLN: hide ApplyAdaMax op
Yan Facai (颜发才) [Sat, 14 Apr 2018 05:39:09 +0000 (13:39 +0800)]
CLN: hide ApplyAdaMax op

6 years agoBLD: upgrade with eager.contex API
Yan Facai (颜发才) [Sat, 14 Apr 2018 05:23:59 +0000 (13:23 +0800)]
BLD: upgrade with eager.contex API

6 years agoMerge remote-tracking branch 'upstream/master' into ENH/adamax_optimizer
Yan Facai (颜发才) [Sat, 14 Apr 2018 05:12:02 +0000 (13:12 +0800)]
Merge remote-tracking branch 'upstream/master' into ENH/adamax_optimizer

6 years agoMerge pull request #18511 from qlzh727/branch_192842670
Qianli Scott Zhu [Sat, 14 Apr 2018 02:23:23 +0000 (19:23 -0700)]
Merge pull request #18511 from qlzh727/branch_192842670

Branch 192842670

6 years agoMerge commit for internal changes
Scott Zhu [Fri, 13 Apr 2018 23:44:35 +0000 (16:44 -0700)]
Merge commit for internal changes

6 years agoAutomated g4 rollback of changelist 192784701
Yifei Feng [Fri, 13 Apr 2018 23:38:29 +0000 (16:38 -0700)]
Automated g4 rollback of changelist 192784701

PiperOrigin-RevId: 192842670

6 years agoImprove layout optimizer tests -- Evaluate nodes before and after optimization, to...
A. Unique TensorFlower [Fri, 13 Apr 2018 23:38:12 +0000 (16:38 -0700)]
Improve layout optimizer tests -- Evaluate nodes before and after optimization, to confirm the graph's behavior is maintained after optimization.

PiperOrigin-RevId: 192842623

6 years agoUpgrade SQLite
Justine Tunney [Fri, 13 Apr 2018 22:57:45 +0000 (15:57 -0700)]
Upgrade SQLite

PiperOrigin-RevId: 192837358

6 years agoRestore definitions of static members in MklCpuAllocator.
A. Unique TensorFlower [Fri, 13 Apr 2018 22:53:05 +0000 (15:53 -0700)]
Restore definitions of static members in MklCpuAllocator.

These were removed in #17396 which made the static member variables of
MklCpuAllocator into inline variables, which are a C++17 feature, and not
properly restored in #18006 which reverted the inline declarations, leading to
an ODR violation that is apparently ignored with some compilers.
END_PUBLIC

RELNOTES: n/a

BEGIN_PUBLIC
Automated g4 rollback of changelist 191305220

PiperOrigin-RevId: 192836808

6 years agoEnable remote functions for TPU_SYSTEM.
Akshay Agrawal [Fri, 13 Apr 2018 22:47:37 +0000 (15:47 -0700)]
Enable remote functions for TPU_SYSTEM.

PiperOrigin-RevId: 192836098

6 years agoAvoid mixing `Dimension` type and `int` when defining kernel shapes in conv layers.
Francois Chollet [Fri, 13 Apr 2018 22:33:07 +0000 (15:33 -0700)]
Avoid mixing `Dimension` type and `int` when defining kernel shapes in conv layers.

PiperOrigin-RevId: 192834255

6 years ago[XLA] Pattern matcher for HLO, Shapes, Layouts
A. Unique TensorFlower [Fri, 13 Apr 2018 22:32:11 +0000 (15:32 -0700)]
[XLA] Pattern matcher for HLO, Shapes, Layouts

PiperOrigin-RevId: 192834129

6 years agoAdd broadcasting to all LinearOperators.
A. Unique TensorFlower [Fri, 13 Apr 2018 22:23:08 +0000 (15:23 -0700)]
Add broadcasting to all LinearOperators.

This will broadcast in cases where batch shapes are not equal (but tries to determine statically if this is the case). The broadcasting is not as efficient as doing the broadcast in C++, but makes for the API to at least be completely broadcastable.

PiperOrigin-RevId: 192832919

6 years ago[TF] Enable half precision XLA compiler tests for the gpu backend.
Bixia Zheng [Fri, 13 Apr 2018 22:15:44 +0000 (15:15 -0700)]
[TF] Enable half precision XLA compiler tests for the gpu backend.

Modify some tests to allow larger error for half precision.

Enable half precision SpaceToBatchNDTest for the cpu backend.

PiperOrigin-RevId: 192831909

6 years agoAdded PmfToQuantizedCdf op to contrib/coder in TensorFlow.
Sung Jin Hwang [Fri, 13 Apr 2018 21:51:16 +0000 (14:51 -0700)]
Added PmfToQuantizedCdf op to contrib/coder in TensorFlow.

The added op transforms probability mass functions (PMF) to quantized
cumulative distribution function (CDF), which can be used by range coder ops in
contrib/coder.

The op takes greedy approach to ensure that the post-quantization probability
masses do not sum over the maximum quantized value. The op does not make any
adjustment when the post-quantization probability masses already sum less than
the maximum value.

PiperOrigin-RevId: 192827779

6 years agoAllow tf.train.Saver to load object-based checkpoints (using names)
Allen Lavoie [Fri, 13 Apr 2018 21:32:45 +0000 (14:32 -0700)]
Allow tf.train.Saver to load object-based checkpoints (using names)

This is the second part of the compatibility story. Object-based checkpointing APIs can already read name-based checkpoints, and now the name-based APIs can read object-based checkpoints by looking up the modified keys in the object graph proto.

PiperOrigin-RevId: 192824907

6 years ago[XLA] Redesign: add ~XlaOp() and ~XlaComputation().
A. Unique TensorFlower [Fri, 13 Apr 2018 21:17:31 +0000 (14:17 -0700)]
[XLA] Redesign: add ~XlaOp() and ~XlaComputation().

PiperOrigin-RevId: 192822559

6 years agoSmall tag change
Austin Anderson [Fri, 13 Apr 2018 21:13:12 +0000 (14:13 -0700)]
Small tag change

PiperOrigin-RevId: 192821895

6 years agoExtend Keras symbol-feeding to dynamic-length tensors and tensors of different dtypes...
Francois Chollet [Fri, 13 Apr 2018 21:12:16 +0000 (14:12 -0700)]
Extend Keras symbol-feeding to dynamic-length tensors and tensors of different dtypes from the target placeholders.

PiperOrigin-RevId: 192821770

6 years agoInternal change.
Anna R [Fri, 13 Apr 2018 21:09:58 +0000 (14:09 -0700)]
Internal change.

PiperOrigin-RevId: 192821482

6 years agoSupport scalar mean in resolve_batch_normalization
A. Unique TensorFlower [Fri, 13 Apr 2018 20:40:28 +0000 (13:40 -0700)]
Support scalar mean in resolve_batch_normalization

PiperOrigin-RevId: 192816848

6 years agoMerge pull request #18505 from yupbank/add-new-owner-for-tensor-forest
Martin Wicke [Fri, 13 Apr 2018 20:31:25 +0000 (13:31 -0700)]
Merge pull request #18505 from yupbank/add-new-owner-for-tensor-forest

Add extra code owner for tensor_forest

6 years agoAdd myself into code ownder for tensor_forest
Peng Yu [Fri, 13 Apr 2018 20:07:36 +0000 (16:07 -0400)]
Add myself into code ownder for tensor_forest

6 years agoRemove closure_js_proto_library rule for tf.example protos.
James Wexler [Fri, 13 Apr 2018 19:44:41 +0000 (12:44 -0700)]
Remove closure_js_proto_library rule for tf.example protos.

PiperOrigin-RevId: 192809073

6 years ago[XLA] Redesign: add a constructor: XlaComputation(HloModuleProto).
A. Unique TensorFlower [Fri, 13 Apr 2018 19:37:04 +0000 (12:37 -0700)]
[XLA] Redesign: add a constructor: XlaComputation(HloModuleProto).

PiperOrigin-RevId: 192808038

6 years ago[XLA] Redesign: add a method that creates fake data for XlaComputation.
A. Unique TensorFlower [Fri, 13 Apr 2018 19:35:32 +0000 (12:35 -0700)]
[XLA] Redesign: add a method that creates fake data for XlaComputation.

PiperOrigin-RevId: 192807851

6 years agoExpose tf.decode_compressed to the public API.
A. Unique TensorFlower [Fri, 13 Apr 2018 19:18:53 +0000 (12:18 -0700)]
Expose tf.decode_compressed to the public API.

PiperOrigin-RevId: 192805605

6 years agoMerge branch 'closure_proto_library' of https://github.com/jameswex/tensorflow into...
James Wexler [Fri, 13 Apr 2018 19:18:53 +0000 (15:18 -0400)]
Merge branch 'closure_proto_library' of https://github.com/jameswex/tensorflow into closure_proto_library

6 years agofix build file format
James Wexler [Fri, 13 Apr 2018 19:18:17 +0000 (15:18 -0400)]
fix build file format

6 years agoFix warnings in tf.distributions.Categorical (#18468)
Yong Tang [Fri, 13 Apr 2018 18:47:02 +0000 (11:47 -0700)]
Fix warnings in tf.distributions.Categorical (#18468)

In tf.distributions.Categorical dimension was used with argmax.
As dimension has been deprecated this generates a warning.
This fix fixes the warning by changing to axis.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
6 years agoFix crash when invalid dtype was passed (#18481)
Yong Tang [Fri, 13 Apr 2018 18:38:43 +0000 (11:38 -0700)]
Fix crash when invalid dtype was passed (#18481)

* Fix crash when invalid dtype was passed

This fix tries to address the issue raised in 18474
where crash may happen if invalid dtype (e.g., `"[,]"`)
is passed to `tf.constant(tf.string, "[,]")`. The crash
happens during the comparision of `"[,]"` and numpy dtype
candidate (e.g., `np.dtype([("qint8", np.int8, 1)])`:
```
>>> import numpy as np
>>> np.dtype([("qint8", np.int8, 1)]) == "[,]"
Segmentation fault: 11
```

This fix adds a type check to make sure the type of the passed
dtype is either numpy.dtype or type.

This fix fixes 18474.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test case for invalid type to tf.constant

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>