aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/client
Commit message (Collapse)AuthorAge
* Allow testManyCPUs to encounter non-CPU devices.Gravatar Todd Wang2018-09-28
| | | | PiperOrigin-RevId: 214932861
* Updating the V2 variables API.Gravatar Alexandre Passos2018-09-27
| | | | PiperOrigin-RevId: 214824023
* Remove unneeded locks in session logging.Gravatar Russell Power2018-09-25
| | | | PiperOrigin-RevId: 214521486
* Added fetch support for attrs classes.Gravatar A. Unique TensorFlower2018-09-21
| | | | | | | | | | | | | | | | | | | | 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
* Implement TF graph capture.Gravatar Russell Power2018-09-20
| | | | PiperOrigin-RevId: 213875284
* Copy Tensor._handle_data from external_capture to placeholder for Variant ↵Gravatar Saurabh Saxena2018-09-19
| | | | | | | | | | 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
* Modify Timeline Analysis to consider allocations in order.Gravatar A. Unique TensorFlower2018-09-19
| | | | PiperOrigin-RevId: 213589710
* Disable the flaky test case in timeline_testGravatar Gunhan Gulsoy2018-09-14
| | | | PiperOrigin-RevId: 213034078
* [TF] Update strings to run on device:CPUGravatar A. Unique TensorFlower2018-09-13
| | | | | | | /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
* Move from deprecated self.test_session() to self.cached_session().Gravatar A. Unique TensorFlower2018-09-10
| | | | | | | | 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
* Allow gradients() calls from inside a tfe.defun wrt captured tensors.Gravatar Skye Wanderman-Milne2018-09-05
| | | | | | | | This modifies https://github.com/tensorflow/tensorflow/commit/834da2c3fddab1bbbce742db572cfe65dd320fcd to work with tfe.defun in addition to the legacy Defun implementation. PiperOrigin-RevId: 211663702
* Merge pull request #21951 from minggli:doc/sessionGravatar TensorFlower Gardener2018-09-04
|\ | | | | | | PiperOrigin-RevId: 211581348
* | There were two different error reporting formats within TensorFlow: `{{key ↵Gravatar A. Unique TensorFlower2018-09-04
| | | | | | | | | | | | value}}` and `^^key:value^^`. This change consolidate these two format. PiperOrigin-RevId: 211550259
| * minor typo in `make_callable` method.Gravatar Ming Li2018-08-29
|/
* Remove magic-doc-links from code.Gravatar Mark Daoust2018-08-16
| | | | | | | | | | 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
* Remove usage of magic-api-link syntax from source files.Gravatar Mark Daoust2018-08-09
| | | | | | | | | | | | | | | | | | | | 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
* Enable error interpolation in Python.Gravatar James Keeling2018-07-31
| | | | | | | | | | 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
* Adding NodeDef names to error messages for better debuggability.Gravatar A. Unique TensorFlower2018-07-27
| | | | | | | The format used is as follows: {{node <node_name>}} PiperOrigin-RevId: 206370355
* Automated rollback of commit b8a9d163d9cbb4b581c044d9c4b1b256c801a9c4Gravatar Russell Power2018-07-26
| | | | PiperOrigin-RevId: 206166233
* Dictionary tracking for tf.keras.Model attribute assignmentGravatar Allen Lavoie2018-07-24
| | | | | | 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
* Automated rollback of commit 8048b3a53d5a919fef74874fcffbec9039e6acd1Gravatar Russell Power2018-07-23
| | | | PiperOrigin-RevId: 205679162
* Destroy tf.Session when the session is closed.Gravatar Russell Power2018-07-23
| | | | | | | | 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
* Expose each device's incarnation via `Session.list_devices()`.Gravatar Derek Murray2018-07-19
| | | | PiperOrigin-RevId: 205273020
* Auto tracking for Python lists assigned to attributes of Model/CheckpointableGravatar Allen Lavoie2018-06-29
| | | | | | | | | | | | 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
* Guard ops modification and Session.run with a group lock. This lock allows ↵Gravatar Priya Gupta2018-06-25
| | | | | | 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
* Use PyLong_FromLongLong to convert 64-bit ints in SWIG code.Gravatar Skye Wanderman-Milne2018-06-20
| | | | | | | 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
* Enable fetching shapes from the C API by default.Gravatar Skye Wanderman-Milne2018-06-15
| | | | | | | | | | | | | | | | | 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
* Add a `run_metadata` keyword arg for `Session._make_callable_from_options()`.Gravatar Derek Murray2018-06-12
| | | | | | | | 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
* Remove _USE_C_API staging from session.py.Gravatar Skye Wanderman-Milne2018-06-07
| | | | PiperOrigin-RevId: 199641205
* Update SessionTest.testFeedShapeCompatibility to work with C API enabled.Gravatar Skye Wanderman-Milne2018-05-17
| | | | | | | | | | | | | | | | 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
* Remove _USE_C_API staging in tests now that the C API is enabled by default.Gravatar Skye Wanderman-Milne2018-05-16
| | | | | | This is in preparation for removing the _USE_C_API toggle altogether. PiperOrigin-RevId: 196920481
* Reenable virtual gpu test, and decrease the number of testing rounds.Gravatar Guangda Lai2018-05-14
| | | | PiperOrigin-RevId: 196565153
* Removing @@ comments from core TensorFlow. They are no longer needed for ↵Gravatar Anna R2018-04-26
| | | | | | exporting symbols to the TensorFlow API. PiperOrigin-RevId: 194426855
* Make TF functions work with _USE_C_SHAPES=True.Gravatar Skye Wanderman-Milne2018-04-24
| | | | | | | | | | 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
* Check if the session has been deleted before releasing a callable.Gravatar Derek Murray2018-04-12
| | | | | | | | | 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
* Merge changes from github.Gravatar Michael Case2018-04-10
| | | | PiperOrigin-RevId: 192388250
* Lazily evaluate shapes with the C API enabled.Gravatar Skye Wanderman-Milne2018-04-05
| | | | | | | | | | | | 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
* Adding Operation._control_outputsGravatar Alexandre Passos2018-04-04
| | | | PiperOrigin-RevId: 191659944
* Use PyLong_AsLongLong instead of PyInt_AsLong to guarantee 64-bit output.Gravatar Skye Wanderman-Milne2018-04-03
| | | | | | | | 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
* Apply "Raise exception in SWIG on bad TF_Status" to base.iGravatar Akshay Modi2018-04-03
| | | | | | Minor fixes to make this work. PiperOrigin-RevId: 191457070
* ResourceHandleShapeAndType returns bytes, not unicode.Gravatar Skye Wanderman-Milne2018-04-02
| | | | | | This could cause failures when enabling the C API with python3. PiperOrigin-RevId: 191350031
* Raise exception in SWIG on bad TF_Status from C API.Gravatar Skye Wanderman-Milne2018-03-30
| | | | | | | | | | | | | | | 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
* Merged commit includes the following changes:Gravatar A. Unique TensorFlower2018-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Internal changeGravatar Yuefeng Zhou2018-03-29
| | | | PiperOrigin-RevId: 191024677
* Make _USE_C_API = True and _USE_C_SHAPES = False work with handle data, take 2.Gravatar Skye Wanderman-Milne2018-03-27
| | | | | | | | 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
* Automated g4 rollback of changelist 190293303Gravatar A. Unique TensorFlower2018-03-26
| | | | PiperOrigin-RevId: 190479555
* Make _USE_C_API = True and _USE_C_SHAPES = False work with handle data.Gravatar Skye Wanderman-Milne2018-03-25
| | | | | | | | 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
* Merge changes from github.Gravatar Benoit Steiner2018-03-22
| | | | PiperOrigin-RevId: 190161440
* Merge changes from github.Gravatar Jacques Pienaar2018-03-21
| | | | PiperOrigin-RevId: 189945839
* Make _USE_C_API = True and_USE_C_SHAPES = False work with import_graph_def.Gravatar Skye Wanderman-Milne2018-03-19
| | | | | | | Without this change, shapes wouldn't be correctly computed for operations created via import_graph_def. PiperOrigin-RevId: 189670312