-
-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Here is a minimal failure demonstration:
package main
import (
"fmt"
"os"
"gorgonia.org/tensor"
)
func main() {
m := tensor.New(
tensor.WithShape(2, 2),
tensor.WithBacking([]float64{1, 2, 3, 4}),
)
x, err := m.Slice(nil, tensor.S(0))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
y, err := m.Slice(nil, tensor.S(1))
if err != nil {
fmt.Println(err)
os.Exit(2)
}
c, err := tensor.Mul(x, y)
if err != nil {
fmt.Println(err)
os.Exit(3)
}
err = c.Reshape(2, 1) // <-- this fails
if err != nil {
fmt.Println(err) // output: sanity check failed: Shape mismatch. Expected (2, 1). Got 3
os.Exit(4)
}
fmt.Println(c)
}And it fixes itself if I call Mul like this: c, err := tensor.Mul(x.Materialize(), y)
Metadata
Metadata
Assignees
Labels
No labels