Skip to content

Commit c20083f

Browse files
authored
Handle static arrays with Mooncake (#643)
1 parent ae87c32 commit c20083f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/DifferentiationInterfaceMooncakeExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using Mooncake:
1616
DI.check_available(::AutoMooncake) = true
1717

1818
copyto!!(dst::Number, src::Number) = convert(typeof(dst), src)
19-
copyto!!(dst, src) = copyto!(dst, src)
19+
copyto!!(dst, src) = DI.ismutable_array(dst) ? copyto!(dst, src) : convert(typeof(dst), src)
2020

2121
get_config(::AutoMooncake{Nothing}) = Config()
2222
get_config(backend::AutoMooncake{<:Config}) = backend.config

0 commit comments

Comments
 (0)