diff options
author | 2016-11-15 00:15:48 -0800 | |
---|---|---|
committer | 2016-11-15 00:24:28 -0800 | |
commit | 1f0c5119a0230c5160d45496175b9256f097e144 (patch) | |
tree | 107fd56ab6f05ce743d1867893c4dd75bd7a98f4 /tensorflow/go/tensor_test.go | |
parent | 1791aeef881915d75c1d077ae77a205e1bc2d51c (diff) |
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 #10)
Change: 139169388
Diffstat (limited to 'tensorflow/go/tensor_test.go')
-rw-r--r-- | tensorflow/go/tensor_test.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tensorflow/go/tensor_test.go b/tensorflow/go/tensor_test.go index fd80658615..29562e2048 100644 --- a/tensorflow/go/tensor_test.go +++ b/tensorflow/go/tensor_test.go @@ -77,10 +77,7 @@ func TestNewTensor(t *testing.T) { // Test that encode and decode gives the same value. We skip arrays because // they're returned as slices. if reflect.TypeOf(test.value).Kind() != reflect.Array { - cTensor := tensor.c() - gotTensor := newTensorFromC(cTensor) - deleteCTensor(cTensor) - got := gotTensor.Value() + got := tensor.Value() if !reflect.DeepEqual(test.value, got) { t.Errorf("encode/decode: got %v, want %v", got, test.value) } |