| Commit message (Collapse) | Author | Age |
|
|
|
| |
PiperOrigin-RevId: 204225504
|
| |
|
| |
|
| |
|
|
|
|
| |
Change: 152200430
|
|
|
|
| |
Change: 147043532
|
|
|
|
|
|
| |
Output.Shape may be only partially known, hence the recently introduced Shape
type is a more appropriate return value.
Change: 145481782
|
|
|
|
|
| |
Fixes #6833
Change: 144752893
|
|
|
|
|
|
|
|
| |
This will be needed for generating the function wrappers for ops that produce a
list of tensors as output.
Another step towards #10
Change: 136191993
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Export an API to add operations to the graph.
I also intend to use this API in a code generator that will generate
Go sources files containing functions for each OpDef (and all
this generated code will be in a separate package).
While at it, also changed some tests to use the "sub-tests"
feature in Go 1.7 (https://blog.golang.org/subtests)
Another step in the journey of #10
Change: 135493412
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 #10
Change: 134560938
|
|
And also add trivial accessors for Name() and Type() to the Operation type.
The lifetime of TF_Operation* objects is tied to the lifetime of the TF_Graph*
that they come from in the C API. Prior to this commit, it was possible for the
Go Graph object to be garbage collected even while the Operation object is
still alive.
The added test demonstrates this problem and fails with the following
if the Operation type doesn't hold on to a reference to the Graph:
=== RUN TestOperationLifetime
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x886ebc4]
runtime stack:
runtime.throw(0xc73afc7, 0x2a)
go/gc/src/runtime/panic.go:569 +0x9e
runtime.sigpanic()
go/gc/src/runtime/sigpanic_unix.go:12 +0x2cc
goroutine 34 [syscall, locked to thread]:
runtime.cgocall(0x7733410, 0xc420055e28, 0x0)
go/gc/src/runtime/cgocall.go:131 +0x110 fp=0xc420055df8 sp=0xc420055db8 pc=0x75e64a0
tensorflow/go/tensorflow._Cfunc_TF_OperationName(0x7f4c9f59b790, 0x0)
??:0 +0x4a fp=0xc420055e28 sp=0xc420055df8 pc=0x764884a
tensorflow/go/tensorflow.(*Operation).Name(0xc4201760c0, 0x0, 0x0)
/build/work/c9dcfe7aa482d82c72c0b2b6c0351d7a/tensorflow/go/operation.go:32 +0x78 fp=0xc420055e70 sp=0xc420055e28 pc=0x7649248
tensorflow/go/tensorflow.TestOperationLifetime(0xc4201a00c0)
tensorflow/go/operation_test.go:45 +0x7e fp=0xc420055f68 sp=0xc420055e70 pc=0x764409e
testing.tRunner(0xc4201a00c0, 0xc748ed0)
go/gc/src/testing/testing.go:610 +0x81 fp=0xc420055f90 sp=0xc420055f68 pc=0x76589a1
runtime.goexit()
go/gc/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc420055f98 sp=0xc420055f90 pc=0x7642c91
created by testing.(*T).Run
go/gc/src/testing/testing.go:646 +0x2ec
This is yet another step towards #10
Change: 134086736
|