Merge pull request #1180 from brianwa84/patch-1

Make DeviceValue and subclasses weakref friendly
This commit is contained in:
Roy Frostig 2019-08-13 16:14:27 -07:00 committed by GitHub
commit bb3882a332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -434,7 +434,7 @@ for _t in array_types:
class DeviceValue(object):
"""A DeviceValue represents a value backed by device memory."""
__slots__ = ["aval", "device_buffer"]
__slots__ = ["aval", "device_buffer", "__weakref__"]
def __init__(self, aval, device_buffer):
self.aval = aval