Skip to content

Commit

Permalink
tape_copy Core.Box (#116)
Browse files Browse the repository at this point in the history
* tape_copy Core.Box

* Update Project.toml

Co-authored-by: Hong Ge <[email protected]>
  • Loading branch information
KDr2 and yebai authored Feb 8, 2022
1 parent ab7cde4 commit 15f5dda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
license = "MIT"
desc = "Tape based task copying in Turing"
repo = "https://github.com/TuringLang/Libtask.jl.git"
version = "0.6.6"
version = "0.6.7"

[deps]
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"
Expand Down
3 changes: 3 additions & 0 deletions src/tapedfunction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ deeply copied, one can add a method to this function.
"""
function tape_copy end
tape_copy(x) = x
# Core.Box is used as closure captured variable container, so we should tape_copy its contents
tape_copy(x::Core.Box) = Core.Box(tape_copy(x.contents))
# ?? should we deepcopy Array and Dict by default?
# tape_copy(x::Array) = deepcopy(x)
# tape_copy(x::Dict) = deepcopy(x)

Expand Down

2 comments on commit 15f5dda

@yebai
Copy link
Member

@yebai yebai commented on 15f5dda Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/54204

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.7 -m "<description of version>" 15f5ddabe1d5f0be0bb4eb994b5495fb1cc58e2c
git push origin v0.6.7

Please sign in to comment.