| Commit message (Collapse) | Author | Age |
|
|
|
| |
PiperOrigin-RevId: 214932861
|
|
|
|
| |
PiperOrigin-RevId: 214824023
|
|
|
|
| |
PiperOrigin-RevId: 214521486
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Given a class
@attr.s()
class SampleAttr(object):
field_1 = attr.ib()
field_2 = attr.ib()
we will be able to run
obj = SampleAttr(tensor_1, tensor_2)
session.run(obj) # equivalent with session.run([obj.field_1, obj.field_2])
Please note, this does not need nest flatten support (which is only relevant to the feed_dict argument).
Also, the information in __attrs_attrs__ is provided for extensions (as per the docs: http://www.attrs.org/en/stable/extending.html#extending-metadata) like this and is not an "implementation detail".
PiperOrigin-RevId: 213963978
|
|
|
|
| |
PiperOrigin-RevId: 213875284
|
|
|
|
|
|
|
|
|
|
| |
tensors in Graph mode defun.
This allows inferring the shape of values popped from TensorLists inside defuns.
Remove "Resource" from {Set|Get}ResourceHandleShapeAndType since the same functions are re-usable for variants.
Eager mode fix coming in a future changelist.
PiperOrigin-RevId: 213735462
|
|
|
|
| |
PiperOrigin-RevId: 213589710
|
|
|
|
| |
PiperOrigin-RevId: 213034078
|
|
|
|
|
|
|
| |
/cpu is an old style and can be misleading for new people trying to specify other devices.
Also correct comparison in tensorflow/python/client/timeline_test.py
PiperOrigin-RevId: 212769480
|
|
|
|
|
|
|
|
| |
self.test_session() has been deprecated in 9962eb5e84b15e309410071b06c2ed2d6148ed44 as its name confuses readers of the test. Moving to cached_session() instead which is more explicit about:
* the fact that the session may be reused.
* the session is not closed even when doing a "with self.test_session()" statement.
PiperOrigin-RevId: 212336321
|
|
|
|
|
|
|
|
| |
This modifies
https://github.com/tensorflow/tensorflow/commit/834da2c3fddab1bbbce742db572cfe65dd320fcd
to work with tfe.defun in addition to the legacy Defun implementation.
PiperOrigin-RevId: 211663702
|
|\
| |
| |
| | |
PiperOrigin-RevId: 211581348
|
| |
| |
| |
| |
| |
| | |
value}}` and `^^key:value^^`. This change consolidate these two format.
PiperOrigin-RevId: 211550259
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
This change contains no code changes. Only doc-strings.
We can't use relative links in code files, so we don't have much choice but to link to tensorflow.org/
The deleted links were to docs that no longer exist.
PiperOrigin-RevId: 209019572
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Back-ticks are now converted to links in the api_docs generator. With the new docs repo we're moving to simplify the docs pipeline, and make everything more readable.
By doing this we no longer get test failures for symbols that don't exist (`tf.does_not_exist` will not get a link).
There is also no way, not to set custom link text. That's okay.
This is the result of the following regex replacement (+ a couple of manual edits.):
re: @\{([^$].*?)(\$.+?)?}
sub: `\1`
Which does the following replacements:
"@{tf.symbol}" --> "`tf.symbol`"
"@{tf.symbol$link_text}" --> "`tf.symbol`"
PiperOrigin-RevId: 208042358
|
|
|
|
|
|
|
|
|
|
| |
It is still guarded by an experimental config setting and can be enabled using e.g.
config = tf.ConfigProto()
config.experimental.client_handles_error_formatting = True
with tf.Session(config=config) as sess:
...
PiperOrigin-RevId: 206779413
|
|
|
|
|
|
|
| |
The format used is as follows:
{{node <node_name>}}
PiperOrigin-RevId: 206370355
|
|
|
|
| |
PiperOrigin-RevId: 206166233
|
|
|
|
|
|
| |
Does not inherit from dict (and so won't pass isinstance checks). I've written a small tome about why in a comment on the class definition. This seems not to break anyone, but if it does we can add Mapping to the problematic isinstance checks (as I've done for TF's nest util and Session fetching); ideally custom mappings would be supported everywhere dicts are anyway.
PiperOrigin-RevId: 205898305
|
|
|
|
| |
PiperOrigin-RevId: 205679162
|
|
|
|
|
|
|
|
| |
Previously session destruction was delayed until the destructor for the Python session object. If the session ends up requiring the Python cycle collector for deallocation, it could end up persisting for a long, non-deterministic period. This can tie up resources and lead to out of memory issues.
This change introduces a SessionRef which causes session.close() to block until all outstanding run operations are finished and tears down the underlying session.
PiperOrigin-RevId: 205670577
|
|
|
|
| |
PiperOrigin-RevId: 205273020
|
|
|
|
|
|
|
|
|
|
|
|
| |
Conceptually lists just get replaced with a list-like wrapper. A shallow copy is maintained for error checking (since appends to it aren't monitored, we can't do restore-on-create for variables unless it's being modified through the wrapper).
There are lots of other details. I gave up on generalizing our isinstance(obj, (list, tuple)) checks and just subclassed list. Behaving like a list means the type should be unhashable, which requires some workarounds when we're collecting objects (object-identity collections, and object-identity versions of weak reference containers).
Adds a decorator for exempting whole methods from automatic dependency tracking so we don't need to track down every last self.inputs = [] statement to avoid polluting dependencies.
There's a TODO for tuples and dictionaries.
PiperOrigin-RevId: 202703271
|
|
|
|
|
|
| |
multiple ops modifications to happen at the same time, but no Session.run can happen until the modifications are done. And vice-versa.
PiperOrigin-RevId: 202028326
|
|
|
|
|
|
|
| |
On some platforms (namely Windows), a long is 32 bits, not 64.
This is what was causing random_ops_test to fail on Winodws.
PiperOrigin-RevId: 201427591
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior this change, we were using the C API for everything except
Tensor.shape calls, which returned the result from the original Python
shape inference code. With this change, we use the C API in this case
as well. The C API has better shape inference, so this has the effect
of returning more precise shapes in some cases.
This change can be disabled by setting the environment variable
TF_C_API_GRAPH_CONSTRUCTION_SHAPES=0. However, this toggle will
be removed altogether in the near future.
This also fixes a bug in the SWIG that could cause large shape dimensions
to be incorrect.
PiperOrigin-RevId: 200783822
|
|
|
|
|
|
|
|
| |
All callables returned from this private API now accept a
"run_metadata" keyword argument whose behavior matches the
`run_metadata` argument accepted by `Session.run()`.
PiperOrigin-RevId: 200331667
|
|
|
|
| |
PiperOrigin-RevId: 199641205
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test got lost in the transition. Prior to enabling the C API,
some constant node whose values were used for shape inference would be
marked as unfeedable in tensor_util.constant_value
(https://github.com/tensorflow/tensorflow/blob/r1.8/tensorflow/python/framework/tensor_util.py#L810).
This shape inference path is no longer used with the C API enabled, so
the constant node is successfully fed, triggering a runtime shape error.
This is arguably a regression, but given that the Python code wouldn't
mark all nodes evaluated during shape inference as unfeedable, it
seems ok to relax the check a little more.
PiperOrigin-RevId: 197002741
|
|
|
|
|
|
| |
This is in preparation for removing the _USE_C_API toggle altogether.
PiperOrigin-RevId: 196920481
|
|
|
|
| |
PiperOrigin-RevId: 196565153
|
|
|
|
|
|
| |
exporting symbols to the TensorFlow API.
PiperOrigin-RevId: 194426855
|
|
|
|
|
|
|
|
|
|
| |
It turns out regular functions need to manually copy handle data in
addition to eager GraphModeFunctions, so I moved the C extensions to
python_api.h from eager/c_api.h.
This also cleans up function_test.py to assume the C API is enabled.
PiperOrigin-RevId: 194158700
|
|
|
|
|
|
|
|
|
| |
In some versions of Python, the Session._session field may be cleared
(in `Session.__del__()`) before a callable that has a reference to
that Session is deleted. Add a defensive check in the
`Session._Callable.__del__()` method.
PiperOrigin-RevId: 192679796
|
|
|
|
| |
PiperOrigin-RevId: 192388250
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes it so shapes are computed only when requested with
_USE_C_API = True. Note that the C API will still raise a shape error
if necessary when the op is created.
In addition, it cleans up the logic for _USE_C_SHAPES = True. In this
case, we lazily fetch and cache shapes directly from the C API. We no
longer need set_shapes_for_outputs at all in this case.
PiperOrigin-RevId: 191830565
|
|
|
|
| |
PiperOrigin-RevId: 191659944
|
|
|
|
|
|
|
|
| |
A C long is 32 bits on some platforms, which can cause the
PyInt_AsLong call in PyInt64ListToVector to
overflow. large_concat_op_test exposes this bug on such platforms.
PiperOrigin-RevId: 191484167
|
|
|
|
|
|
| |
Minor fixes to make this work.
PiperOrigin-RevId: 191457070
|
|
|
|
|
|
| |
This could cause failures when enabling the C API with python3.
PiperOrigin-RevId: 191350031
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change provides an alternative mechanism to
tf.raise_exception_on_not_ok_status(), which is inefficient and
error-prone (people often use the status multiple times in the with
block, but it's only checked when the context manager exits). Instead,
it uses SWIG to automatically raise an exception when a C API method
fails. Note that this removes the status argument from affected
methods.
For now, I've only applied this typemap to C API methods. It would be
good to expand this to all uses of raise_exception_on_not_ok_status.
PiperOrigin-RevId: 191121016
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
191029891 by xiejw:
Fix python script file.
--
191029336 by isaprykin:
Add .configure method to the whole hierarchy of DistributionStrategies.
--
191026971 by blamb:
Updates get_started nav and renames the beginner guides to include eager.
--
191025863 by mrry:
Add private Python API for accessing the C++ Session::*Callable API.
--
191025795 by mikecase:
Internal Change.
--
191024780 by isaprykin:
Internal change.
--
PiperOrigin-RevId: 191029891
|
|
|
|
| |
PiperOrigin-RevId: 191024677
|
|
|
|
|
|
|
|
| |
This change makes _set_shapes_for_outputs_c_api fetch and set
Tensor._handle_data. This is necessary for running the
Python shape inference code on resource tensors.
PiperOrigin-RevId: 190681459
|
|
|
|
| |
PiperOrigin-RevId: 190479555
|
|
|
|
|
|
|
|
| |
This change makes _set_shapes_for_outputs_c_api fetch and set
Tensor._handle_data. This is necessary for running the
Python shape inference code on resource tensors.
PiperOrigin-RevId: 190293303
|
|
|
|
| |
PiperOrigin-RevId: 190161440
|
|
|
|
| |
PiperOrigin-RevId: 189945839
|
|
|
|
|
|
|
| |
Without this change, shapes wouldn't be correctly computed for
operations created via import_graph_def.
PiperOrigin-RevId: 189670312
|