Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distances + ChainRules #172

Closed
willtebbutt opened this issue Aug 7, 2020 · 2 comments · Fixed by #246
Closed

Distances + ChainRules #172

willtebbutt opened this issue Aug 7, 2020 · 2 comments · Fixed by #246

Comments

@willtebbutt
Copy link

Are the maintainers of this package open to ChainRules-centric PRs? ie. are you happy to host "AD recipes" in this package?

The consensus is that the "correct" place for rules is in the package that defines the functions (otherwise it's type-piracy), in the same way that recipes for RecipesBase for plotting are hosted in the same package as the things that you want to plot using them.

An additional dependency on ChainRulesCore will be required, but as you can see from it's Project.toml, it is very lightweight.

@KristofferC
Copy link
Member

but as you can see from it's Project.toml, it is very lightweight.

Distances.jl is also very lightweight, for example


julia> @time using Distances
  0.039016 seconds (32.86 k allocations: 3.181 MiB)

but with ChainRulesCore as a dependency:

julia> @time using Distances
  0.092615 seconds (88.67 k allocations: 6.465 MiB)

@willtebbutt
Copy link
Author

Sure. So is that a tradeoff you're willing to make so that Distances can be made to work with AD?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants