Skip to content

Commit

Permalink
raise TypeError if device_buffer is a tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
jakevdp committed Sep 22, 2020
1 parent e3cfaf6 commit 699e46a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jax/interpreters/xla.py
Expand Up @@ -969,6 +969,9 @@ class DeviceArray:
def __init__(self, aval: core.ShapedArray, device: Optional[Device],
lazy_expr: lazy.LazyExpr,
device_buffer: PyLocalBuffer):
# TODO(jakevdp): remove this check once multi-buf change is baked.
if isinstance(device_buffer, Sequence):
raise TypeError(f"device_buffer should be a Buffer instance; got {device_buffer}")
self.aval = aval
self.device_buffer = device_buffer
self._device = device
Expand Down

0 comments on commit 699e46a

Please sign in to comment.