Go to file
2020-07-22 16:42:20 +10:00
docs feat(tensor/index_test.go): added 2020-07-10 15:28:37 +10:00
example BREAKING CHANGE: switch to auto-generated 2020-07-22 15:56:30 +10:00
gen BREAKING CHANGE: switch to auto-generated 2020-07-22 15:56:30 +10:00
libtch BREAKING CHANGE: switch to auto-generated 2020-07-22 15:56:30 +10:00
nn BREAKING CHANGE: switch to auto-generated 2020-07-22 15:56:30 +10:00
tensor BREAKING CHANGE: switch to auto-generated 2020-07-22 15:56:30 +10:00
vision BREAKING CHANGE: switch to auto-generated 2020-07-22 15:56:30 +10:00
.gitignore BREAKING CHANGE: switch to auto-generated 2020-07-22 15:56:30 +10:00
device.go feat(wrapper/tensor): LoadMultiWithDevice 2020-06-11 07:03:59 +10:00
dtype.go fix(DTypeFromData and FlattenData): fixed type check didn't reach data type is a slice 2020-07-22 15:26:18 +10:00
dune-project initial commit 2020-05-22 23:43:09 +10:00
go.mod removed unexpected dependecy packages 2020-06-18 12:15:06 +10:00
LICENSE feat(license): added Apache License 2020-07-22 16:42:20 +10:00
README.md feat(license): added Apache License 2020-07-22 16:42:20 +10:00

GoTch LicenseGo.Dev referenceTravis CIGo Report Card

Overview

  • GoTch is a C++ Libtorch Go binding for developing and implementing deep learning projects in Go.

  • It is currently in heavy development mode and is considered unstable until version v1.0.0 is marked. Hence, one can use it with own risk.

  • This package is to create a thin wrapper of Libtorch to make use of its tensor APIs and CUDA support while implementing as much idiomatic Go as possible.

Dependencies

How to use

1. Libtorch installation

  • Make sure that a libtorch version 1.5.0 (either CPU or CUDA support) is installed in your system (default at "/opt/libtorch" in Linux/Mac OS).

2. Import GoTch package

    package main

    import(
        "fmt"
        
        "github.com/sugarme/gotch"
    )

    func main(){
        
        var d gotch.Cuda
        fmt.Printf("Cuda device count: %v\n", d.DeviceCount())
        fmt.Printf("Cuda is available: %v\n", d.IsAvailable())
        fmt.Printf("Cudnn is available: %v\n", d.CudnnIsAvailable())

    }
  • Other examples can be found at example folder

Documentations

Examples

3. Notes on running examples

    # Either
    go clean -cache -testcache .
    go run [EXAMPLE FILES]

    # Or
    go build -a

    go run [EXAMPLE FILES]

License

GoTch is Apache 2.0 licensed.

Acknowledgement

  • This projects has been inspired and used many concepts from tch-rs Libtorch Rust binding.