Skip to content

Commit 584ca77

Browse files
authored
fix: avoid reconstruction in Internal.unsafe_free! (#1550)
* `fmap` -> `fmapstructure` * Use `foreach` and `fleaves` * Bump patch
1 parent 654bd34 commit 584ca77

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/MLDataDevices/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLDataDevices"
22
uuid = "7e8f7934-dd98-4c1a-8fe8-92b47a384d40"
33
authors = ["Avik Pal <avikpal@mit.edu> and contributors"]
4-
version = "1.15.0"
4+
version = "1.15.1"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

lib/MLDataDevices/src/internal.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Internal
22

3-
using Functors: fmap
3+
using Functors: fleaves
44
using Preferences: load_preference
55
using Random: AbstractRNG
66

@@ -272,7 +272,7 @@ unsafe_free_internal!(::Type, x::AbstractArray) = nothing
272272
unsafe_free_internal!(_) = nothing
273273

274274
function unsafe_free!(x)
275-
fmap(unsafe_free_internal!, x)
275+
foreach(unsafe_free_internal!, fleaves(x))
276276
return nothing
277277
end
278278

0 commit comments

Comments
 (0)