History log of /external/tensorflow/tensorflow/python/framework/function.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c2c9e3beef18c5f1ed443d372dec18c8acc5d991 23-Jan-2018 Skye Wanderman-Milne <skyewm@google.com> _DefinedFunction.name should be a string.

With the C API enabled and python2, it was being set to a unicode
object.

PiperOrigin-RevId: 182865087
/external/tensorflow/tensorflow/python/framework/function.py
9b03bcd74d117a2a6ee270af438a3a28e7123111 19-Jan-2018 Alexandre Passos <apassos@google.com> Fixes issue with using lookup ops in datasets from eager.

Addresses issue #16160

PiperOrigin-RevId: 182554969
/external/tensorflow/tensorflow/python/framework/function.py
90e42f3ac8c43474633136af4242dca04b6a1e09 16-Dec-2017 Dandelion Man? <dandelion@google.com> Automated g4 rollback of changelist 179260538

PiperOrigin-RevId: 179263865
/external/tensorflow/tensorflow/python/framework/function.py
9648f8040a559f6cf9bbe0501ba96f2b2c2864b1 16-Dec-2017 A. Unique TensorFlower <gardener@tensorflow.org> Automated g4 rollback of changelist 179258973

PiperOrigin-RevId: 179260538
/external/tensorflow/tensorflow/python/framework/function.py
d55f532867a3670d66460c5ee3b774519542adc1 16-Dec-2017 Dandelion Man? <dandelion@google.com> Merge changes from github.

PiperOrigin-RevId: 179258973
/external/tensorflow/tensorflow/python/framework/function.py
1c4810141e71289d71bfd94a74434bd09ee6b20f 30-Nov-2017 Skye Wanderman-Milne <skyewm@google.com> Hoist function input placeholders out of any control flow context.

Prior to this change, functions that closed over external tensors in a
while loop would cause a segfault at runtime. This is because the
external tensors are temporarily represented as placeholders in the
function body before being replaced by input parameters, and the
placeholders would be created directly in the while loop body. This
would eventually lead to using the input tensor in the while loop body
without an enter node. This wasn't caught by the runtime check because
it isn't applied to function bodies.

This change adds tests for capturing tensors in a while loop body and
in a cond context. Note that the cond test passed without this fix.

PiperOrigin-RevId: 177464541
/external/tensorflow/tensorflow/python/framework/function.py
4640cc88ffcdaeb8724ffc129bc4d900277a5403 10-Nov-2017 Yifei Feng <yifeif@google.com> Fix typo in tensorflow/python/framework/function.py

PiperOrigin-RevId: 175219920
/external/tensorflow/tensorflow/python/framework/function.py
3bafe0a86f67dd54197c6d60bdb5053f510de7d8 10-Oct-2017 Peter Hawkins <phawkins@google.com> Add uint32 and uint64 types to TensorFlow.

This change merely creates the types, but does not register kernels that act on uint32/uint64 values. It also does not alter most op registration lists to include uint32/uint64 values. If desirable, that can be done in a subsequent change, although binary size will likely prove problematic if adding more kernels.

The intent of the change is so XLA-compiled code can make use uint32/uint64 types. Since XLA does not use traditional TensorFlow kernels, using uint32/uint64 operators from XLA will require only uint32/uint64 op registrations, but will require few new kernel registrations.

PiperOrigin-RevId: 171681867
/external/tensorflow/tensorflow/python/framework/function.py
2198b8cfe8acb5af7bb5a1dac54c18ff72c98002 05-Oct-2017 Igor Ganichev <iga@google.com> Minimize python code in supporting TF_Function.

After this change when C API is enabled, function support in Python is
done with minimal use of Python code. In particular, we don't create
or store FunctionDef in Python. Small changes include:
- We don't use _hash_str for function comparisons in Python. Instead,
we delegate this logic to TF_GraphCopyFunction in C API.
- We checking for duplication function additions from
_DefinedFunction.add_to_graph(graph) to Graph._add_function in all
cases. This is more logical and make it easier to support both modes.
- We change some error messages to be same in both modes.
- Since we don't store FunctionDef in C API mode in Python but get it
on demand, access to common attributes like name or signature can
become expensive. To mitigate this, we cache the signature (OpDef)
of the function in Python. Signatures are generally much smaller
than whole definitions.
- Add context manager for creating and destroying TF_Buffers.
- Allow zero output tensorflow functions in Python
The C API and C++ runtime support functions without outputs, but Python
APIs explicitly disallowed them before this change. This change allows
zero output functions in Python and cleans some hacks that were added
to side-step regular Python function APIs before.

PiperOrigin-RevId: 171201162
/external/tensorflow/tensorflow/python/framework/function.py
bdab2691068757ee4872167898bc8768a7303ae9 28-Sep-2017 Igor Ganichev <iga@google.com> Add append_hash_to_fn_name arg to TF_GraphToFunction

PiperOrigin-RevId: 170379490
/external/tensorflow/tensorflow/python/framework/function.py
818dc210881aadcce9013b693e071b96a6e1f1f6 26-Sep-2017 Igor Ganichev <iga@google.com> Remove function declaration feature

PiperOrigin-RevId: 170043510
/external/tensorflow/tensorflow/python/framework/function.py
3e4521bd290e4654a8b1e432d16ca893181ab018 20-Sep-2017 Igor Ganichev <iga@google.com> Add function description parameter to TF_GraphToFunction

PiperOrigin-RevId: 169421145
/external/tensorflow/tensorflow/python/framework/function.py
7ad8e25495a2793ea14189359af736d2c662a694 20-Sep-2017 Igor Ganichev <iga@google.com> Add attribute setting and getting support to TF_Function

