Skip to content

Show instance transposed? #22

Closed
Closed
@gilgamec

Description

@gilgamec

It looks like your Show instance for Array is transposed:

λ> A.lower (A.matrix (2,2) [[1,2],[3,4]]) False
ArrayFire Array
[2 2 1 1]
    1.0000     2.0000 
    0.0000     4.0000 

λ> A.upper (A.matrix (2,2) [[1,2],[3,4]]) False
ArrayFire Array
[2 2 1 1]
    1.0000     0.0000 
    3.0000     4.0000 

Another example: exceptions thrown by matmul suggest that the dimensions are (rows,columns):

λ> A.matmul (A.constant [2,3] 5) (A.constant [1,2] 2) A.None A.None
*** Exception: AFException {afExceptionType = SizeError, afExceptionCode = 203, afExceptionMsg = "Invalid input size"}
λ> A.matmul (A.constant [2,3] 5) (A.constant [3,1] 2) A.None A.None
ArrayFire Array
[2 1 1 1]
   30.0000    30.0000 

but the Show instance suggests the opposite:

λ> (A.constant [2,3] 5)
ArrayFire Array
[2 3 1 1]
    5.0000     5.0000 
    5.0000     5.0000 
    5.0000     5.0000 

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