mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
fix shm path test on macos (#2357)
AttributeError: 'PosixPath' object has no attribute 'startswith'
This commit is contained in:
parent
f02e17a967
commit
0443cbfbb9
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue