aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/framework
Commit message (Collapse)AuthorAge
* Small cleanup in function_test.Gravatar Gunhan Gulsoy2018-10-09
| | | | PiperOrigin-RevId: 216412380
* Avoid calling get_default_graph() during tf.enable_eager_execution()Gravatar Gunhan Gulsoy2018-10-08
| | | | PiperOrigin-RevId: 216270497
* Partial support tfe.defun in tf.gradients.Gravatar Alexandre Passos2018-10-08
| | | | | | | | Doesn't attempt to deal with cases where we might have already generated the functiondef for the parent function as in that case we cannot easily modify the forward pass. PiperOrigin-RevId: 216243224
* Avoid adding spurious ops when colocating with resource variables.Gravatar Asim Shankar2018-10-08
| | | | | | | | | | Prior to this change, tf.colocate_with(v) would insert spurious operations (a ReadVariableOp and an Identity) in the graph when v is a resource variable, and then colocate the operations within the block with those newly added, otherwise disconnected, operations. This commit avoids adding the unnecessary ReadVariableOp/Identity nodes and colocates operations within the block with the VarHandleOp. PiperOrigin-RevId: 216201638
* Do 2 warmup runs in assert_no_new_pyobjects_executing_eagerly.Gravatar Todd Wang2018-10-05
| | | | PiperOrigin-RevId: 215944829
* Fix documentation.Gravatar A. Unique TensorFlower2018-10-05
| | | | PiperOrigin-RevId: 215930596
* Re-enable the arithmetic optimizer by default in tests.Gravatar A. Unique TensorFlower2018-10-03
| | | | | | Add a warning to not disable optimizers without consulting with the Grappler team. PiperOrigin-RevId: 215584369
* 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
* | Updating function and class tf_export decorators for endpoints according toGravatar Anna R2018-10-01
| | | | | | | | | | | | | | | | | | | | | | https://github.com/tensorflow/community/pull/16. In addition to the changes in the doc, I made the following updates (these changes make sense to me and I didn't notice them when compiling the doc): * deprecate saved_model.builder.SavedModelBuilder - replaced with saved_model.SavedModelBuilder * deprecate python_io.tf_record_iterator - replaced with io.tf_record_iterator * deprecate python_io.TFRecordWriter - replaced with io.TFRecordWriter * move reduce_join to tf.string PiperOrigin-RevId: 215253944
* | Add flag for enabling while_v2.Gravatar Saurabh Saxena2018-09-28
| | | | | | | | | | | | | | | | | | | | Add a single test flag for enabling v2 control flow in tests since we do not plan to support v2 ops with legacy control flow. We have 2 test decorators now: @with_control_flow_v2: Enables all tests in a class to run with v2 control flow. @disable_control_flow_v2: Disables a test function from running in v2. I have removed the skiptests to avoid setup/teardown overheads. Enable tests in control_flow_ops_py_test that run with control_flow_v2. PiperOrigin-RevId: 214980108
| * Updated python3 tf_inspect.getargspec calls to use getfullargspec and ↵Gravatar IMBurbank2018-09-27
| | | | | | | | repackage the return values into the getargspec struct.
* | Updating the V2 variables API.Gravatar Alexandre Passos2018-09-27
| | | | | | | | PiperOrigin-RevId: 214824023
| * Update to use python 2-3 compatible function tf_inspect.getfullargspec.Gravatar IMBurbank2018-09-25
| |
* | Merge pull request #22006 from facaiy:CLN/remove_print_for_assertGravatar TensorFlower Gardener2018-09-24
|\ \ | |/ |/| | | PiperOrigin-RevId: 214335741
* | Merge pull request #22461 from feihugis:Issue-12414_Error_Logging_SessionGravatar TensorFlower Gardener2018-09-24
|\ \ | | | | | | | | | PiperOrigin-RevId: 214271324
* | | Add support for non-string attributesGravatar A. Unique TensorFlower2018-09-24
| | | | | | | | | | | | PiperOrigin-RevId: 214251264
* | | Add PinToHostOptimizer to grappler: force small ops to happen on CPU (instead ofGravatar A. Unique TensorFlower2018-09-22
| | | | | | | | | | | | | | | | | | GPU). This avoids many unnecessary CPU<->GPU memcpy and syncs. PiperOrigin-RevId: 214108484
| * | Disable the logging for OutofRangeError in testGravatar Fei Hu2018-09-22
| | |
| | * CLN: revise commentGravatar Yan Facai (颜发才)2018-09-20
| | |
* | | 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
* | | This CL adds a new `tf.print` operator that more closely aligns with the ↵Gravatar A. Unique TensorFlower2018-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | standard python `print` method, and deprecates the old `tf.Print` operator (to be removed in in v2.0). It follows the design doc specified in https://github.com/tensorflow/community/pull/14 and additionally incorporates the community feedback and design review decisions. This CL adds two new internal graph operators: a StringFormat operator that formats a template string with a list of input tensors to insert into the string and outputs a string scalar containing the result, and a PrintV2 operator that prints a string scalar to a specified output stream or logging level. The formatting op is exposed at `tf.strings.Format`. A new python method is exposed at `tf.print` that takes a list of inputs that may be nested structures and may contain tensors, formats them nicely using the formatting op, and returns a PrintV2 operator that prints them. In Eager mode and inside defuns this PrintV2 operator will automatically be executed, but in graph mode it will need to be either added to `sess.run`, or used as a control dependency for other operators being executed. As compared to the previous print function, the new print function: - Has an API that more closely aligns with the standard python3 print - Supports changing the print logging level/output stream - allows printing arbitrary (optionally nested) data structures as opposed to just flat lists of tensors - support printing sparse tensors - changes printed tensor format to show more meaningful summary (recursively print the first and last elements of each tensor dimension, instead of just the first few elements of the tensor irregardless of dimension). PiperOrigin-RevId: 213709924
* | | Add a new function to load kernel libraries and library folders.Gravatar Gunhan Gulsoy2018-09-18
| | | | | | | | | | | | PiperOrigin-RevId: 213549838
* | | Keep only weak references to variables in graph functionsGravatar Allen Lavoie2018-09-17
| | | | | | | | | | | | | | | | | | | | | | | | This enables cleanup of the variables referenced in defunned methods of objects when the object is garbage collected. Since one PolymorphicFunction is created per @defun, decorated methods before this change held on to all of the variables referenced in that method for any instance of the class (i.e. variables which should have been object-scoped were scoped to the lifetime of the class definition). Raises an exception if variables used in the function have been deleted when it is called, which means no local variables. PiperOrigin-RevId: 213337256
* | | [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
* | | 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
* | | Make control_flow_ops._ENABLE_COND_V2 public.Gravatar Skye Wanderman-Milne2018-09-11
| | | | | | | | | | | | | | | | | | | | | Note this is not part of the official public API, but we do allow other modules to modify this value (e.g. in tests). PiperOrigin-RevId: 212512883
* | | Merge pull request #22175 from yongtang:09102018-np.floatingGravatar TensorFlower Gardener2018-09-11
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 212456799
| | | * Merge branch 'master' into CLN/remove_print_for_assertGravatar Yan Facai (颜发才)2018-09-11
| | | |\ | |_|_|/ |/| | |
* | | | Resolving a bug where regex pattern for errors was not matching in case the ↵Gravatar A. Unique TensorFlower2018-09-10
| | | | | | | | | | | | | | | | | | | | | | | | error message had multiple newline characters. PiperOrigin-RevId: 212381070
* | | | 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: 212348850
* | | Merge pull request #22044 from yongtang:21164-default-floatGravatar TensorFlower Gardener2018-09-10
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 212314097
* | | | Fix unhelpful error messageGravatar A. Unique TensorFlower2018-09-10
| | | | | | | | | | | | | | | | | | | | | | | | For 99% of all usecases, if the expected shape differs from the actual shape, people will typically rerun with an additional print statement to see what the actual output was. PiperOrigin-RevId: 212303323
* | | | Fix code section in documentation of tf.enable_eager_execution().Gravatar A. Unique TensorFlower2018-09-09
| | | | | | | | | | | | | | | | PiperOrigin-RevId: 212211691
| | * | Fix np.float -> np.floating changeGravatar Yong Tang2018-09-09
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While running core_rnn_cell_test: ``` bazel test -s --verbose_failures --config=opt //tensorflow/contrib/rnn:core_rnn_cell_test ``` Noticed the following warning: ``` FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`. ``` This fix fixes the above warning. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* | | Add PyMemberDef for __dict__ on eager tensors.Gravatar Akshay Modi2018-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes dir() calls on instances of eager tensors so that it correctly accesses the __dict__ of EagerTensorType. Earlier it would fail due to an infinite "loop" in subtype_dict: https://github.com/python/cpython/blob/7e610bcdf128f61b925654e4fa80fbac83537d0e/Objects/typeobject.c#L2145 get_builtin_base_with_dict will return the same type (though I'm not sure this is reasonable behavior given its name). The __dict__ getter for the type is subtype_dict creating an infinite tail recursion. PiperOrigin-RevId: 212020695
* | | Documentation fix for TensorShape.__getitem__Gravatar A. Unique TensorFlower2018-09-06
| | | | | | | | | | | | | | | | | | RELNOTES: n/a PiperOrigin-RevId: 211804843
* | | Allow creating a py EagerTensor that shares the underlying TensorHandle.Gravatar Akshay Modi2018-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is so that gradients with respect to scalars pass (see the test added in backprop_test.py). A micro benchmark just calling constant_op.constant slows down a bit - this is inevitable as we are creating a new python object. After: walltime: ~2.1 Before: walltime: ~1.47 Linear regression benchmark is pretty much unchanged. PiperOrigin-RevId: 211753801
* | | Mark tf.GraphKeys.VARIABLES as deprecatedGravatar A. Unique TensorFlower2018-09-05
| | | | | | | | | | | | PiperOrigin-RevId: 211714574
* | | test_util.py: Allow use_gpu to change between calls to self.cached_session()Gravatar Asim Shankar2018-09-05
| | | | | | | | | | | | | | | | | | | | | | | | use_gpu does not affect the creation of the session, it only affects the context manager in which nodes are added to the graph, so it should not be included in the consistency check. PiperOrigin-RevId: 211659833
* | | Update `make_tensor_proto` docs to reference public symbol for `make_ndarray`.Gravatar Tom Hennigan2018-09-05
| | | | | | | | | | | | PiperOrigin-RevId: 211592901
| * | Update include order of the header files in python_op_gen_internal.cc,Gravatar Yong Tang2018-09-05
| | | | | | | | | | | | | | | | | | to conform to `Experimental clang-format Check` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* | | 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
* | | Remove reference cycles when constructing distribution objectsGravatar Allen Lavoie2018-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | self -> _parameters -> self cycles were creating work for Python's garbage collector in training loops, where Distribution objects may be created repeatedly when executing eagerly. This CL just fixes that narrow memory issue; I'm not convinced dict(locals()) is super efficient, so we may want to follow up on that for performance. Adds a few unit tests tests with run_test_in_graph_and_eager_modes(assert_no_eager_garbage=True). It'd be nice to expand this coverage over time. Includes a small test_util simplification to support this (TFP tests don't like reset_default_graph for some reason). Testing for cycles in the TFP repo will need to wait on the Normal changes from the TF repo syncing. PiperOrigin-RevId: 211520394
| * | Sanitize with clang-foramtGravatar Yong Tang2018-09-04
| | | | | | | | | | | | Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
| * | Add precision to match the existing behavior.Gravatar Yong Tang2018-09-04
| | | | | | | | | | | | Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
| * | Fix syntax error in single_image_random_dot_stereograms caused by localeGravatar Yong Tang2018-09-04
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix tries to address the issue raised in 21164 where the single_image_random_dot_stereograms in different locale (like de_DE) caused syntax error in python like: ``` File "<string>", line 28 def single_image_random_dot_stereograms(depth_values, hidden_surface_removal=True, convergence_dots_size=8, dots_per_inch=72, eye_separation=2,5, mu=0,333299994, normalize=True, normalize_max=-100, normalize_min=100, border_level=0, number_colors=256, output_image_shape=[1024, 768, 1], output_data_window=[1022, 757], name=None): ^ SyntaxError: invalid syntax ``` The issue was that the float to string conversion in python_op_gen_internal.cc triggered snprintf (in `FloatToBuffer`) which is local dependent and generates something like `eye_separatiion=2,5` in DE locale. This fix replaced the float to string conversion with locale-independent ``` std::ostringstream s; s.imbue(std::locale::classic()); ``` This fix fixes 21164. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
| * CLN: remove print method, and append error msg to exceptionGravatar Yan Facai (颜发才)2018-09-01
|/
* Currently there are two formats for error reporting inside TensorFlow. This ↵Gravatar A. Unique TensorFlower2018-08-31
| | | | | | is first of a series of CL to merge these into one. In this change, we remove the format tag from the errors. PiperOrigin-RevId: 211146036
* Merge pull request #21970 from superbobry:pickleable-errorsGravatar TensorFlower Gardener2018-08-31
|\ | | | | | | PiperOrigin-RevId: 211145467