| Commit message (Collapse) | Author | Age |
|
|
|
| |
PiperOrigin-RevId: 216230391
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| | |
PiperOrigin-RevId: 215480021
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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
|
| |
| |
| |
| | |
repackage the return values into the getargspec struct.
|
| |
| |
| |
| | |
PiperOrigin-RevId: 214781911
|
| |
| |
| |
| |
| |
| | |
functools.partial are triggered.
PiperOrigin-RevId: 214775194
|
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| | |
Remove subsection of added tests that were problematic.
|
| |
| |
| |
| | |
PiperOrigin-RevId: 214587760
|
|/ |
|
|
|
|
| |
PiperOrigin-RevId: 214067946
|
|
|
|
| |
PiperOrigin-RevId: 212847619
|
|
|
|
| |
PiperOrigin-RevId: 212828094
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 212551965
|
|
|
|
| |
PiperOrigin-RevId: 212516939
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 212177437
|
|
|
|
| |
PiperOrigin-RevId: 212054927
|
|
|
|
| |
PiperOrigin-RevId: 209977319
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 209637025
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| | |
PiperOrigin-RevId: 207998390
|
| |
| |
| |
| | |
PiperOrigin-RevId: 207956477
|
| |
| |
| |
| | |
PiperOrigin-RevId: 207933109
|
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
PiperOrigin-RevId: 207570391
|
| |
| |
| |
| |
| |
| |
| | |
inspect.getargspec raises errors if they are present but getfullargspec is
perfectly happy to let functions with type annotations pass.
PiperOrigin-RevId: 207127930
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
functool.partial.
PiperOrigin-RevId: 206175973
|
| |
| |
| |
| |
| |
| | |
interpolation.
PiperOrigin-RevId: 206120307
|
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
Also update how canonical endpoint name is set in doc_generator_visitor.py.
PiperOrigin-RevId: 204841165
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
PiperOrigin-RevId: 204493360
|
| |
| |
| |
| |
| |
| | |
messages returned from C++.
PiperOrigin-RevId: 204455158
|
| |
| |
| |
| | |
PiperOrigin-RevId: 204368026
|
| |
| |
| |
| |
| |
| |
| |
| | |
(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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
PiperOrigin-RevId: 203779105
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|
|
|
| |
PiperOrigin-RevId: 201652888
|
|
|
|
|
|
| |
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
|