-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #432 from avik-pal/ap/chainrules
Add can_setindex for ChainRules OneElement
- Loading branch information
Showing
4 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module ArrayInterfaceChainRulesExt | ||
|
||
using ArrayInterface | ||
using ChainRules: OneElement | ||
|
||
ArrayInterface.can_setindex(::Type{<:OneElement}) = false | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using ArrayInterface, ChainRules, Test | ||
|
||
x = ChainRules.OneElement(3.0, (3, 3), (1:4, 1:4)) | ||
|
||
@test !ArrayInterface.can_setindex(x) | ||
@test !ArrayInterface.can_setindex(typeof(x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters