Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Enhance contract to support keyword arguments during reduction #32

Merged
merged 2 commits into from
Jul 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Numerics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ contract(a::Union{T,AbstractArray{T,0}}, b::Tensor{T}) where {T} = contract(Tens
contract(a::Tensor{T}, b::Union{T,AbstractArray{T,0}}) where {T} = contract(a, Tensor(b))
contract(a::AbstractArray{<:Any,0}, b::AbstractArray{<:Any,0}) = contract(Tensor(a), Tensor(b)) |> only
contract(a::Number, b::Number) = contract(fill(a), fill(b))
contract(tensors::Tensor...) = reduce(contract, tensors)
contract(tensors::Tensor...; kwargs...) = reduce(((x, y) -> contract(x, y; kwargs...)), tensors)
mofeing marked this conversation as resolved.
Show resolved Hide resolved

"""
*(::Tensor, ::Tensor)
Expand Down
Loading