Commit Graph

21 Commits

Author SHA1 Message Date
Phil Pearl
d118d28e00 Avoid memory 'leak' in Go with multple inputs
Fixes . Go map iteration order is random. If we send randomly ordered lists of inputs to the C core it will create a key in the session executors_ cache for each of the random orderings. With more than a handful of inputs this can get big very quickly.
2020-06-24 15:52:58 +01:00
A. Unique TensorFlower
6e9cb400d1 Automated rollback of commit 0bc46a1602. Revert .
PiperOrigin-RevId: 239098662
2019-03-18 18:13:21 -07:00
frreiss
aaec622b8a Address review comments and add some more API docs 2019-03-18 13:07:22 -07:00
frreiss
3b3397c609 Introduce Config struct to encapsulate session config options 2019-03-15 12:26:02 -07:00
frreiss
537ba63547 Add function to create serialized ConfigOptions protos 2019-03-13 16:19:23 -07:00
James Keeling
045ac6c3ca Refactor ListDevices in TF Go API
I pull the logic to convert a *C.TF_DeviceList to a []Device into its own function `deviceSliceFromDeviceList`. This is so I can reuse it when wrapping the Eager C API.

PiperOrigin-RevId: 225344064
2018-12-13 03:25:20 -08:00
James Keeling
ca096a329c TF Go Wrapper: Add String() method to Device
This is useful when printing devices.

PiperOrigin-RevId: 225343692
2018-12-13 03:20:09 -08:00
Andrei Nigmatulin
9315a12cf7 golang: added Session.ListDevices method ()
* golang: added Session.ListDevices method
2017-12-21 11:04:46 -05:00
Andrei Nigmatulin
846454faae Fix: Go GC could destroy input tensors while SessionRun() was still running, see https://github.com/tensorflow/tensorflow/issues/13129 2017-09-20 15:49:31 +01:00
Asim Shankar
70744fb43b Go: Some cleanup possible now that TensorFlow 1.1 has been released.
PiperOrigin-RevId: 156221562
2017-05-16 13:25:07 -07:00
A. Unique TensorFlower
ccbc8991db Merge changes from github.
Change: 152200430
2017-04-04 17:24:57 -07:00
Asim Shankar
49a4ebbf3c Go: Provide a mechanism to configure the Session.
A Session is configured using the ConfigProto protocol buffer.
For now, continuing with attempts to keep the 'tensorflow' go package
free of any protocol buffer dependencies, SessionOptions uses a serialized
representation of this message. This choice might make sense to revisit.
Change: 148750535
2017-02-28 03:09:47 -08:00
Asim Shankar
c35e3b523a Go: Add PartialRun support.
Change: 147783087
2017-02-16 16:47:36 -08:00
Jonathan Hseu
dd51f989b8 Go: Add a SavedModel type
Change: 147543652
2017-02-14 17:47:15 -08:00
Jonathan Hseu
085102c2e2 SavedModel support in Go.
Change: 146938337
2017-02-08 12:08:23 -08:00
Jonathan Hseu
8f6cb22c67 Rename TF_Port to TF_Output and add a TF_Input type.
Change: 139377074
2016-11-16 14:23:00 -08:00
Asim Shankar
1f0c5119a0 C API: Do not take ownership of the TF_Tensors
Prior to this change, TF_*Run, TF_SetAttrTensor and TF_SetAttrTensorList
took ownership of the TF_Tensor*s of the feeds. This can make performance
client languages bothersome when the same Tensor is repeatedly fed into
multiple session executions as the memory for the feed tensor would need
to be re-allocated and filled in every time.

With this change, these functions no longer take ownership of the
TF_Tensor*.

The changes to the Go API implementation reflect the claimed benefits.
(Another step towards )
Change: 139169388
2016-11-15 00:24:28 -08:00
Asim Shankar
e580e721cc C API: Rename TF_SessionWithGraph to TF_Session.
This makes the preferred API for graph construction and
execution have the simpler, more sensible names (TF_Session,
TF_NewSession etc.) and the older one which we hope to
eventually remove have the more awkward ones (TF_DeprecatedSession,
TF_NewDeprecatedSession etc.)
Change: 138641615
2016-11-09 08:41:53 -08:00
Asim Shankar
7cacfdf038 go: Add an example.
Add an example (that will appear in Go doc) for a real use of the Go TensorFlow
APIs - using a pre-defined image recognition model for inference.

While at it a couple of minor tweaks:
- NewSession now accepts 'nil' for options as the documentation says it does
- Convenience accessors for the Outputs of an Operation
- Ability to extract (possibly partial) shapes from an Output

Another step towards 
Change: 134560938
2016-09-28 11:48:45 -07:00
Jonathan Hseu
31e0b3bef5 Rename Port to Output in the Go API.
Change: 131089292
2016-08-23 13:32:55 -07:00
Jonathan Hseu
783c52edeb Initial version of the Go API. The API is subject to change.
Remaining work to do:
- Generated ops.
- Generated protocol buffers.
- A few calls requiring protocol buffers aren't in this change.
Change: 131066649
2016-08-23 10:04:53 -07:00