PiperOrigin-RevId: 169337159
/external/tensorflow/tensorflow/python/framework/function.py
1da763a1cc94fc5e4ad1822788b444b77623538c 19-Sep-2017 Igor Ganichev <iga@google.com> Add function gradient support to C API

Also, change the internal representation of TF_Function and
rename TF_GraphAddFunction to TF_GraphAddFunctionCopy to make it
clear that a copy of the function is added to the graph. Any
subsequent modifications to the function will not be reflected
in the copy added to the graph.

PiperOrigin-RevId: 169187793
/external/tensorflow/tensorflow/python/framework/function.py
87f5182a5644993e747c2f42dfe6da75b7431e66 16-Sep-2017 Asim Shankar <ashankar@google.com> Fix broken test: tensorflow/contrib/eager/python:datasets_test

PiperOrigin-RevId: 168914742
/external/tensorflow/tensorflow/python/framework/function.py
b57bbdecb24afa18d1716403dd05a08566e3e516 16-Sep-2017 A. Unique TensorFlower <gardener@tensorflow.org> Adding support for capture-by-value.

PiperOrigin-RevId: 168903482
/external/tensorflow/tensorflow/python/framework/function.py
ea4e0ad9dbfb49c17be1cbe6112cbb68ea1b77a0 14-Sep-2017 Asim Shankar <ashankar@google.com> eager: Support function-valued operation attributes.

This enables use of MapDataset, FilterDataset etc. when
eager execution is enabled.

PiperOrigin-RevId: 168729488
/external/tensorflow/tensorflow/python/framework/function.py
9624d165f1f2c717eda96464fee8bf7229cc14f5 31-Aug-2017 Igor Ganichev <iga@google.com> Add function support to Tensorflow C API

This change adds minimal functionality. Support for FunctionOptions,
attributes, output name rewriting, function name generation, etc is
comming next.

PiperOrigin-RevId: 167091238
/external/tensorflow/tensorflow/python/framework/function.py
48c48729a1770eb1e59e86345b8768b466722041 16-Aug-2017 A. Unique TensorFlower <gardener@tensorflow.org> Allow Defun to inherit enclosing XLA compilation scope.

PiperOrigin-RevId: 165457067
/external/tensorflow/tensorflow/python/framework/function.py
28ce1d163eeffe618a6972c5245be0e660d94e85 15-Aug-2017 A. Unique TensorFlower <gardener@tensorflow.org> Merge changes from github.
END_PUBLIC

