Skip to content

Commit 73c5fe6

Browse files
Tape copy boxed values (#160)
* Tape copy boxed values * Update Project.toml Co-authored-by: Hong Ge <[email protected]>
1 parent ca5f155 commit 73c5fe6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
33
license = "MIT"
44
desc = "Tape based task copying in Turing"
55
repo = "https://github.com/TuringLang/Libtask.jl.git"
6-
version = "0.8.4"
6+
version = "0.8.5"
77

88
[deps]
99
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"

Diff for: src/tapedfunction.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,9 @@ function tape_shallowcopy end, function tape_deepcopy end
476476

477477
tape_shallowcopy(x) = x
478478
tape_deepcopy(x) = deepcopy(x)
479+
479480
# Core.Box is used as closure captured variable container, so we should tape_copy its contents
480-
tape_shallowcopy(x::Core.Box) = Core.Box(tape_shallowcopy(x.contents))
481-
tape_deepcopy(x::Core.Box) = Core.Box(tape_deepcopy(x.contents))
481+
_tape_copy(box::Core.Box, deepcopy_types) = Core.Box(_tape_copy(box.contents, deepcopy_types))
482482

483483
function _tape_copy(v, deepcopy_types)
484484
if isa(v, deepcopy_types)

0 commit comments

Comments
 (0)