aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/util
Commit message (Collapse)AuthorAge
* Fix a couple of reference leaksGravatar A. Unique TensorFlower2018-10-08
| | | | PiperOrigin-RevId: 216230391
* Fix api_compatibility_test diff for large files. assertEqual might be appliedGravatar Anna R2018-10-05
| | | | | | | | instead of assertMultiLineEqual if input is too large (https://bugs.python.org/issue11763). This change is switching to use unified_diff in that case. PiperOrigin-RevId: 215987656
* Merge pull request #22517 from IMBurbank:masterGravatar TensorFlower Gardener2018-10-02
|\ | | | | | | PiperOrigin-RevId: 215480021
* | Minor speed improvements to defun.Gravatar Akshay Modi2018-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - EncodeArg in C instead of python. - Also caches parsed device specs, and device spec hashes - Adds a common way to register python types in C. - Fastpath canonicalize function inputs when no kwargs are passed - Set the func name attr directly instead of creating an op to wrap it. - Rewrite IsAttrsHelper without caching Before: entry { name: "MicroBenchmarks.benchmark_defun_matmul_2_by_2_CPU" iters: 30000 wall_time: 101.803263028 extras { key: "examples_per_sec" value { double_value: 9822.86785562 } } } After: entry { name: "MicroBenchmarks.benchmark_defun_matmul_2_by_2_CPU" iters: 30000 wall_time: 47.2899993261 extras { key: "examples_per_sec" value { double_value: 21146.1199884 } } } PiperOrigin-RevId: 215272962
| * Updated python3 tf_inspect.getargspec calls to use getfullargspec and ↵Gravatar IMBurbank2018-09-27
| | | | | | | | repackage the return values into the getargspec struct.
* | Added nest support for attr.s decorated classes.Gravatar A. Unique TensorFlower2018-09-27
| | | | | | | | PiperOrigin-RevId: 214781911
* | Update HasKwargsTest ensuring that internal checks for tests involving ↵Gravatar A. Unique TensorFlower2018-09-27
| | | | | | | | | | | | functools.partial are triggered. PiperOrigin-RevId: 214775194
* | Update logic used in get_variable to populate custom_getter's kwargs.Gravatar A. Unique TensorFlower2018-09-27
| | | | | | | | | | | | The new implementation ensures that the 'constraints' kwarg is propagated by customer getters whose signature includes a keyworded, variable length argument dictionary, as well as those explicitly including the 'constraints' argument. PiperOrigin-RevId: 214767296
| * Update tf_inspect_test.pyGravatar Isaac Burbank2018-09-26
| | | | | | Remove subsection of added tests that were problematic.
* | Refactoring of nest value getters.Gravatar A. Unique TensorFlower2018-09-26
| | | | | | | | PiperOrigin-RevId: 214587760
| * Update to use python 2-3 compatible function tf_inspect.getfullargspec.Gravatar IMBurbank2018-09-25
|/
* [TF nest] Better error messages showing full structures on assert_same_structureGravatar Eugene Brevdo2018-09-21
| | | | PiperOrigin-RevId: 214067946
* Automated rollback of commit 56d4fc8ff67f48294ae5cb0a7f9ff3d954463aa3Gravatar A. Unique TensorFlower2018-09-13
| | | | PiperOrigin-RevId: 212847619
* Add a `namedtuple` factory that accepts doc-strings.Gravatar Mark Daoust2018-09-13
| | | | PiperOrigin-RevId: 212828094
* Use WeakKeyDictionaries for global Keras {graph->...} mapsGravatar Igor Ganichev2018-09-12
| | | | | | | | | | | | These globals were holding onto graphs including FuncGraphs, which held onto captured tensors leaving garbage around. This change also adds a test to catch garbage like this in the future. To make the test work, I needed to manually breakup some reference cycles caused by OrderedDicts. We should probably have a custom impl of OrderedDict similar to the one in Python3 and avoid these issues. PiperOrigin-RevId: 212694290
* Automated rollback of commit d31f360e1574553ed23b8d483512a2065ac426ebGravatar A. Unique TensorFlower2018-09-11
| | | | PiperOrigin-RevId: 212551965
* Adds generator support directly to Keras's fit, evaluate, and predict.Gravatar A. Unique TensorFlower2018-09-11
| | | | PiperOrigin-RevId: 212516939
* 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
* Automated rollback of commit 39b2fb7cfef489424fead18ec5174d8e8b2a9a1aGravatar Akshay Modi2018-09-09
| | | | PiperOrigin-RevId: 212177437
* Remove unnecessary function calls from data/util/nest.pyGravatar Akshay Modi2018-09-07
| | | | PiperOrigin-RevId: 212054927
* Internal Change.Gravatar Michael Case2018-08-23
| | | | PiperOrigin-RevId: 209977319
* [tf.data] Fixes error in `dataset.concatenate()`, now throws error if two ↵Gravatar Shivani Agrawal2018-08-22
| | | | | | | | | input datasets are of type dictionaries with different set of key(s). FIXES #20626 REL_NOTES: bug fix in `tf.data.Dataset.concatenate()`, now throws error if trying to concatenate two datasets of type dictionaries with different set of key(s). PiperOrigin-RevId: 209845337
* Internal Change.Gravatar Michael Case2018-08-21
| | | | PiperOrigin-RevId: 209637025
* Add a benchmark for forward+backward for defuns.Gravatar Akshay Modi2018-08-17
| | | | | | | | | | | | Also fix some simple issues that I saw when I benchmarked it (goes from ~3500 examples/sec -> ~4000 examples/sec) - (nest) Expose is_mapping check that caches to python. - (nest) Stop calling flatten when unnecessary in pack_sequence_as - (nest) Set some functions to their swig wrappers directly (instead of wrapping them in another function) - Directly call the gen_math_ops call in _aggregate_grads to skip any unnecessary python overhead. - Stop falling back to slow path in _fast_fill. PiperOrigin-RevId: 209223633
* Merge branch 'master' into masterGravatar Jan Hünnemeyer2018-08-09
|\
| * Automated rollback of commit 80dae290b7d4e24b005d419da866f2c22410d818Gravatar Eugene Brevdo2018-08-08
| | | | | | | | PiperOrigin-RevId: 207998390
| * Automated rollback of commit 151aed209dc5e11059046367a3a115bba324800dGravatar Eugene Brevdo2018-08-08
| | | | | | | | PiperOrigin-RevId: 207956477
| * Bring back TFShouldUse without the memory leaks.Gravatar Eugene Brevdo2018-08-08
| | | | | | | | PiperOrigin-RevId: 207933109
| * Refactor Sequential model to make it behave exactly like a subclassed ↵Gravatar Francois Chollet2018-08-08
| | | | | | | | | | | | network unless it receives an input_shape argument with its first layer. In particular in graph mode no placeholder gets created by a Sequential model (unless an input shape is provided). PiperOrigin-RevId: 207921752
| * More getargspec cleanups.Gravatar Alexandre Passos2018-08-06
| | | | | | | | PiperOrigin-RevId: 207570391
| * Do not panic on type annotations in python3 for layers / functions passed to TF.Gravatar Alexandre Passos2018-08-02
| | | | | | | | | | | | | | inspect.getargspec raises errors if they are present but getfullargspec is perfectly happy to let functions with type annotations pass. PiperOrigin-RevId: 207127930
| * Fix custom mapping comparisons in the nest utilityGravatar Allen Lavoie2018-08-01
| | | | | | | | | | | | | | | | Previously it checked that one object was a mapping before using PyDict methods on the second one being compared. Now checks that both are dicts and falls back to PyMapping methods otherwise. Also fixes exception propagation for this section of code. PiperOrigin-RevId: 206957412
| * Add map_structure_with_paths to util.nest.Gravatar A. Unique TensorFlower2018-07-31
| | | | | | | | | | | | map_structure_with_paths is like map_structure, except that the string path of each leaf in the structure is passed as the first argument to the function. This can be used for example to create variables whose names are derived from the string path. PiperOrigin-RevId: 206776927
| * Make function_utils.get_func_code more tolerant of strange objects like ↵Gravatar A. Unique TensorFlower2018-07-26
| | | | | | | | | | | | functool.partial. PiperOrigin-RevId: 206175973
| * Convert device function stack into TraceableStack for use in error message ↵Gravatar A. Unique TensorFlower2018-07-26
| | | | | | | | | | | | interpolation. PiperOrigin-RevId: 206120307
| * 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
| * Add support for custom mapping types to util.nestGravatar Allen Lavoie2018-07-24
| | | | | | | | | | | | | | | | | | | | Analagous to the existing support for custom collections.Sequence types. They need to be constructable with the same arguments as the base type for pack_sequence_as to work. Leaves PyDict_* calls for dict subclasses, but adds more general (and likely much slower) fallbacks for instances of collections.Mapping which are not dict subclasses. My hope is that this support will be enough so I can use a wrapper around dicts which does not inherit from dict in __setattr__ tracking (some tests failed without it). Inheriting from dict and properly shadowing a real dict seems impossible with CPython (since to shadow without synchronization issues, the wrapper needs to respond to updates to the original dict, but to work with e.g. {}.update(dict_subclass) the wrapper's C storage needs to also be updated). PiperOrigin-RevId: 205858082
| * Handle deprecated fields in api_def.proto.Gravatar Anna R2018-07-16
| | | | | | | | | | | | Also update how canonical endpoint name is set in doc_generator_visitor.py. PiperOrigin-RevId: 204841165
| * BEGIN_PUBLICGravatar A. Unique TensorFlower2018-07-16
| | | | | | | | | | | | | | | | | | | | | | Add initial support for interpolating filename and line number in error messages returned from C++. END_PUBLIC RELEASE_NOTES: n/a Automated rollback of commit 8e7d3dc7326bb81ef55175c48f51436408219c4a PiperOrigin-RevId: 204755755
| * Automated rollback of commit 895a7667884545a68480eb91916a5a23c2852308Gravatar Smit Hinsu2018-07-13
| | | | | | | | PiperOrigin-RevId: 204493360
| * Add initial support for interpolating filename and line number in error ↵Gravatar A. Unique TensorFlower2018-07-13
| | | | | | | | | | | | messages returned from C++. PiperOrigin-RevId: 204455158
| * Support passing TensorFlow API names as a separate v1 argument to tf_export.Gravatar Anna R2018-07-12
| | | | | | | | PiperOrigin-RevId: 204368026
| * Add TraceableStack object and use it for the colocation stack to improve ↵Gravatar A. Unique TensorFlower2018-07-12
| | | | | | | | | | | | | | | | (future) error messages. The TraceableStack directly manages TraceableObjects. The TraceableStack object acts as a regular stack for arbitrary objects. Its object-encapsulation class, TraceableObject, includes metadata fields including an arbitrary name, and members and methods to track the filenames and line numbers of callers of the stack's call push_obj(). The contents of a TraceableStack can easily be summarized by a dict mapping the TraceableObject.name to new TraceableObjects that contain only the name, file, and line number metadata. This is useful for constructing public return values. PiperOrigin-RevId: 204288464
| * Make sure correct docs are generated when using @deprecated_aliasGravatar Anna R2018-07-10
| | | | | | | | | | | | | | | | | | decorator. Specifically, wrap `NewClass.__init__` method using tf_decorator.make_decorator so that doc generation can pick up correct arguments for `__init__` instead of *args, **kwargs. Also, skip _NewClass when generating API goldens. PiperOrigin-RevId: 204013970
| * Adding getsourcefile and getsourcelines to tf_inspect.Gravatar A. Unique TensorFlower2018-07-09
| | | | | | | | PiperOrigin-RevId: 203779105
| * 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
* | Utilizing dict comprehensionGravatar Jan Horst Hünnemeyer2018-06-29
|/
* 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
* Replace unnecessary `()` in `run_in_graph_and_eager_modes()`.Gravatar Tom Hennigan2018-06-22
| | | | PiperOrigin-RevId: 201652888
* Add a lock that allows many members of a group to access a resource ↵Gravatar Priya Gupta2018-06-21
| | | | | | exclusively. This will be used to allow multiple threads to construct the graph at the same time, while preventing other threads from running the graph. PiperOrigin-RevId: 201623946