aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api_internal.h
Commit message (Collapse)AuthorAge
* Downgrade run-after-mutation error to a log warning.Gravatar Skye Wanderman-Milne2018-03-16
| | | | | | | | | This is to ease the transition to the C API. Some tests currently mutate the graph after running it but currently pass. This error was meant to guard against existing behavior, so it's not a regression to make it a warning instead for now. PiperOrigin-RevId: 189395472
* Fix race in C API.Gravatar Skye Wanderman-Milne2018-03-12
| | | | | | | | | | | RecordMutation could race with ExtendSessionGraphHelper, which would release the graph lock and only keep the session lock when extending the session. Also makes sure thread annotations are on declarations, not definitions (otherwise they have no effect). PiperOrigin-RevId: 188747158
* TFE_Context gets its local devices from the source instead of a session.Gravatar Alexandre Passos2018-03-07
| | | | PiperOrigin-RevId: 188216178
* Make graph construction work while graph is being concurrently run.Gravatar Skye Wanderman-Milne2018-03-06
| | | | | | The overall approach is to use Graph._lock to synchronize Session.run calls and construction methods that rely on graph mutation. We don't want to synchronize the actual running of the graph, only the Extend call, so this change exposes an ExtendSession method to the Python API and disables extending automatically in TF_SessionRun. PiperOrigin-RevId: 188106818
* This change adds a mechanism to the internal C API for updating an output ↵Gravatar Akshay Agrawal2017-12-21
| | | | | | | handle's shapes and types after its source operation has been created. Context: framework/ops.py was recently updated to use the C API when setting shapes for an op's outputs. This update broke shape inference for graph functions that captured resource handles; this, in turn, made it impossible to create graph functions from Python methods that required fully defined shapes (e.g., like MNIST's `call` method). In particular, the C API computes shapes for ops when they are created and does not update them thereafter; this is problematic because when a resource handle is captured while building a function, we need to update the captured operation's output handle in order to propagate its outputs shapes and dtypes. PiperOrigin-RevId: 179837104
* Read ApiDef from TensorFlow Go API.Gravatar Anna R2017-12-20
| | | | PiperOrigin-RevId: 179625412
* Raise exception on missing unused input_map keys with C API enabled.Gravatar Skye Wanderman-Milne2017-12-12
| | | | | | | | | | | | | | | | | Without this change, the C++ ImportGraphDef API returns unused input_map keys (which are plumbed through to the C API as well). However, the Python import_graph_def API requires slightly different semantics: it throws an error for unused input_map keys that are missing from the GraphDef. This change modifies the C and C++ APIs to limit the returned keys to those missing from the GraphDef, and plumbs this through to the C API-enabled import_graph_def implementation. Note that this is a change to the existing C API. Luckily the modified method hasn't been released yet, so it's ok to change it. PiperOrigin-RevId: 178783957
* Check when session cannot run because its graph was modifiedGravatar Igor Ganichev2017-11-29
| | | | | | | | | | | | | With current tensorflow code, if user modifies some operation after session.run() was called, this modification will never make it to the C++ runtime and no errors will be raised leading to silent wrong results. This change adds checks for such cases when C API is enabled. We don't change the code path for C API being disabled because C API should be enabled by default soon. PiperOrigin-RevId: 177359630
* Add ability to fetch return nodes and unused input mappings from C API ↵Gravatar Skye Wanderman-Milne2017-10-30
| | | | | | | | | | | | | GraphDef import This change introduces yet another ImportGraphDef function to the C API (TF_GraphImportGraphDefWithResults), but this one has extensible return values so we shouldn't have to add more in the future. This change also modifies the ImportGraphDef C interface to manage all string data for the user. PiperOrigin-RevId: 173894710
* Add function gradient support to C APIGravatar Igor Ganichev2017-09-18
| | | | | | | | | | Also, change the internal representation of TF_Function and rename TF_GraphAddFunction to TF_GraphAddFunctionCopy to make it clear that a copy of the function is added to the graph. Any subsequent modifications to the function will not be reflected in the copy added to the graph. PiperOrigin-RevId: 169187793
* Merge changes from github.Gravatar A. Unique TensorFlower2017-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | END_PUBLIC --- Commit 607816029 authored by Eugene Brevdo<ebrevdo@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Extended ScratchSpace to expose its underlying scratch tensor object. PiperOrigin-RevId: 167649551 --- Commit db43fe68e authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Add fast math attributes to all generated methods when fast math enabled. RELNOTES: n/a PiperOrigin-RevId: 167646637 --- Commit aebe8cc6f authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Call HloComputation.Accept instead of HloInstruction.Accept to get all instructions profiled. RELNOTES: n/a PiperOrigin-RevId: 167640259 --- Commit 0ab137cd8 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: BEGIN_PUBLIC Automated g4 rollback of changelist 167604306 PiperOrigin-RevId: 167800256
* Add function support to Tensorflow C APIGravatar Igor Ganichev2017-08-30
| | | | | | | | This change adds minimal functionality. Support for FunctionOptions, attributes, output name rewriting, function name generation, etc is comming next. PiperOrigin-RevId: 167091238
* Allow specifying colocation constraints through TF_SetAttr*Gravatar A. Unique TensorFlower2017-08-03
| | | | | | | | | | | | | Before this change, colocation constraint semantics were not well-defined when they were set using TF_ColocateWith and TF_SetAttrStringList and/or TF_SetAttrValueProto. One could get an exception if multiple methods were used. After this change all changes to colocation attribute (i.e. _class) are executed on TF_OperationDescription.colocation_constraints leading to consistent semantics. PiperOrigin-RevId: 164202666
* C API: Make TF_TensorFromTensor return an error instead of just logging it.Gravatar Asim Shankar2017-08-03
| | | | PiperOrigin-RevId: 164167582
* C API: TF_Tensors will always be in host memory.Gravatar Asim Shankar2017-08-03
| | | | | | | | This change undoes some experimentation in commit 22651083406ca01ac9d481e3367a3510d25f88cd and restores TF_Tensor behavior to what is was prior to that change. PiperOrigin-RevId: 164146670
* C API: Groundwork for experimenting with TF_Tensor in device memory.Gravatar Asim Shankar2017-07-27
| | | | | | | | 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
* Introduce Python-only extensions to the C APIGravatar Skye Wanderman-Milne2017-07-12
| | | | | | | | | 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
* Prepare to remove a bunch of proto.h includes from tensorflow/core headersGravatar Geoffrey Irving2017-06-29
| | | | | | | | | | | | 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
* Moves TensorCApi from c_api.cc to c_api_internal.h, where it can be usedGravatar A. Unique TensorFlower2017-06-27
| | | | | | by other code that require access to the underlying TensorBuffers. PiperOrigin-RevId: 160323362
* Add session.list_devices() APIGravatar Brennan Saeta2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to debug a TensorFlow cluster or check whether devices are available in a local session (e.g. GPU drivers are loaded), this change adds a `sess.list_devices` API to list all devices within the cluster. This CL implements the list_devices() feature via extensions to the TensorFlow C API, and the corresponding additions to the session.h session class and corresponding subclasses for both direct sessions, grpc_sessions, tensorflow_serving, and others. Additionally, in order to accomidate ClusterSpec propagation clusters, Master::ListDevices now also includes a session_handle in order to identify the appropriate master_session on which it should list the available devices. (With ClusterSpec propagation, different sessions can have different servers with different device capabilities.) This CL adds a ListDevices() API to MasterSession. It is most efficient to implement this API call there, because the MasterSession already has a list of devices. Additionally, this change upgrades the implementation of Master::ListDevices() to delegate to the MasterSession if a session handle is specified, and to return an error if no corresponding session is found. PiperOrigin-RevId: 157239656
* Internal C API headers.Gravatar Alexandre Passos2017-04-20
Change: 153717143