From 0443cbfbb972b45a2f9bb945b896cf26225aedd2 Mon Sep 17 00:00:00 2001 From: chenyu Date: Sat, 18 Nov 2023 17:37:42 -0500 Subject: [PATCH] fix shm path test on macos (#2357) AttributeError: 'PosixPath' object has no attribute 'startswith' --- tinygrad/runtime/ops_disk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/runtime/ops_disk.py b/tinygrad/runtime/ops_disk.py index 235db18374..11acab1fdb 100644 --- a/tinygrad/runtime/ops_disk.py +++ b/tinygrad/runtime/ops_disk.py @@ -14,7 +14,7 @@ class RawDiskBuffer(RawBufferMapped): self.offset = offset # this is an offset in bytes assert device is not None or buf is not None, "disk tensor needs a path or a buf" if device is not None: - if device.startswith("shm:"): + if str(device).startswith("shm:"): if OSX: with open(f"/tmp/shm_{device[4:]}", "w+b") as f: f.truncate(size * dtype.itemsize)