Tensors.jl
Tensors.jl copied to clipboard
Provide function to extract the value from a dual tensor
See the updated docstring for example and motivation, and this example, where the internal _extract_value is used, is a "real-world" use case.
Tensor.extract_value is defined (exclusively for AbstractTensor input) and documented in this PR. For scalars ForwardDiff.value should be used.
Due to the relatively generic name and fairly advanced (and not very frequent) use case, I think it is better to not export it, making it very clear that it is exclusively for tensors.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
258540f) 96.91% compared to head (2309e42) 96.91%.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #208 +/- ##
=======================================
Coverage 96.91% 96.91%
=======================================
Files 17 17
Lines 1490 1492 +2
=======================================
+ Hits 1444 1446 +2
Misses 46 46
| Files | Coverage Δ | |
|---|---|---|
| src/automatic_differentiation.jl | 99.11% <100.00%> (+<0.01%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.