Skip to content

Commit 3e7cf88

Browse files
committed
document is_inplaceable_destination
1 parent 45e0013 commit 3e7cf88

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

docs/Manifest.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
1010
version = "0.5.10"
1111

1212
[[ChainRulesCore]]
13-
deps = ["LinearAlgebra", "MuladdMacro"]
13+
deps = ["LinearAlgebra", "MuladdMacro", "SparseArrays"]
1414
path = ".."
1515
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
16-
version = "0.9.12"
16+
version = "0.9.17"
1717

1818
[[Dates]]
1919
deps = ["Printf"]
@@ -81,10 +81,10 @@ uuid = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
8181
version = "0.2.2"
8282

8383
[[Parsers]]
84-
deps = ["Dates", "Test"]
85-
git-tree-sha1 = "8077624b3c450b15c087944363606a6ba12f925e"
84+
deps = ["Dates"]
85+
git-tree-sha1 = "6fa4202675c05ba0f8268a6ddf07606350eda3ce"
8686
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
87-
version = "1.0.10"
87+
version = "1.0.11"
8888

8989
[[Pkg]]
9090
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
@@ -117,6 +117,10 @@ uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
117117
[[Sockets]]
118118
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
119119

120+
[[SparseArrays]]
121+
deps = ["LinearAlgebra", "Random"]
122+
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
123+
120124
[[Test]]
121125
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
122126
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

docs/src/api.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ Private = false
2828
```
2929

3030
## Accumulation
31-
```@autodocs
32-
Modules = [ChainRulesCore]
33-
Pages = ["accumulation.jl"]
34-
Private = false
31+
```@docs
32+
add!!
33+
ChainRulesCore.is_inplaceable_destination
3534
```
3635

3736
## Ruleset Loading

src/accumulation.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ end
3535
Returns true if `x` is suitable for for storing inplace accumulation of gradients.
3636
For arrays this boils down `x .= y` if will work to mutate `x`, if `y` is an appropriate
3737
differential.
38+
Wrapper array types do not need to overload this if they overload `Base.parent`, and are
39+
`is_inplaceable_destination` if and only if their parent array is.
40+
Other types should overload this, as it defaults to `false`.
3841
"""
3942
is_inplaceable_destination(::Any) = false
4043
is_inplaceable_destination(::Array) = true

0 commit comments

Comments
 (0)