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

"array2 is incomplete (or unallocatable); stack allocation disallowed" from examples #86

Closed kr0sh1 closed 4 years ago

kr0sh1 commented 4 years ago

I'm getting this error with the example from the Gorgonia website:

gorgonia.org/tensor

../../../../go/pkg/mod/gorgonia.org/tensor@v0.9.11/array.go:24:7: array2 is incomplete (or unallocatable); stack allocation disallowed ../../../../go/pkg/mod/gorgonia.org/tensor@v0.9.11/array.go:168:38: array2 is incomplete (or unallocatable); stack allocation disallowed ../../../../go/pkg/mod/gorgonia.org/tensor@v0.9.11/array.go:298:2: rawdata is incomplete (or unallocatable); stack allocation disallowed ../../../../go/pkg/mod/gorgonia.org/tensor@v0.9.11/array.go:371:3: array2 is incomplete (or unallocatable); stack allocation disallowed ../../../../go/pkg/mod/gorgonia.org/tensor@v0.9.11/array.go:372:3: array2 is incomplete (or unallocatable); stack allocation disallowed

I'm running on macOS 10.13.6 High Sierra with go1.15.3 darwin/amd64 on a 2010 machine.

Can I quickly verify this isn't an issue with environment setup or platform? I've checked for the response on another machine from 2013 running macOS 10.15.7 and it's still present.

The example I'm using is as follows:


package main
import (
  "fmt"
  "log"
  "gorgonia.org/gorgonia"
)

func main(){
  g := NewGraph()

  var a, c, c *Node
  var err error

  a = NewScalar(g, Float64, WithName("a"))
  b = NewScalar(g, Float64, WithName("b"))

  c, err = Add(a, b)

  if err != nil {
    log.Fatal(err)
  }

  machine := NewTapeMachine(g)

  Let(a, 1.0)
  Let(b, 2.0)
  if machine.RunAll() != nil {
    log.Fatal(err)
  }
  fmt.Printf("%v", c.Value())

}```
chewxy commented 4 years ago

related to #85

chewxy commented 4 years ago

Fixed in #87