---
Commit 9f81374c3 authored by raymondxyang<zihao.yang@microsoft.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Add option for build more python tests in Cmake (#11853)

* Ignore Windows built project

* Fix deprecated methods in tf.contrib.python

* Fix regex match for Windows build in contrib.keras

* Fix Regex match for Windows build in session_bundle

* * Fix deprecated methods
* Fix regex match for Windows
* Fix compatibility issue with Python 3.x

* Add missing ops into Windows build for test

* Enabled more testcases for Windows build

* Clean code and fix typo

* Add conditional cmake mode for enabling more unit testcase

* Add Cmake mode for major Contrib packages

* Add supplementary info in RAEDME for new cmake option

* * Update tf_tests after testing with TF 1.3
* Clean code and resolve conflicts

* Fix unsafe regex matches and format code

* Update exclude list after testing with latest master branch

* Fix missing module

---
Commit 98f0e1efe authored by Yong Tang<yong.tang.github@outlook.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Dynamic ksize and strides with MaxPool (#11875)

* Dynamic ksize with max_pool

This fix tries to fix the issue raised in 4746 where ksize
is static (attr) with max_pool.
This fix changes ksize to input tensor so that it is dynamic now.

This fix fixes 4746.

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

* Add dynamic ksize to MaxPoolGrad and MaxPoolGradGrad

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

* Add test cases for max_pool_v2

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

* Fix GPU Jenkins issue.

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

* Enable MaxPoolV2 in GPU

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

* Hide MaxPoolV2 and other fixes.

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

---
Commit 02d6bc185 authored by Bairen Yi<byronyi@users.noreply.github.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
remove useless variable (#12212)

---
Commit ed6b0d905 authored by namrata-ibm<bhavenamrata@gmail.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Adding support for s390x in calculation of cpu_frequency (#12201)

---
Commit 627dfc9dd authored by Taehoon Lee<taehoonlee@snu.ac.kr>
Committed by Taehoon Lee<taehoonlee@snu.ac.kr>:
Fix typos

---
Commit c0f9b0a91 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
In fast-math mode emit a tanh that has a faster min/max.

PiperOrigin-RevId: 164943597

---
Commit 87605f3d6 authored by Kay Zhu<kayzhu@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
[TF:XLA] Use HloEvaluator for ComputeConstant, remove the need of a dedicated
compute constant backend.

PiperOrigin-RevId: 164940970

---
Commit 881de45c2 authored by Taehoon Lee<me@taehoonlee.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Add bool type supports for GPU kernels (#11927)

* Add bool type supports for GPU kernels

* Add bool type test codes for GPU kernels

---
Commit eeacdcdb1 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Add missing "CPU" suffix in registrations.

PiperOrigin-RevId: 164939527

---
Commit de01be952 authored by namrata-ibm<bhavenamrata@gmail.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Adding support for Big Endian in graph_constructor_test and wav_io (#12179)

---
Commit 26719d29f authored by QingYing Chen<pkudysj@126.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Implement CRF decode (Viterbi decode) for tensor (#12056)

* Implement CRF decoding for tensors

* add test code for tensor version's CRF decoding

* made modifications according to pylint

* add some comments for crf decode

* remove useless code

* add comments at the top comment of crf module and add more comments in crf_test

* capitalize first char of first word in comments

* replace crf_decode test code with a deterministic example

---
Commit f9a81ca2f authored by Pete Warden<pete@petewarden.com>
Committed by gunan<gunan@google.com>:
Create CI build script for Raspberry Pi (#12190)

* Create CI build script for Raspberry Pi

* Moved location of Pi build script

---
Commit e2a163a90 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Merge code from PR #11940 with internal changes from cl/164796436, and update Python tests to also run on GPU.

PiperOrigin-RevId: 164929133

---
Commit 08bbfa187 authored by Taehoon Lee<me@taehoonlee.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Fix typos (#12195)

---
Commit ab96f41fb authored by Luke Iwanski<luke@codeplay.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
[OpenCL] Extends matmul_benchmark.py to cover SYCL (#11697)

* [OpenCL] Extends matmul_benchmark.py to cover SYCL

* Fixed typo

* /gpu:0 -> /device:GPU:0

* Fixes control_flow_ops_py_test

* /gpu: -> /device:GPU:

* Fixes //tensorflow/python/profiler/internal:run_metadata_test

* gpu: -> GPU:

* Fixes tfprof_node

* [OpenCL] Fixes device path to name with many colons (#123)

The device path is constructed from a device name by replacing all
colons with underscores. Some device names contain more than one colon,
for example 'device:SYCL:0' which gives a path 'device_SYCL_0'. The
previous code would not convert this back to the original device name,
but rather to 'device:SYCL_0'.

An alternative fix would be to convert all underscores to colons in the
device name (i.e. remove the restriction inside `replace("_", ":", 1)`),
however I'm not sure if there are any device names which contain
underscores.

* If no gpu device aviable fake one

* gpu: -> device:GPU

* Fixes profiler test

* /gpu:x -> /device:GPU:x

* Fixes debug_io_utils_test.cc test

* Fixes device_name_utils_test.cc

---
Commit 35e7a3665 authored by Yong Tang<yong.tang.github@outlook.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
Remove unneeded casting of int64 for reverse_sequence (#12192)

This fix remove unneeded cast of int64 for reverse_sequence:
```
lengths = math_ops.to_int64(lengths)
```
as int32 has already been enabled for reverse_sequence.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
---
Commit 9fba8c185 authored by Anna R<annarev@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Add benchmark dashboard link to benchmarks doc. Also, I added a link and
description for Benchmarks page to Community index page.

PiperOrigin-RevId: 164924906

---
Commit bb6f32fa7 authored by Mark Heffernan<meheff@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Make HloAliasAnalysis updatable after changes to the HLO graph.
As part of this change make HloAliasAnalysis a thinner layer which
basically only holds a map from HloValue to HloBuffer and vice versa.

PiperOrigin-RevId: 164923041

---
Commit 9103096c1 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by Thomas K?ppe<tkoeppe@google.com>:
Merged commit includes the following changes:
164923041 by meheff:

Make HloAliasAnalysis updatable after changes to the HLO graph.
As part of this change make HloAliasAnalysis a thinner layer which
basically only holds a map from HloValue to HloBuffer and vice versa.

--

PiperOrigin-RevId: 164923041

---
Commit 822603aed authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Merging sibling fusion instruction using multi_output_fusion

PiperOrigin-RevId: 164920220

---
Commit c035aa2a8 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Go: Update generated wrapper functions for TensorFlow ops.

PiperOrigin-RevId: 164917891

---
Commit e1e81d9ba authored by Luke Iwanski<luke@codeplay.com>
Committed by Rasmus Munk Larsen<rmlarsen@google.com>:
[OpenCL] Fixes double memcpy bug (#151) (#12173)

* [OpenCL] Fixes double memcpy bug (#151)

As the debg CopyOp is called on a Tensor without type, we need to use
the DataType enum to get type information, and use this to pass the type
on to Eigen. This is a workaround Eigen's need to have a type when
calling memcpy. If the Eigen memcpy can be provided without a type
requirement, then the memcpy in sycl_util is unnecessary.

* Acts on feedback from: #12173/files/32cb12a9001b672425867b5a3110fd98e737a20b#r132496277

---
Commit d9ca2d86d authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Internal change

PiperOrigin-RevId: 164916465

---
Commit b8d13d218 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Remove more parts of DCASGD missed in the first pass. (47949b)

PiperOrigin-RevId: 164914552

---
Commit 73b3d52c7 authored by Alexandre Passos<apassos@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
cmake fix

PiperOrigin-RevId: 164911656

---
Commit 2173b5b0a authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Allow TFE_TensorHandleCopyToDevice to have the same device as src and
destination. It will reuse the same underlying buffer in those cases.

PiperOrigin-RevId: 164909906

---
Commit 13eb3b90e authored by Alexandre Passos<apassos@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Experimental C and Python APIs to invoke TensorFlow kernels on concrete values.

PiperOrigin-RevId: 164902588

---
Commit 7dfabcc01 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Initialize ExecutionOptions in ComputeConstant to default values.

PiperOrigin-RevId: 164894867

---
Commit c8897e9bc authored by Benoit Steiner<bsteiner@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Static required time computation

PiperOrigin-RevId: 164894645

---
Commit 076158f9b authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Enable implicit->explicit conversion by default.

PiperOrigin-RevId: 164890915

---
Commit 58c4a4cb1 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Bugfix: number of input channels is not necessarily in the last dimension, after introduction of data_format param.

PiperOrigin-RevId: 164889729

---
Commit 8f9b1af8a authored by Igor Saprykin<isaprykin@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Recover MonitoredSession when the Coordinator is requested to stop with one of the _PREEMPTION_ERRORS.

When SyncReplicasOptimizer is used, a preemption in the Coordinator may result in two cases:
Case 1) the session gets silently marked as complete
Case 2) the session gets stuck

This CL aims to solve and verify solutions for both of these problems. Fix 1 changes the should_stop logic. Fix 2 changes the CoordinatedSession.run() logic.

SyncReplicasOptimizer runs a separate set of threads using a Coordinator instance. Those threads do FIFOQueue.enqueue; the main thread does a blocking FIFOQueue.dequeue.

`sync_token_q` FIFOQueue is on parameter-servers. When one of the PS instances gets preempted, an AbortedError causes the Coordinator to stop via request_stop(ex). That by itself changes the state of MonitoredSession.should_stop() to True (Fix 1).

Results of the blocking Dequeue operation are sent to the chief worker via Recv. What happens next depends on the amount of tokens in `sync_token_q`. If there are enough for the next call to Dequeue to return, then the low-level "tf session run() call" returns. The next iteration of the `while not MonitoredSession.should_stop()` loop decides that the training is complete (Case 1).

If there are not enough tokens in `sync_token_q`, then the blocking Dequeue is going to keep waiting for them. This results in the graph execution getting stuck and the whole session getting garbage collected after 10 minutes (Case 2).

We decided to fix that by re-creating a session after it gets garbage collected (Fix 2). An alternative was to try to cancel the pending Dequeue operation, but it's not clear that it is the right thing to do and it is also not easy.

PiperOrigin-RevId: 164888390

---
Commit 46e4de6e5 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Undo loop fusion changes for now as they seem to be altering a few results.
END_PUBLIC
RELNOTES: n/a

BEGIN_PUBLIC
BEGIN_PUBLIC
Automated g4 rollback of changelist 164825735

PiperOrigin-RevId: 165340331
/external/tensorflow/tensorflow/python/framework/function.py
0815de21239955e346b562e899640649c8d2b9cb 05-Aug-2017 Benoit Steiner <bsteiner@google.com> Merge changes from github.
END_PUBLIC

---
Commit cf375f067 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
Adds cudnn_rnn_ops_op_lib and cudnn_rnn_kernels to contrib_ops_op_lib and
contrib_kernels respectively.

PiperOrigin-RevId: 164170971

---
Commit 95ec58e27 authored by Asim Shankar<ashankar@google.com>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
C API: Make TF_TensorFromTensor return an error instead of just logging it.

PiperOrigin-RevId: 164167582

---
Commit 15175c870 authored by Jonathan Hseu<jhseu@google.com>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
Build fixes.

- Allow var_list as a positional argument in CrossShardOptimizer.
- Set the number of shards to 1 when not running on TPU, to allow evaluate() and predict() on CPU/GPU to work.

PiperOrigin-RevId: 164161640

---
Commit bd3e894f7 authored by Yao Zhang<yaozhang@google.com>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
Support freeze mode for fused batch norm.

PiperOrigin-RevId: 164149032

---
Commit e6b6b84c0 authored by Asim Shankar<ashankar@google.com>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
C API: TF_Tensors will always be in host memory.

This change undoes some experimentation in
commit 22651083406ca01ac9d481e3367a3510d25f88cd
and restores TF_Tensor behavior to what is was prior to that change.

PiperOrigin-RevId: 164146670

---
Commit 8bf3f88f7 authored by Peter Hawkins<phawkins@google.com>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
[TF:XLA] Add _XLASend and _XLARecv TF ops that wrap the XLA Send/Recv HLO ops.

PiperOrigin-RevId: 164124764

---
Commit 626d3200f authored by Peter Hawkins<phawkins@google.com>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
[XLA] Add test blacklist mechanism for XLA C++ unit tests.

PiperOrigin-RevId: 164124423

---
Commit 359cc5f5e authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
Document dict ordering in nest and make it consistent with sonnet.

PiperOrigin-RevId: 164114335

---
Commit 05813b531 authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
Go: Update generated wrapper functions for TensorFlow ops.

PiperOrigin-RevId: 164089206

---
Commit c451f465d authored by Anna R<annarev@google.com>
Committed by Benoit Steiner<benoitsteiner@users.noreply.github.com>:
BEGIN_PUBLIC
Automated g4 rollback of changelist 164078808

PiperOrigin-RevId: 164318935
/external/tensorflow/tensorflow/python/framework/function.py
b876065afe85ef7b8e7334e506af2f84b3a6add1 31-Jul-2017 Alexandre Passos <apassos@google.com> graph_to_function_def gets its own file

PiperOrigin-RevId: 163709410
/external/tensorflow/tensorflow/python/framework/function.py
8e82134acd68c313f0ecadb168a66916006b17a6 12-Jul-2017 A. Unique TensorFlower <gardener@tensorflow.org> Use C API to implement Operation._input_types

This change first converts _input_types into a property and renames the
member to _input_types_val. We keep _input_dtypes as an alias for
_input_types as it was before this change.

Similarly to _output_types, we can't enable normal tests yet. Instead,
we add a simple temporary test for _input_types.

Also, fix two minor typos in doc strings of function.py

PiperOrigin-RevId: 161597185
/external/tensorflow/tensorflow/python/framework/function.py
98eb5270e2f9b61408f04035c7edde66c21e3fa7 09-Jun-2017 Ali Yahya <alive@google.com> Reorder code in function.py for better readability.

PiperOrigin-RevId: 158525581
/external/tensorflow/tensorflow/python/framework/function.py
c048e2938ceced754f95e5a15dff81e37646aaa3 01-Jun-2017 Alexandre Passos <apassos@google.com> Adds support to non-placeholder inputs in _graph_to_function_def.

Specifically, supports input ops with more than one output tensor.

PiperOrigin-RevId: 157640908
/external/tensorflow/tensorflow/python/framework/function.py
eae7e833f104b0afc0aa7bba21a59c56612dc3df 26-May-2017 A. Unique TensorFlower <gardener@tensorflow.org> Change shape inference so that a single resource tensor can carry
shape and type information for multiple tensors.

Apply this to QueueDequeueV2 handled by grappler.

PiperOrigin-RevId: 157163757
/external/tensorflow/tensorflow/python/framework/function.py
56b2b7ab193b6fedb3dee58e847bad9776f69a16 05-May-2017 Alexandre Passos <apassos@google.com> Internal change.
Change: 155236037
/external/tensorflow/tensorflow/python/framework/function.py
8e5041918f2e709ded94e63fb1779d6bb363becb 21-Apr-2017 Charles Nicholson <nicholsonc@google.com> Introduce TFDecorator, a base class for Python TensorFlow decorators. Provides basic introspection and "unwrap" services, allowing tooling code to fully 'understand' the wrapped object.
Change: 153854044
/external/tensorflow/tensorflow/python/framework/function.py
e4a8dc831dbf2894c79659d50aea73999c1ff173 31-Mar-2017 A. Unique TensorFlower <gardener@tensorflow.org> Allow variable reuse in function.
Change: 151807504
/external/tensorflow/tensorflow/python/framework/function.py
4d35ecb853f5e9c7d41df3629a31dcbc7b4032ca 30-Mar-2017 A. Unique TensorFlower <gardener@tensorflow.org> Copy handle dtype and shape to the placeholders created inside Defun context
for captured external tensors.

Also fix a minor bug in ResourceVariable that dtype from deserialization contains integer enum value rather than dtypes.DType instance.
Change: 151723784
/external/tensorflow/tensorflow/python/framework/function.py
a75b6df69e1b6965fcbac5df68e89dc3cbe9931e 13-Mar-2017 A. Unique TensorFlower <gardener@tensorflow.org> [TF:XLA] Add separate_compiled_gradients to control gradient scopes.
Change: 149973410
/external/tensorflow/tensorflow/python/framework/function.py
eb281da2d4379cce5bcb16c6910a085ade84b24b 11-Mar-2017 A. Unique TensorFlower <gardener@tensorflow.org> Fix unsuccessful opdef lookup when function was not created via Defun.
Change: 149826365
/external/tensorflow/tensorflow/python/framework/function.py
020501c695119f76bba0dd2bb47abfeaa939d669 07-Mar-2017 Alexandre Passos <apassos@google.com> Hoist resource variable reads outside functions.
Change: 149360110
/external/tensorflow/tensorflow/python/framework/function.py
00a294d68e0f36c44fefcf2e07bf40068250a884 01-Mar-2017 Skye Wanderman-Milne <skyewm@google.com> Make import_graph_def work with functions

This patch adds logic for recreating functions originally defined using @Defun and serialized in a GraphDef.
Change: 148893654
/external/tensorflow/tensorflow/python/framework/function.py
93a975e114ee1c35f01ed3bdd47170e6f7129014 18-Feb-2017 Vijay Vasudevan <vrv@google.com> Merge changes from github.
Change: 147897309
/external/tensorflow/tensorflow/python/framework/function.py
e62619519b788a73393ca64651b8a081ec9c63c1 14-Feb-2017 Jonathan Hseu <jhseu@google.com> Doc fixit task 2.
Change: 147404726
/external/tensorflow/tensorflow/python/framework/function.py
46c8e8bd966286ad3f192948fa64f2e9ee8f0dcb 11-Feb-2017 Eugene Brevdo <ebrevdo@google.com> Add _XlaScope attribute to jit_scope to avoid fusing separate adjacent fused blocks.

Gradients get their own separate scope based on the scope of the forward op.

Provide proper XlaScope for Defuns as well (each Defun gets its own scope; their gradients get their own scope).

Also move jit scope gradient unit tests out of core gradients to contrib.compiler.

This is just the python side that sets the attribute; the C++ changes will come
in a separate CL.
Change: 147216860
/external/tensorflow/tensorflow/python/framework/function.py
8343176bb003f3591cde09ea47636fa5a6a9cc23 10-Feb-2017 A. Unique TensorFlower <gardener@tensorflow.org> Add shape_func argument to function.Defun, to specify the shape of output Tensors.
Change: 147149282
/external/tensorflow/tensorflow/python/framework/function.py
8567b761999bd051eaebdae5f2bd6d751eb4ec81 03-Feb-2017 Peter Hawkins <phawkins@google.com> Ensure that the function definition has been built when evaluating the captured variables of a function.
Change: 146511347
/external/tensorflow/tensorflow/python/framework/function.py
6237c439bdc3c3f882c1532ef85708956410e6f6 02-Feb-2017 Alexandre Passos <apassos@google.com> Function library tests pass with resource variables.

Also makes resource variables dense-tensor-like.
Change: 146310220
/external/tensorflow/tensorflow/python/framework/function.py
873473ef0fff3d5f106f87cbd83048222f1dd93a 12-Jan-2017 A. Unique TensorFlower <gardener@tensorflow.org> Delete the FunctionDef.Node code paths, now that we have switched
to the NodeDef representation.
Change: 144281952
/external/tensorflow/tensorflow/python/framework/function.py
2eaaadae5a0afc0a92ed81cca550d57bb9b29cc1 12-Dec-2016 A. Unique TensorFlower <gardener@tensorflow.org> Hashing function input/output args should be a part of the function
name hash when the name is not given explicitly.
Change: 141790846
/external/tensorflow/tensorflow/python/framework/function.py
2d00e6f17df644077af331e5bcb47a0e8a0fa1b7 09-Dec-2016 A. Unique TensorFlower <gardener@tensorflow.org> Re-enable the NodeDef version of functions, fixing issue where Python
functions create signatures with duplicate output argument names.
Change: 141500446
/external/tensorflow/tensorflow/python/framework/function.py
165a1442c8eebb32d9edb11a74a612fef7536a78 07-Dec-2016 A. Unique TensorFlower <gardener@tensorflow.org> Add tf2xla tests.
Change: 141346498
/external/tensorflow/tensorflow/python/framework/function.py
afb3e3e1b26e33b52fc2e7b6516b0f6e3f3efdd7 01-Dec-2016 Asim Shankar <ashankar@google.com> Switch FIXME to TODO
Change: 140733125
/external/tensorflow/tensorflow/python/framework/function.py
eeb2632cd6bb77a88fdb6d2d20bfda23ad3381b8 23-Nov-2016 A. Unique TensorFlower <gardener@tensorflow.org> Switch function definition hash to NodeDef, fixing a TODO.
Change: 139963371
/external/tensorflow/tensorflow/python/framework/function.py
5591ca5f02377b27c3827b34c14b3f2f86451e06 22-Nov-2016 A. Unique TensorFlower <gardener@tensorflow.org> Python DefFun now creates functions that include NodeDefs
(in addition to the older FunctionDef::Node format). Add an
optional out_names argument to Defun and names to Declare's
arguments, so that signatures for forward-declared DefFuns
can have signatures in the name (required for this change).
Change: 139919259
/external/tensorflow/tensorflow/python/framework/function.py
85eeec0d415a1478bbeffc3d4545c795bee64e9f 19-Nov-2016 Jonathan Hseu <jhseu@google.com> Automated rollback of change 139400135
Change: 139632235
/external/tensorflow/tensorflow/python/framework/function.py
7e8728662120df0a80720bb7527613f96d58271e 17-Nov-2016 Jonathan Hseu <jhseu@google.com> Rename `Tensor` to `Output` in all Python docs

Generated by running:
$ find . -name '*.py' | xargs sed -i 's/a `Tensor`/an `Output`/g'
$ find . -name '*.py' | xargs sed -i 's/A `Tensor`/An `Output`/g'
$ find . -name '*.py' | xargs sed -i 's/`Tensor`/`Output`/g'
$ find . -name '*.py' | xargs sed -i 's/`tf.Tensor`/`tf.Output`/g'
$ find . -name '*.py' | xargs sed -i 's/`Tensors`/`Output`s/g'
$ find . -name '*.py' | xargs sed -i 's/#Tensor)/#Output)/g'
$ find . -name '*.py' | xargs sed -i 's/#Tensor\./#Output./g'

Manually fixed up lines that exceeded 80 characters after the change.
Change: 139400135
/external/tensorflow/tensorflow/python/framework/function.py
54afc49e09b4b24b166cbad8c115f794c149c06f 16-Nov-2016 A. Unique TensorFlower <gardener@tensorflow.org> More clearly document that functions are experimental.
Change: 139372609
/external/tensorflow/tensorflow/python/framework/function.py
aac685b7209b03ffd356ea6860366467b335d402 08-Nov-2016 Dan Smilkov <smilkov@google.com> Internal change.
Change: 138451572
/external/tensorflow/tensorflow/python/framework/function.py
b4cc63c5e59a922ad8040aa5da06d128733d5516 11-Oct-2016 A. Unique TensorFlower <gardener@tensorflow.org> * Exposes some properties of a defined function.
* Passes along shape information of captured tensors/variables.
* Writes a hash function agnostic to function def's serialization order
because map is not guaranteed to serialized determinsticly across build.
* Passes along trainable bool and collections list to variable scopes
so that captured variables are placed into proper collections in the
outer graph's collections.
Change: 135752415
/external/tensorflow/tensorflow/python/framework/function.py
d680b19889fa7cb6c25a3a32006199e542b3d411 06-Oct-2016 A. Unique TensorFlower <gardener@tensorflow.org> Hoist variables defined inside a function.
Change: 135405674
/external/tensorflow/tensorflow/python/framework/function.py
7a0cde1dd7b9656da3be8aebc7bfe9ec65e0b6b0 05-Oct-2016 A. Unique TensorFlower <gardener@tensorflow.org> * Supports defining overloaded functions. I.e., defers the
instantiation of the function definition until all input types are known.
* for convenience, adds more convert_to_tensor calls.
* adds None checking for better error reporting.
* cleanup function_test a bit so that it uses tf.logging.info consistently.
* changes the convention for coming up a function's name:
* if func_name is explicitly given, stick with it.
* otherwise, come up a name based on the python function info and a hash of the
function definition.
* uses __doc__ to fill in func's op def description in the proto.
Change: 135156837
/external/tensorflow/tensorflow/python/framework/function.py
c12b2121ba76eb9246f8d787094d96c9d1b54b11 04-Oct-2016 Martin Wicke <wicke@google.com> Automated rollback of change 135036941
Change: 135125564
/external/tensorflow/tensorflow/python/framework/function.py
74d0655d3f606a93efecd8f9520d6b2fe2d248aa 04-Oct-2016 A. Unique TensorFlower <gardener@tensorflow.org> * Supports defining overloaded functions. I.e., defers the
instantiation of the function definition until all input types are known.
* for convenience, adds more convert_to_tensor calls.
* adds None checking for better error reporting.
* cleanup function_test a bit so that it uses tf.logging.info consistently.
* changes the convention for coming up a function's name:
* if func_name is explicitly given, stick with it.
* otherwise, come up a name based on the python function info and a hash of the
function definition.
* uses __doc__ to fill in func's op def description in the proto.
Change: 135036941
/external/tensorflow/tensorflow/python/framework/function.py
b95814208554ff6dac745c3f58a93929214a5363 27-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Supports capturing tensors from outside of a Defun.
Change: 134421429
/external/tensorflow/tensorflow/python/framework/function.py
fa8a4a110d64c71339a33f4d2e67f76ef997afc0 26-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Allows calling a function w/ python literals and tf variables.
Change: 134288941
/external/tensorflow/tensorflow/python/framework/function.py
f61c9d02f769bdf701d94cc09ecc94f21027f2ae 26-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Handles an op within a function without return values.
Change: 134229005
/external/tensorflow/tensorflow/python/framework/function.py
adc15a46c56070ef92b890b65b6de0147abeff80 22-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Improves the syntax for passing in Defun.__init__'s kwargs.
Change: 133997045
/external/tensorflow/tensorflow/python/framework/function.py
75b07290907abf759f05d8ea087f4623de316db0 22-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Defun.__init__ can take some extra kwargs which is passed
to every call site.
Change: 133899430
/external/tensorflow/tensorflow/python/framework/function.py
e5b7e1e846f3e35d90a6bb260284b041d0036059 16-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Cleanup
Change: 133341191
/external/tensorflow/tensorflow/python/framework/function.py
8d54103171827b17cd062a71bc1b50fb80b3bb82 15-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Some cleanup.
Change: 133273363
/external/tensorflow/tensorflow/python/framework/function.py
74eeb2021564da80158e92744146a0c8bd7c6a70 15-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Supports forward declaration of functions.
Change: 133197452
/external/tensorflow/tensorflow/python/framework/function.py
ddb917930c7f2519166c879e8f5273afb9c5c59a 14-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Formating.
Change: 133163348
/external/tensorflow/tensorflow/python/framework/function.py
1d2aa9451d920ad4bc8ad1ac86c06863b590e81f 09-Sep-2016 A. Unique TensorFlower <gardener@tensorflow.org> Removes a few limitation of Defun:
* Defun can appear anyway. Previously, it must be under a with tf.Graph() scope;
Now, it can be used to decorate module level functions.
* Defun constructs the function definition lazily so that if a Defun is not called,
it cost little;
* Defun can be used within another Defun. The inner ones are lifted to the top-level.
Change: 132620258
/external/tensorflow/tensorflow/python/framework/function.py
0de021876cbfc65c3d55505f3f6e8ffd3aa80239 26-Aug-2016 A. Unique TensorFlower <gardener@tensorflow.org> Remove some unnecessary work done during function
construction (and fix a bad comment).
Change: 131340944
/external/tensorflow/tensorflow/python/framework/function.py
e058f2d1382aae39c88b6d3a71f25ec6114ffb31 23-Aug-2016 A. Unique TensorFlower <gardener@tensorflow.org> Begin transition to use NodeDef in FunctionDef instead of
FunctionDef.Node.
Change: 131009401
/external/tensorflow/tensorflow/python/framework/function.py
1df3fb0b4ae5915364f09e233496e98a99a4a886 09-Aug-2016 Lukasz Kaiser <lukaszkaiser@google.com> Deprecate op_scope by extending name_scope and move all callers to the new name_scope.

Instead of tf.op_scope(values, name, default_name) please use now
tf.name_scope(name, default_name, values). Only the name parameter is required,
and when other are absent, it behaves exactly as tf.name_scope did before.
Change: 129776424
/external/tensorflow/tensorflow/python/framework/function.py
01925fe23a5d8ebf17a1ddfcfaa1503f67e32575 24-Jul-2016 A. Unique TensorFlower <gardener@tensorflow.org> Adds python_grad_func argument to function.Defun.

This allows the gradient for a function to be specified the same way as tf.RegisterGradient (except at the graph scope, rather than global scope). This allows the gradient to be expanded directly in the graph, which in turn enables efficiencies (in memory and space) that do not depend on the graph optimizer (which requires configuration entirely separate from the model definition, and does not always kick in, e.g. when control flow ops are present).
Change: 128270792
/external/tensorflow/tensorflow/python/framework/function.py
df94f63281a40acdd695a9a28862905af976adfd 13-Jun-2016 Zongheng Yang <zongheng@google.com> Minor: fix typo in Defun doc.
Change: 124731079
/external/tensorflow/tensorflow/python/framework/function.py
0cf9ed3a719c0782695154d5a0bca260001cec15 02-Jun-2016 A. Unique TensorFlower <nobody@tensorflow.org> Update copyright for 3p/tf/python.
Change: 123900456
/external/tensorflow/tensorflow/python/framework/function.py
6bf83b7061df648d4751bc443782348fc8ea5c17 16-May-2016 Eugene Brevdo <ebrevdo@gmail.com> Ease-of-use updates to function and function.Defun.

- function.Defun now uses function refs for grad_func.
- function.Defun also now accepts a func_name string argument,
so users can have more control over the Function name.
Change: 122459066
/external/tensorflow/tensorflow/python/framework/function.py
0cc25f0b95af9a99dd228c75d411670831fd6cec 24-Mar-2016 A. Unique TensorFlower <nobody@tensorflow.org> Allows the caller of a function to specify that a function is not
inlined into the call site regardless of the graph optimizer option
setting.
Change: 117994922
/external/tensorflow/tensorflow/python/framework/function.py
f10637b372b3216400129b42abacd4fe50a6d7ea 23-Mar-2016 A. Unique TensorFlower <nobody@tensorflow.org> Allows explicitly setting a gradient function for a user defined function.
Change: 117950844
/external/tensorflow/tensorflow/python/framework/function.py
f6f77accbb9c978b5d3562922425bffd01690f79 11-Mar-2016 Derek Murray <mrry@google.com> Implements "bool strictness" for `tf.Tensor`.

Using a `tf.Tensor` as a Python boolean value is ambiguous: in library
code it typically means "is this tensor not None?", whereas in user
code it can mean "does this tensor evaluate to `True`" (which does
not work and leads to buggy code).

This change adds a warning when a tensor is used as a bool, and
replaces all known instances in TensorFlow with the appropriate `is
None` or `is not None` checks.

This is the first step towards addressing Issue #1454.
Change: 116984574
/external/tensorflow/tensorflow/python/framework/function.py
19b7fd80780d02372f76076bc8eb40d55a89a301 01-Mar-2016 A. Unique TensorFlower <nobody@tensorflow.org> Improves the syntax to define a tf function w/ a list of arguments.

Previously,
@Defun(x=tf.float32, y=tf.float32)
def Foo(x, y):
return x + y

Now,
@Defun(tf.float32, tf.float32)
def Foo(x, y):
return x + y

Supports varargs. E.g.,
@Defun([tf.float32]*10)
def Foo(*args):
sum = args[0]
for x in args[1:]:
sum = sum + x
return sum
Change: 116011595
/external/tensorflow/tensorflow/python/framework/function.py
59f1eba5fb94506a205fa2e81145667754739da5 07-Feb-2016 Martin Wicke <wicke@google.com> Merge changes from GitHub, clean up linter errors, fix dependencies test.
Change: 114064632
/external/tensorflow/tensorflow/python/framework/function.py
3f9101e95e3d1359cb81863657b51c5909f89baa 25-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> More function related.
Change: 112912683
/external/tensorflow/tensorflow/python/framework/function.py
084075e4e967677fc0be9fe921a0157126e69617 20-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> More function support.
Change: 112611228
/external/tensorflow/tensorflow/python/framework/function.py
a84a81a7379507f8fcdd0d6118afc2d5044d159e 18-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> * Supports nested function calls;
* Supports uses python class method as a tf function prototype.
Derives the generate function name from the class name and the method name.
* Changes one LOG(INFO) to VLOG(1), which is too verbose.
Change: 112384148
/external/tensorflow/tensorflow/python/framework/function.py
f9f26e04929ab20653b2b6ce86fcad71f906b193 14-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> Fix Scatter*.png figures
Change: 112109184
/external/tensorflow/tensorflow/python/framework/function.py
0c62942e2bda15fa815fff440c9f5e466bff59b5 13-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> Change visibility to public in bower.BUILD

A remote repository cannot refer to the main repository that way and a fix in a future Bazel release will break TensorFlow with the current set-up.

Error: http://ci.bazel.io/job/TensorFlow/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/74/console
Change: 112056797
/external/tensorflow/tensorflow/python/framework/function.py
5515148be85f369484d6179b7c1baab30995b068 13-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> Minor fixes (related) to gpu_event_mgr_test.cc

This test got out of sync after some recent changes.
This CL allows the test function to explicitly stop/start
the polling loop so we can test some invarients without
non-deterministic timing issues. Also, the change
to TensorReferenceVector is now handled correctly in ~EventMgr,
and reliably tested.
Change: 112016082
/external/tensorflow/tensorflow/python/framework/function.py
e9434718c2c4f7e1de5488a411a2ea89e2724724 12-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> Fix overly pessimistic shape inference in tf.batch_matmul for matrices with partially specified shapes.
Change: 111953111
/external/tensorflow/tensorflow/python/framework/function.py
3034eef57a9e6a080eae457a5ee8480fadd377ea 12-Jan-2016 Martin Wicke <wicke@google.com> Fix error in link to mnist_with_summaries.py
Change: 111920304
/external/tensorflow/tensorflow/python/framework/function.py
f2de334678c251aa767743d08e66345a45113cc4 12-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> Fix type handling logic in translation of TensorFlow functions.

Inputs and outputs with lists of fixed types (as opposed to polymorphic lists) caused incorrect translation of some nodes in a function graph - adding a spurious attribute with name == "" and no value.

e.g. the 'indices' argument of DynamicStitch has a fixed int32 type, but 'data' is polymorphic. Handling 'indices' added a bogus attribute to the op in the function body.

REGISTER_OP("DynamicStitch")
.Input("indices: N * int32")
.Input("data: N * T")
.Output("merged: T")
.Attr("N : int >= 2")
.Attr("T : type")

Note that this is because the attr map in the ArgDef behaves like a C++ map in that an attempt to access a non-existent field creates key with a default value (i.e. does not fail like a Python dictionary would).
Change: 111895250
/external/tensorflow/tensorflow/python/framework/function.py
66c21d60d4becef8c72162015c66492ba975495a 08-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> Finish a TODO where we need to support N*T and type list during
graph-to-func conversion.
Change: 111648019
/external/tensorflow/tensorflow/python/framework/function.py
d12b67833196d5508657d488cb8d96127419f2eb 06-Jan-2016 A. Unique TensorFlower <nobody@tensorflow.org> Change: 111539073
/external/tensorflow/tensorflow/python/framework/function.py