yunabe / lgo

Interactive Go programming with Jupyter
BSD 3-Clause "New" or "Revised" License
2.44k stars 122 forks source link

Gorgonia Hello world in Jupyter Notebook #89

Closed seedrick closed 1 year ago

seedrick commented 4 years ago

I'm trying to run through the hello world tutorial for the Gorgonia library in a Jupyter notebook (using lgo as the kernel). I can build this example just fine normally, but the call to gorgonia.Add() results in a panic:



goroutine 25 [running]:
runtime/debug.Stack(0xc0004c5898, 0x8, 0xc00000f7e0)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/yunabe/lgo/core.(*resultCounter).recordResult(0xc0000b0158, 0x7fbcc935dfc0, 0x7fbcc996b5b0)
    /home/user/go/src/github.com/yunabe/lgo/core/core.go:95 +0xdd
github.com/yunabe/lgo/core.(*resultCounter).recordResultInDefer(0xc0000b0158)
    /home/user/go/src/github.com/yunabe/lgo/core/core.go:100 +0x3b
panic(0x7fbcc935dfc0, 0x7fbcc996b5b0)
    /usr/local/go/src/runtime/panic.go:679 +0x1be
sync.(*Map).Load(0x0, 0x7fbcc924f360, 0xc0004c5ad0, 0x0, 0xc0004c5b48, 0x7fbca161c6fd)
    /usr/local/go/src/sync/map.go:103 +0x2b
gorgonia.org/gorgonia.borrowDimSizers(0x2, 0xc0004c5a98, 0xc000215cb0, 0x3)
    /home/user/go/src/gorgonia.org/gorgonia/perf.go:90 +0x56
gorgonia.org/gorgonia.Nodes.dimSizers(0xc0008c4060, 0x2, 0x2, 0x0, 0x0, 0x7fbca174d020)
    /home/user/go/src/gorgonia.org/gorgonia/collections.go:212 +0x31
gorgonia.org/gorgonia.ApplyOp(0x7fbca174dc20, 0xc0008f8000, 0xc0008c4060, 0x2, 0x2, 0x0, 0x0, 0x0)
    /home/user/go/src/gorgonia.org/gorgonia/op.go:198 +0x390
gorgonia.org/gorgonia.binOpNode(0x7fbca174e420, 0xc0008f8000, 0xc0004be000, 0xc0004be0e0, 0x0, 0x0, 0x0)
    /home/user/go/src/gorgonia.org/gorgonia/operations.go:43 +0x2f0
gorgonia.org/gorgonia.Add(0xc0004be000, 0xc0004be0e0, 0x0, 0xc0004c5f10, 0x1)
    /home/user/go/src/gorgonia.org/gorgonia/api_gen.go:66 +0x16f
github.com/yunabe/lgo/sess7b2274696d65223a313538353731383931393336393137383933307d/exec4.lgo_init()
    /home/user/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313538353731383931393336393137383933307d/exec4/src.go:16 +0x188
github.com/yunabe/lgo/cmd/runner.loadShared.func3()
    /home/user/go/src/github.com/yunabe/lgo/cmd/runner/runner.go:62 +0x26
github.com/yunabe/lgo/core.startExec.func1(0xc0000b0120, 0xc000943570)
    /home/user/go/src/github.com/yunabe/lgo/core/core.go:256 +0xa0
created by github.com/yunabe/lgo/core.startExec
    /home/user/go/src/github.com/yunabe/lgo/core/core.go:253 +0xcb
main routine failed```

Does anybody know what's causing this?