Skip to content

diagonal() has incorrect default #1402

@LeeReid1

Description

@LeeReid1

Thanks for all the hard work on this.

In v0.102.8 CPU there is a minor bug:

Tensor.diagonal() has its final argument (dim2) set to 0, whilst documentation states this should be 1.

      //   dim2:
      //     Second dimension with respect to which to take diagonal. Default: 1.
      //

This causes an exception if calling diagonal without stating all arguments explicitly.

      public Tensor diagonal(long offset = 0L, long dim1 = 0L, long dim2 = 0L)

should be

...
      public Tensor diagonal(long offset = 0L, long dim1 = 0L, long dim2 = 1L)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions