Skip to content

Add Tensor wrapper for jacobians in DualArrays#28

Merged
dlfivefifty merged 21 commits into
JuliaArrays:mainfrom
max-vassili3v:tensor
May 8, 2026
Merged

Add Tensor wrapper for jacobians in DualArrays#28
dlfivefifty merged 21 commits into
JuliaArrays:mainfrom
max-vassili3v:tensor

Conversation

@max-vassili3v
Copy link
Copy Markdown
Collaborator

This PR adds a new Tensor struct, with constructors and arithmetic/broadcasting. Dual and DualVector were changed to have jacobian and partials be a Tensor. Existing unit tests were adjusted where necessary and a new file was added for testing Tensors in isolation.

Next steps:

  • Example of 2nd order differentiation/hessian using DualArrays/Tensor
  • Implement contraction and sparsity using SparseArrayKit.jl and TensorOperations.jl

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.34%. Comparing base (5761344) to head (2e4e543).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #28       +/-   ##
===========================================
+ Coverage   70.87%   90.34%   +19.46%     
===========================================
  Files           5        5               
  Lines         103      176       +73     
===========================================
+ Hits           73      159       +86     
+ Misses         30       17       -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/types.jl Outdated
Comment thread src/types.jl Outdated
Comment thread test/tensor_test.jl Outdated
@dlfivefifty
Copy link
Copy Markdown
Member

Rename Tensor to eg TensorOperator?

@dlfivefifty
Copy link
Copy Markdown
Member

Or probably better ArrayOperator. Probably not ArrayMatrix. Or maybe just leave it Tensor for now.

Comment thread src/types.jl Outdated
Comment thread src/types.jl Outdated
Comment thread src/types.jl Outdated
Comment thread src/types.jl Outdated
@max-vassili3v max-vassili3v requested a review from dlfivefifty May 5, 2026 11:47
@dlfivefifty dlfivefifty merged commit 657421a into JuliaArrays:main May 8, 2026
6 checks passed
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 this pull request may close these issues.

2 participants