Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenate yields unexpected results #68

Closed
Yvee1 opened this issue Oct 23, 2021 · 1 comment
Closed

Concatenate yields unexpected results #68

Yvee1 opened this issue Oct 23, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Yvee1
Copy link
Contributor

Yvee1 commented Oct 23, 2021

Observed behaviour

Example:

fun main() {
    val A1 = mk.identity<Double>(3)
    println("A1")
    println(A1)
    val A2 = mk.ones<Double>(3, 1)
    println("A2")
    println(A2)
    println("A1 A2")
    println(A1.cat(A2, axis=1))
}

gives

A1
[[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]
A2
[[0.0],
[0.0],
[0.0]]
A1 A2
[[1.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]

Expected results

Comparison with numpy:

A1 = np.identity(3)
A2 = np.ones((3, 1))
np.concatenate((A1, A2), axis=1)

gives

array([[1., 0., 0., 1.],
       [0., 1., 0., 1.],
       [0., 0., 1., 1.]])
@devcrocod devcrocod added the bug Something isn't working label Nov 2, 2021
@devcrocod
Copy link
Collaborator

fixes #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants