| Commit message (Collapse) | Author | Age |
|
|
|
| |
PiperOrigin-RevId: 214681193
|
|
|
|
| |
PiperOrigin-RevId: 211874311
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get an owned device mgr from the input session.
One use case is in S4TF, we run a graph session to enqueue a tensor into a fifo
queue, and then call TFE_Execute() on a dequeue op over the same queue, as a way
to transfer a tensor from TF to host (tensor tranfer in the other direction also
works).
To make this work, we need TFE_Context and the the TF_Session to use the same
ResourceMgr object (attached to a Device, which is in turn owned by DeviceMgr),
so that both can access the fifo queue resource op.
PiperOrigin-RevId: 211471075
|
|
|
|
| |
PiperOrigin-RevId: 210816713
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The functions added in
https://github.com/tensorflow/tensorflow/commit/be917027e37c5e8f21f6ba07f24bdbf072cf6dfd
are temporary, and their existence breaks compilation in MSVC because of
https://docs.microsoft.com/en-us/cpp/c-language/maximum-string-length
and
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2026
So just disabling it in Windows for now.
PiperOrigin-RevId: 192391164
|
|
|
|
| |
PiperOrigin-RevId: 190878279
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
The Python extensions aren't part of the official C API.
PiperOrigin-RevId: 190649576
|
|
|
|
|
|
| |
reads imagenet TFRecord files.
PiperOrigin-RevId: 190488817
|
|
|
|
| |
PiperOrigin-RevId: 190479555
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 190170332
|
|
|
|
|
|
| |
rewrite functionality out of it.
PiperOrigin-RevId: 190016936
|
|
|
|
| |
PiperOrigin-RevId: 189131526
|
|
|
|
| |
PiperOrigin-RevId: 187385913
|
|
|
|
| |
PiperOrigin-RevId: 186213207
|
|
|
|
|
|
| |
Also ran "buildozer warn //third_party/tensorflow/c/BUILD" and removed an unused symbol.
PiperOrigin-RevId: 186081948
|
|
|
|
|
|
| |
Also refined the API comment for TF_NewSession().
PiperOrigin-RevId: 185739196
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary of changes:
1. Set MarkForCompilationPassFlags::tf_xla_cpu_global_jit default to true in
C_API unit test env when XLA-execute is intended. Together with setting session
config config.graph_options.optimizer_options.global_jit_level to > 0, this
turns on XLA for the entire graph (eligible nodes only, with _Arg and _RetVal
nodes excluded).
We decided against defaulting MarkForCompilationPassFlags::tf_xla_cpu_global_jit
to true, due to performance concerns with the single-threaded nature of the XLA
CPU backend (see
https://www.tensorflow.org/performance/xla/jit#turning_on_jit_compilation).
2. In FindCompilationCandidates() during MarkForCompilationPass, skip compiling
any '_Arg'-typed nodes. This is necessary to avoid hitting a "Invalid argument
number" error during MarkForCompilationPass.
3. Extended C API based build rules to link in XLA libraries, and added unit
test "CAPI.Session_Min_XLA_CPU".
Also added some misc improvements and debugging aids.
PiperOrigin-RevId: 185193314
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
support.
This CL adds XLA support for the following TFE_Op's:
1. A TF op such as MatMul, with full support of constant and resource params.
2. A TF_Function as TFE_Op, where the function must have no constant and
resource params. Removing this restriction requires more discussion and will be
deferred to a later time.
PiperOrigin-RevId: 184877345
|
|
|
|
| |
PiperOrigin-RevId: 182807258
|
|
|
|
| |
PiperOrigin-RevId: 179625412
|
|
|
|
| |
PiperOrigin-RevId: 172105420
|
|
|
|
|
|
|
| |
void* is more common (and more convenient) for passing in serialized
protobufs in c_api.h.
PiperOrigin-RevId: 170386128
|
|
|
|
| |
PiperOrigin-RevId: 170379490
|
|
|
|
| |
PiperOrigin-RevId: 169304057
|
|
|
|
|
|
|
|
| |
This change adds minimal functionality. Support for FunctionOptions,
attributes, output name rewriting, function name generation, etc is
comming next.
PiperOrigin-RevId: 167091238
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds a new function, BuildWhileLoop(), that constructs a
while loop. BuildWhileLoop() takes functions that build the cond and
body graphs, similar to the Python while_loop function. It also
switches the C API to use this new function in order to reduce code
duplication. This is in preparation for while loop gradients, which
are also implemented in the C++ API (along with the other gradient
code).
I didn't write unit tests for BuildWhileLoop, instead relying on the
current C API while loop tests.
This change also disables while loop creation on Android to avoid
pulling in extra C++ dependencies.
PiperOrigin-RevId: 166849829
|
|
|
|
| |
PiperOrigin-RevId: 166297415
|
|
|
|
| |
PiperOrigin-RevId: 164167582
|
|
|
|
|
|
|
|
| |
TF_Tensor objects are always backed by host memory. This commit lays
the groundwork for allowing TF_Tensor objects to refer to tensor data
on device (e.g., GPU) memory.
PiperOrigin-RevId: 163388079
|
|
|
|
|
|
|
|
| |
This change also separates shared functionality into
c_test_util.h/cc. This brings c_api_test.cc to a mere 1715 LOC
(further splits can be more easily done now too).
PiperOrigin-RevId: 162216399
|
|
|
|
|
|
| |
c_api_internal doesn't actually export c_api.h, which python_api.h depends on.
PiperOrigin-RevId: 161874954
|
|
|
|
|
|
|
|
|
| |
Implements an incomplete version of Operation._add_control_input()
using a new extension to make sure the plumbing works.
This also adds header guards to c_api_internal.h, which were missing. For some reason the missing guards caused problems in the cmake build even though there doesn't appear to be any #include cycles.
PiperOrigin-RevId: 161705859
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal is to make kernels mostly independent of proto headers, which will let
us lock down our .so imports. This CL does not remove any actual headers, but
changes a bunch of files so that header removal is possible in a followup CL.
It also marks the headers that will be removed with
// TODO(b/62899350): Remove
RELNOTES: n/a
PiperOrigin-RevId: 160552878
|
|
|
|
|
|
| |
#6268
#9150
Change: 155146664
|
|
|
|
| |
Change: 153717143
|
|
|
|
|
|
|
|
|
|
|
| |
#6268
This CL does the following:
(1) Adds TF_AddGradients function to C_API which adds gradient nodes for the specified inputs.
(2) Adds internal constructor for Scope, need to create a scope from an existing graph in the c_api.
(3) Adds constructor for AddSymbolicGradients that assumes OnesLike when grad_inputs aren't provided.
(4) Improves error message when gradients aren't provided.
Change: 153092774
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change, libtensorflow.so will only export
functions defined in c_api.h. This also results in
a decreased binary size of libtensorflow.so.
On Linux the decrease was from roughly 150MB to 67MB.
On OS X it was from roughly 101MB to 82MB.
Also fixes #8923
Change: 152366053
|
|
|
|
| |
Change: 146788176
|
|
|
|
|
| |
This was causing the .so files to have undefined symbols from core/framework.
Change: 145479847
|
|
|
|
| |
Change: 144834404
|
|
|
|
| |
Change: 144673014
|
|
|
|
|
|
|
| |
The intent is to produce a libtensorflow.tar.gz as part of the release
process to facilitate a leaner (no Python dependencies), smoother installation
process for TensorFlow usage in other languages.
Change: 144470928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the C library and JNI shared library targets Android friendly by linking
with the smaller android runtime when building with --config=android
Relatedly, strip all but the JNI symbols from libtensorflow_jni.so
(regardless of build configuration) to trim its size down (by roughly
50%).
Link in the Java libraries in the Android examples. The longer term intention
is to encourage use of the TensorFlow Java API in Android and do away with the
TensorFlowInferenceInterface class (and related JNI code) currently used in
Android. This will provide a single, more thoroughly tested API for use in all
Java settings - Android or not. An update to the Android example to switch
to this will come in a follow up change.
NOTES:
- For expediency of this change, the C API call: TF_LoadSessionFromSavedModel
is not available when building for Android. I will look into fixing that
separately.
- Linking in the JNI library required by the TensorFlow Java API results in
a small increase (0.7%) in binary size of libtensorflow_demo.so
An unrelatedly, rename libtensorflow-jni.so to libtensorflow_jni.so
to be consistent with other shared libraries created in tensorflow.
Change: 144320074
|
|
|
|
| |
Change: 142477558
|
|
|
|
| |
Change: 139096643
|
|
|
|
|
|
|
| |
The intent is to produce a libtensorflow.tar.gz as part of the release
process to facilitate a leaner (no Python dependencies), smoother installation
process for TensorFlow usage in other languages.
Change: 138934248
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the same checkpoint prefix identifies both a V1 checkpoint and a V2
checkpoint on disk, the V2 version takes priority -- which matches the same
behavior as the RestoreV2 op.
Typical usage:
$ bazel run tensorflow/python/tools:inspect_checkpoint -- --file_name=<V2 ckpt prefix>
Other changes: add DebugString() and Contains() to BundleReader.
Change: 134543092
|
|
|
|
|
|
| |
This is useful when calling the C API from C++, to avoid memory leaks being
reported.
Change: 132937873
|