change(example/basic)

This commit is contained in:
sugarme 2020-07-12 12:13:08 +10:00
parent f961f84389
commit 013e1e710b
2 changed files with 15 additions and 0 deletions

View File

@ -6,4 +6,5 @@
- [JIT](jit)
- [Neural style transfer](neural-style-transfer)
- [Transfer learning](transfer-learning)
- [Pretrained models](pretrained-models)

14
example/basic/main.go Normal file
View File

@ -0,0 +1,14 @@
package main
import (
"github.com/sugarme/gotch"
ts "github.com/sugarme/gotch/tensor"
)
func main() {
// Create a tensor [2,3,4]
tensor := ts.MustArange(ts.IntScalar(2*3*4), gotch.Int64, gotch.CPU).MustView([]int64{2, 3, 4}, true)
tensor.Print()
}