Skip to content

Imprecise return type of diagnonal method #122

Description

@marcelluethi

The methods LinearAlgebraOps.diagonal extract the diagonal from a tensor and return a tensor where the two given axis are replaced by the diagonal. In the simplest case of a 2D Tensor, Tensor2[L1, L2, Float32] this just returns a 1D Tensor. Tensor1[?, Float32]. The question is how to label the axis of the extracted tensor. It clearly is neither L1 not L2 but somehow a mixture of both. Currently L1 is chosen, which is convenient but not very precise.

The cleanest possibility seems to introduce a new label Diag[L1,L2] with extension methods to relabel it to something new, e.g.

t.diagonal.relabel(Axis[NewLabel])

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions