aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/lib
Commit message (Collapse)AuthorAge
* 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 compression options to Python's TFRecordOptionsGravatar A. Unique TensorFlower2018-09-06
| | | | | | Plumb these through to RecordWriterOptions PiperOrigin-RevId: 211894734
* Support converting eager tensor to tf.float16 if a numpy half is passed.Gravatar Akshay Modi2018-09-05
| | | | | | This still defaults to float32 for all normal floats. PiperOrigin-RevId: 211704918
* Replaced calls to tensorflow::StringPiece::ToString with string conversions.Gravatar A. Unique TensorFlower2018-08-22
| | | | | | | | That is, instances of sp.ToString() are replaced with string(sp). This will allow tensorflow::StringPiece::ToString to be removed, which is necessary before it can be replaced with absl::string_view. PiperOrigin-RevId: 209806694
* fix C++ header guards.Gravatar A. Unique TensorFlower2018-08-21
| | | | PiperOrigin-RevId: 209679086
* EIGEN_MAX_ALIGN_BYTES can be zero when vectorization is disabled. In that ↵Gravatar A. Unique TensorFlower2018-08-20
| | | | | | case, checking for alignment boundaries breaks due to division by zero. But in these cases the check itself is redundant, so replace EIGEN_MAX_ALIGN_BYTES with std::max(1, EIGEN_MAX_ALIGN_BYTES). PiperOrigin-RevId: 209513729
* Add out_status to py_record_writer.writeGravatar A. Unique TensorFlower2018-08-16
| | | | | | Throw in TFRecordWriter.write() if write fails PiperOrigin-RevId: 209030158
* 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
* Merge pull request #21319 from tensorflow:mrry-patch-1Gravatar TensorFlower Gardener2018-08-09
|\ | | | | | | PiperOrigin-RevId: 208075630
* | Fix build issue on mac with python-2.7.10 and clang 9.1.0Gravatar Yong Tang2018-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In PR 19993 the build issues on macOS with python2.7.10 and clang-9.1.0 were fixed. However, later on it looks like the order of `<locale>` and `<Python.h>` has been changed in https://github.com/tensorflow/tensorflow/commit/1e7b0e4ad6d0f57f3241fe0b80a65f2c2a7f11b0 possibly caused by `clang-format -i --style=`. This caused the build break of macOS with python-2.7.10 and clang 9.1.0 again. This fix updates the impacted files, and, adds an empty line in between so that future `clang-format -i --style` will not cuase build breaks. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* | Add nullptr checks so that Write() and Flush() fail instead of segfaultGravatar A. Unique TensorFlower2018-08-06
| | | | | | | | PiperOrigin-RevId: 207596283
* | Change PyRecordWriter destructor order so that file_ is still available for ↵Gravatar A. Unique TensorFlower2018-08-03
| | | | | | | | | | | | writing when writer_ destructor is called PiperOrigin-RevId: 207355721
* | Fix potential use-after-free bug introduced in commitGravatar Asim Shankar2018-08-02
| | | | | | | | | | | | abb903df7a5998b33547c02e95f9fa47c00f31f4 PiperOrigin-RevId: 207145802
| * Add a defensive comment about the TOCTOU raceGravatar Derek Murray2018-08-02
| |
* | Python 3.7 Compatibility: Py_UnicodeAsUTF8AndSize() returns a "const char*"Gravatar Asim Shankar2018-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of a "char*". (See https://docs.python.org/3/whatsnew/3.7.html#c-api-changes) There are additional changes needed for Python 3.7 compatibility, this change just pulls out one of them (and subsumes a related attempt in #21202 and #20766) Helps with #20517 PiperOrigin-RevId: 207008013
| * [tf.py_func()] Check Python interpreter state before callGravatar Derek Murray2018-08-01
|/ | | Attempting to acquire the GIL in a destructor when the process is terminating can fail, leading to a hang. Fixes #21277.
* Fix import order in interpreter_wrapper.h.Gravatar Nupur Garg2018-07-13
| | | | PiperOrigin-RevId: 204429340
* [eager]: Fix bug in converting pandas objects to Tensors.Gravatar Asim Shankar2018-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, fix a segmentation fault when converting objects that implement the Python sequence protocol (i.e., __getitem__, __len__, and __iter__) but which do not have contiguous keys. Fixes #20347 However, there are still some discrepancies possible between tf.convert_to_tensor(o) (or tf.constant(o)) with and without eager execution enabled. Fixing those is left as a follow up excercise. Sample differences: (1) Empty sequences that have numpy conversions defined. import pandas as pd import tensorflow as tf s = pd.Series([]) # Empty series t = tf.constant(s) With eager execution enabled, t.dtype ends up with a dtype of float32 (as py_seq_tensor.cc considers empty lists to be float32) With graph construction, t.dtype ends up with a dtype of float64 (as make_tensor_proto() converts 's' to a numpy array and uses its dtype). (2) Objects that implement __getitem__, __len__, and __iter__, but are not convertible to numpy arrays (e.g., do not implement __array__): - With eager execution enabled, these can be converted to a tensor - For graph construction, the conversion fails. PiperOrigin-RevId: 203019624
* Merge changes from github.Gravatar Mingxing Tan2018-06-28
| | | | PiperOrigin-RevId: 202585094
* Extract tf_record_test.py from reader_ops_test.pyGravatar A. Unique TensorFlower2018-06-18
| | | | PiperOrigin-RevId: 201071448
* [TF:XLA] Add a XlaSort operator that directly wraps the Sort HLO.Gravatar Peter Hawkins2018-06-18
| | | | | | | | Merge XLA-specific operator registrations into a single file rather than having many tiny files. In passing, register a fill function for bfloat16 numpy type; needed for the np.arange() call in the sort unit test. PiperOrigin-RevId: 201005718
* [py_func]: Fix #20021Gravatar Asim Shankar2018-06-15
| | | | | | | | | | | | | | | | * EagerPyFunc now validates its assumption that returned tensors are backed by memory on the same device that the EagerPyFunc kernel executed on. * Make the Python trampolining mechanism ensure that this requirement of the kernel is met. * Allow tf.contrib.eager.py_func to execute correctly on devices other than CPU and GPU:0. Prior to this change, tf.contrib.eager.py_func() would copy data from CPU to GPU:0 if necessary, but not the other way around. As a result, the assumptions made by the EagerPyFunc kernel implementation about the placement of returned tensors would be violated. The test added in py_func_test.py, when executed on a machine with a GPU will: - Fail with a segmentation fault (dereferencing GPU memory) without the changes to py_func.cc and script_ops.py - Fail with an error message with the change to py_func.cc but without the change to script_ops.py - Pass with changes to py_func.cc and script_ops.py PiperOrigin-RevId: 200792057
* Ask NumPy for read only array when converting it to Tensor.Gravatar Eugene Zhulenev2018-06-08
| | | | | | | | | | | | | | Fix for: #17315 If numpy array is read-only, calling PyArray_FromAny with NPY_ARRAY_CARRAY flags introduce extra memory copy. Before: feed_cpu_variable_read_only: 5.6 GB/sec, min: 17.99, median: 19.54, mean: 19.76 After: feed_cpu_variable_read_only: 13.2 GB/sec, min: 7.60, median: 7.78, mean: 8.13 PiperOrigin-RevId: 199835695
* Use memmove instead of memcpy for the large tensors on Linux.Gravatar Eugene Zhulenev2018-06-06
| | | | | | | | | | | | | | | | | Issue: #17246 ~1.7x speedup for fetching a variable Before: fetch_cpu_variable : 5.5 GB/sec, min: 14.56, median: 15.05, mean: 15.14 fetch_cpu_variable_add: 11.0 GB/sec, min: 7.29, median: 12.03, mean: 12.56 fetch_cpu_variable_concat: 11.6 GB/sec, min: 6.92, median: 13.78, mean: 14.76 After: fetch_cpu_variable : 9.2 GB/sec, min: 8.71, median: 8.79, mean: 8.80 fetch_cpu_variable_add: 12.5 GB/sec, min: 6.41, median: 7.20, mean: 7.51 fetch_cpu_variable_concat: 12.7 GB/sec, min: 6.32, median: 6.54 PiperOrigin-RevId: 199497691
* When converting a numpy float64 to an EagerTensor, always ensure that itGravatar Akshay Modi2018-05-24
| | | | | | | | | becomes a float64 tensor. Earlier py_seq_tensor would fall back to a float32 if not explicitly requesting a float64 (which would not happen if we had no other information). PiperOrigin-RevId: 197977260
* Resolve name collisions with assets in SavedModels by deduplicating names thatGravatar Karmel Allison2018-05-23
| | | | | | point to distinct files. PiperOrigin-RevId: 197835288
* Internal cleanup to remove a difference from the code on github.Gravatar A. Unique TensorFlower2018-05-23
| | | | PiperOrigin-RevId: 197817738
* ClangTidy - Readability cleanup:/code-findings-fixes.Gravatar A. Unique TensorFlower2018-05-14
| | | | | | | | | | * unused using-declarations * redundant string conversions * C-style casts * redundant get() call on smart pointer * the 'empty' method should be used to check for emptiness instead of 'size' PiperOrigin-RevId: 196585984
* Make CPython implementation function type-correct, which removes UB from ↵Gravatar A. Unique TensorFlower2018-05-13
| | | | | | calling a function through a pointer of the wrong type, and also removes a C-style cast. PiperOrigin-RevId: 196428430
* 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
* Removing remove_undocumented calls from tensorflow/python.Gravatar Anna R2018-04-25
| | | | PiperOrigin-RevId: 194274698
* Merge changes from github.Gravatar Yifei Feng2018-04-23
| | | | PiperOrigin-RevId: 194031845
* Fix for: Suggest braces around initialization of subobject.Gravatar Brian Patton2018-04-20
| | | | PiperOrigin-RevId: 193717872
* Change the TF record reader to use 16MB buffering by default in order to ↵Gravatar A. Unique TensorFlower2018-04-20
| | | | | | improve performance. PiperOrigin-RevId: 193685521
* 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
* Replaced calls to deprecated tensorflow::StringPiece methods with theirGravatar A. Unique TensorFlower2018-04-02
| | | | | | | | tensorflow::str_util equivalents. This will allow the deprecated methods to be removed. PiperOrigin-RevId: 191350894
* 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
* Fix buffer overflow when fetching resources.Gravatar Alexandre Passos2018-03-25
| | | | PiperOrigin-RevId: 190273682
* Moves TensorHandle to common_runtimeGravatar Alexandre Passos2018-03-25
| | | | PiperOrigin-RevId: 190265301
* Merge changes from github.Gravatar Jacques Pienaar2018-03-21
| | | | PiperOrigin-RevId: 189945839
* Automated g4 rollback of changelist 189231636Gravatar A. Unique TensorFlower2018-03-15
| | | | PiperOrigin-RevId: 189258641
* Merge changes from github.Gravatar Jacques Pienaar2018-03-15
| | | | PiperOrigin-RevId: 189231636
* Fix another eager PyObject leakGravatar Allen Lavoie2018-03-12
| | | | | | Shockingly this one was also due to PySequence_GetItem. PiperOrigin-RevId: 188765548
* Extend TF Eager C API to allow asynchronous execution.Gravatar A. Unique TensorFlower2018-03-12
| | | | PiperOrigin-RevId: 188763442
* py_func attaches full stack traces when an error is raised.Gravatar Eugene Brevdo2018-03-07
| | | | | | This should help debugging errors that occur inside a py_func. PiperOrigin-RevId: 188238495
* Keep track of eager op device for tensor handles. Force-colocates ops using ↵Gravatar Alexandre Passos2018-03-01
| | | | | | resources with the resources. PiperOrigin-RevId: 187488175
* Merge changes from github.Gravatar Ankur Taly2018-02-16
| | | | PiperOrigin-RevId: 186073337
* Adding tf_export decorators/calls to TensorFlow functions and constants.Gravatar Anna R2018-01-31
| | | | PiperOrigin-RevId: 184020524
* TFE: Register a GPU kernel for tfe.py_func.Gravatar Akshay Agrawal2018-01-29
| | | | PiperOrigin-RevId: 183765122
* Remove THIRD_PARTY_ from #include guardsGravatar Sanjoy Das2018-01-24
| | | | | | They don't make sense in the open source repository. PiperOrigin-RevId: 183140889