Skip to content

Array index out of bounds error despite seemingly valid value #10

@JKOK005

Description

@JKOK005

Hi, I ran into this error when calling
ns.ones(2,1)(0)

Error msg:
java.lang.ArrayIndexOutOfBoundsException: 1 at org.nd4j.linalg.indexing.ShapeOffsetResolution.tryShortCircuit(ShapeOffsetResolution.java:82) at org.nd4j.linalg.indexing.ShapeOffsetResolution.exec(ShapeOffsetResolution.java:329) at org.nd4j.linalg.api.ndarray.BaseNDArray.get(BaseNDArray.java:4175) at botkop.numsca.Tensor.apply(Tensor.scala:120) at botkop.numsca.Tensor.apply(Tensor.scala:126) ... 28 elided

The expected output should be Tensor(1) since I'm taking the first slice row-wise.

Is this a limitation of the Tensor library, in that we are unable to work with shapes (x,1) ?

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