mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-02-19 02:44:40 -05:00
bfloat16 in LLVM (enough for llama 2) (#1293)
* add bf16 support to LLVM * bf16 read works
This commit is contained in:
@@ -63,10 +63,10 @@ class Tensor:
|
||||
return
|
||||
|
||||
if data.__class__ is list:
|
||||
assert dtype is None or dtype.np is not None, f"{dtype} doesn't have a numpy dtype"
|
||||
data = np.array(data, dtype=(dtype or Tensor.default_type).np)
|
||||
|
||||
if data.__class__ is np.ndarray:
|
||||
data = cast(np.ndarray, data)
|
||||
if isinstance(data, np.ndarray):
|
||||
data = LazyBuffer.fromCPU(data)
|
||||
self.lazydata = data if data.device == device else LazyBuffer.loadop(LoadOps.FROM, data.shape, data.dtype, device, src=data)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user