Skip to content

ClimFlows/MutatingOrNot.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MutatingOrNot

Stable Dev Build Status Coverage

Installation

MutatingOrNot is registered in the ClimFlows registry. Follow instructions there, then:

] add MutatingOrNot

Example

using MutatingOrNot: void

# one implementation for both styles
f!(y, x) = @. y=x^2

# non-mutating style, AD-compatible
x = randn(10)
y = f!(void, x)

# mutating style, non-allocating and possibly more efficient
f!(y, x)

About

Helps supporting mutating and non-mutating styles with less code duplication.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages