fix old list behavior
MODIFY
accel/metal/ops_metal.py
accel/metal/ops_metal.py
@@ -84,7 +84,7 @@ if __name__ == "__main__":
from tinygrad.tensor import Tensor, Device
- r1 = Tensor(np.random.random(16).astype(np.float32)-0.5, device=Device.METAL)
+ r1 = Tensor([-2,-1,0,1,2], device=Device.METAL)
r2 = r1.relu()
print(r1.cpu())
print(r2.cpu())

MODIFY
tinygrad/tensor.py
tinygrad/tensor.py
@@ -139,6 +139,8 @@ class Tensor:
@staticmethod
def _move_data(data, device):
+ if isinstance(data, list):
+ data = np.array(data, dtype=np.float32)
if isinstance(data, np.ndarray):
data = data.view(Device.buffers[Device.CPU])
if isinstance(data, Device.buffers[device]):

fix old list behavior