From 70744fb43b75743eeff0b09b862128281a7f3494 Mon Sep 17 00:00:00 2001
From: Asim Shankar <ashankar@google.com>
Date: Tue, 16 May 2017 13:21:25 -0700
Subject: [PATCH] Go: Some cleanup possible now that TensorFlow 1.1 has been
 released.

PiperOrigin-RevId: 156221562
---
 tensorflow/go/lib.go      | 10 ----------
 tensorflow/go/session.cpp | 26 --------------------------
 tensorflow/go/session.go  |  2 +-
 3 files changed, 1 insertion(+), 37 deletions(-)
 delete mode 100644 tensorflow/go/session.cpp

diff --git a/tensorflow/go/lib.go b/tensorflow/go/lib.go
index 551cfa0b019..2800eded60b 100644
--- a/tensorflow/go/lib.go
+++ b/tensorflow/go/lib.go
@@ -18,14 +18,4 @@ package tensorflow
 
 // #cgo LDFLAGS: -ltensorflow
 // #cgo CFLAGS: -I${SRCDIR}/../../
-//
-// // TODO(ashankar): Remove this after TensorFlow 1.1 has been released.
-// // Till then, the TensorFlow C API binary releases do not contain
-// // the TF_DeletePRunHandle symbol. We work around that by
-// // implementing the equivalent in session.cpp
-// extern void tfDeletePRunHandle(const char*);
 import "C"
-
-func deletePRunHandle(h *C.char) {
-	C.tfDeletePRunHandle(h)
-}
diff --git a/tensorflow/go/session.cpp b/tensorflow/go/session.cpp
deleted file mode 100644
index efa225505b8..00000000000
--- a/tensorflow/go/session.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-Copyright 2017 The TensorFlow Authors. All Rights Reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// TODO(ashankar): Remove this file when TensorFlow 1.1 is released.
-// See lib.go for details.
-
-extern "C" {
-extern void tfDeletePRunHandle(const char* h);
-}
-
-void tfDeletePRunHandle(const char* h) {
-  delete[] h;
-}
diff --git a/tensorflow/go/session.go b/tensorflow/go/session.go
index 3add412dcd8..afa73030b88 100644
--- a/tensorflow/go/session.go
+++ b/tensorflow/go/session.go
@@ -199,7 +199,7 @@ func (s *Session) NewPartialRun(feeds, fetches []Output, targets []*Operation) (
 		return nil, err
 	}
 	runtime.SetFinalizer(pr, func(pr *PartialRun) {
-		deletePRunHandle(pr.handle)
+		C.TF_DeletePRunHandle(pr.handle)
 	})
 	return pr, nil
 }