diff --git a/tinygrad/tensor.py b/tinygrad/tensor.py index 60d78374ed..c7ced60a37 100644 --- a/tinygrad/tensor.py +++ b/tinygrad/tensor.py @@ -52,8 +52,7 @@ class Tensor: # internal variables used for autograd graph construction self._ctx: Optional[Function] = None - if data.__class__ is LazyBuffer: - data = cast(LazyBuffer, data) # NOTE: this is a noop, it makes mypy happy + if isinstance(data, LazyBuffer): assert dtype is None or dtype == data.dtype, "dtype doesn't match, and casting isn't supported" self.lazydata = data if data.device == device else LazyBuffer.loadop(LoadOps.FROM, data.shape, data.dtype, device, src=data) return