gorgonia / tensor

package tensor provides efficient and generic n-dimensional arrays in Go that are useful for machine learning and deep learning purposes
Apache License 2.0
362 stars 49 forks source link

Panic on Transposed RowVector #83

Closed strigi-form closed 4 years ago

strigi-form commented 4 years ago

[Fix found, pull request sent] This simple code panics

2020/10/15 13:11:28 (3, 1)
C[-1  %!v(PANIC=Format method: runtime error: index out of range [3] with length 3)
package main

import (
    "log"

    "gorgonia.org/tensor"
)

func main() {
    var T tensor.Tensor
    T = tensor.New(
        tensor.WithShape(1, 3),
        tensor.WithBacking([]float64{-1, 0, 1}))
    T, _ = tensor.T(T)
    log.Printf("%v\n%v\n", T.Shape(), T)
}
chewxy commented 4 years ago

This was fixed by #84