Skip to content

Commit 2fb481f

Browse files
committed
allow Memory
1 parent a41269d commit 2fb481f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/torch/storage.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,14 @@ function Base.show(io::IO, x::LazyLoadedWrapper)
175175
end
176176
Base.show(io::IO, ::MIME"text/plain", x::LazyLoadedWrapper) = show(io, x)
177177

178+
@static if isdefined(Core, :Memory)
179+
const StorageData = Union{LazyLoadedStorage, Array, Memory}
180+
else
181+
const StorageData = Union{LazyLoadedStorage, Array}
182+
end
178183

179184
struct StorageManager
180-
data::Dict{String, Tuple{DType, Int, String, Union{LazyLoadedStorage, Array}}}
185+
data::Dict{String, Tuple{DType, Int, String, StorageData}}
181186
end
182187

183188
StorageManager() = StorageManager(Dict())

0 commit comments

Comments
 (0)