Skip to content

Commit

Permalink
Fix AttributeError on LocalBuffer.__delete__ call in python xla client
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajprad committed Mar 5, 2019
1 parent b778c03 commit bed882f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tensorflow/compiler/xla/python/xla_client.py
Expand Up @@ -431,7 +431,9 @@ def device(self):

def delete(self):
if self.c_buffer is not None:
self._backend.delete_buffer(self.c_buffer)
# Python may have freed c_api first.
if c_api:
self._backend.delete_buffer(self.c_buffer)
self.c_buffer = None

def destructure(self):
Expand Down

0 comments on commit bed882f

Please sign in to comment.