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
359 stars 49 forks source link

XXXScalar functions do not respect the Dtype of the tensor. #88

Closed chewxy closed 3 years ago

chewxy commented 3 years ago
    a := New(WithShape(4, 2), WithBacking([]float64{1, 1, 1, 1, 1, 1, 1, 1}))
    b := New(WithShape(2, 4), WithBacking([]float64{0, 1, 0, 1, 0, 1, 0, 1}))
    c, _ := a.MatMul(b)
    d, err := Div(c, 2) // 2 is an untyped constant that will be used as an int.
    if err == nil {
        log.Fatal("expected an error")
    }