Move the name of the module
This commit is contained in:
parent
db661550e5
commit
9257404edd
|
@ -1,3 +1,6 @@
|
|||
# Fork of gotch modified to work with my fyp project
|
||||
|
||||
|
||||
# Gotch [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)[![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/sugarme/gotch?tab=doc)
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package gotch
|
|||
import (
|
||||
"log"
|
||||
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
type Device struct {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// DataLoader combines a dataset and a sampler and provides
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch/dutil"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/dutil"
|
||||
)
|
||||
|
||||
func TestNewDataLoader(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch/dutil"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/dutil"
|
||||
)
|
||||
|
||||
func TestNewSliceDataset(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package dutil_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch/dutil"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/dutil"
|
||||
)
|
||||
|
||||
func TestNewKFold(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch/dutil"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/dutil"
|
||||
)
|
||||
|
||||
func TestSequentialSampler(t *testing.T) {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"github.com/sugarme/gotch/vision/aug"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision/aug"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -3,8 +3,8 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -12,10 +12,10 @@ import (
|
|||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
func convBn(p *nn.Path, cIn, cOut int64) *nn.SequentialT {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
var device string
|
||||
|
|
|
@ -5,10 +5,10 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -9,9 +9,9 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -7,10 +7,10 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -7,10 +7,10 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,9 +3,9 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,10 +5,10 @@ import (
|
|||
"log"
|
||||
"runtime"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -10,10 +10,10 @@ import (
|
|||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/pickle"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/pickle"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -10,10 +10,10 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -3,8 +3,8 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -9,10 +9,10 @@ import (
|
|||
"log"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -17,9 +17,9 @@ import (
|
|||
"log"
|
||||
"math/rand"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -9,9 +9,9 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type Block struct {
|
||||
|
|
|
@ -15,8 +15,8 @@ import (
|
|||
"golang.org/x/image/draw"
|
||||
"golang.org/x/image/font"
|
||||
|
||||
"github.com/sugarme/gotch/example/yolo/freetype"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/example/yolo/freetype"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -8,10 +8,10 @@ import (
|
|||
"path/filepath"
|
||||
"sort"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
|||
module github.com/sugarme/gotch
|
||||
module git.andr3h3nriqu3s.com/andr3/gotch
|
||||
|
||||
go 1.20
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
float16 "github.com/sugarme/gotch/half"
|
||||
float16 "git.andr3h3nriqu3s.com/andr3/gotch/half"
|
||||
)
|
||||
|
||||
// prevent compiler optimizing out code by assigning to these
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
float16 "github.com/sugarme/gotch/half"
|
||||
float16 "git.andr3h3nriqu3s.com/andr3/gotch/half"
|
||||
)
|
||||
|
||||
// wantF32toF16bits is a tiny subset of expected values
|
||||
|
|
|
@ -5,7 +5,7 @@ package nn
|
|||
import (
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Batch-normalization config.
|
||||
|
|
|
@ -5,7 +5,7 @@ package nn
|
|||
import (
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type ConvTranspose1DConfig struct {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"math"
|
||||
"reflect"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Conv1DConfig:
|
||||
|
|
|
@ -3,7 +3,7 @@ package nn
|
|||
// Layers defined by closure
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type Func struct {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"math"
|
||||
"strings"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type Init interface {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Test whether InitTensor() can cause memory blow-up due to accumulate gradient.
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// TrainableCModule is a trainable version of JIT Pytorch module
|
||||
|
|
|
@ -2,7 +2,7 @@ package nn
|
|||
|
||||
// A layer-normalization layer.
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Layer-normalization config.
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"fmt"
|
||||
"math"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// LinearConfig is a configuration for a linear layer
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package nn
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type lossFnOptions struct {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"log"
|
||||
"math"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Optimizer is a struct object to run gradient descent.
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func TestOptimizer(t *testing.T) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package nn
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Dropout:
|
||||
|
|
|
@ -3,8 +3,8 @@ package nn
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type State interface{}
|
||||
|
|
|
@ -5,9 +5,9 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func gruTest(rnnConfig *nn.RNNConfig, t *testing.T) {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
)
|
||||
|
||||
func TestLambdaLR(t *testing.T) {
|
||||
|
|
|
@ -3,8 +3,8 @@ package nn
|
|||
// A sequential layer used to chain multiple layers and closures.
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Sequential is a layer (container) that combines multiple other layers.
|
||||
|
|
|
@ -3,7 +3,7 @@ package nn
|
|||
// Sparse layers
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Configuration option for an embedding layer.
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func embeddingTest(embeddingConfig *nn.EmbeddingConfig, t *testing.T) {
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// SEP is a separator to separate path elements in the tensor names.
|
||||
|
|
|
@ -8,9 +8,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func TestVarStoreEntry(t *testing.T) {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/pickle"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/pickle"
|
||||
)
|
||||
|
||||
func ExampleLoadInfo() {
|
||||
|
|
|
@ -20,9 +20,9 @@ import (
|
|||
"reflect"
|
||||
"sort"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
const hexMagicNumber = "1950a86a20f9469cfc6c"
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"io"
|
||||
"math"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/half"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/half"
|
||||
)
|
||||
|
||||
// This file implements Pytorch storage data types.
|
||||
|
|
|
@ -3,8 +3,8 @@ package ts_test
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func ExampleTensor_MustArange() {
|
||||
|
|
|
@ -3,8 +3,8 @@ package ts_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// GOMAXPROCS=8 go test -bench=BenchmarkConv2d -benchtime=100x -run=^a | tee op-conv-bench.txt
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
// Iter2 is an iterator over a pair of tensors which have the same first dimension
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func TestTextData_NewTextData(t *testing.T) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"runtime/debug"
|
||||
"unsafe"
|
||||
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
// ptrToString check C pointer for null. If not null, get value
|
||||
|
|
|
@ -5,7 +5,7 @@ import "C"
|
|||
import (
|
||||
// "unsafe"
|
||||
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
// LoadHwc returns a tensor of shape [height, width, channels] on success.
|
||||
|
|
|
@ -66,7 +66,7 @@ import (
|
|||
"log"
|
||||
"reflect"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
type NewAxis struct{}
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func TestIntegerIndex(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
type Iterator interface {
|
||||
|
|
|
@ -14,8 +14,8 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
type CIValue struct {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func roundTrip(v interface{}, t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ package ts
|
|||
import(
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func TestNpyHeaderParse(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package ts
|
|||
import (
|
||||
"log"
|
||||
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
type COptimizer struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package ts_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func ExampleTensor_Split(t *testing.T) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"log"
|
||||
"unsafe"
|
||||
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
// NOTE. This is a temporarily patched to make it run.
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"reflect"
|
||||
"strconv"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
func (ts *Tensor) ValueGo() interface{} {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func TestTensor_Format(t *testing.T) {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"runtime"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
type Scalar struct {
|
||||
|
|
|
@ -9,8 +9,8 @@ import(
|
|||
"unsafe"
|
||||
"fmt"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ import (
|
|||
"time"
|
||||
"unsafe"
|
||||
|
||||
gotch "github.com/sugarme/gotch"
|
||||
lib "github.com/sugarme/gotch/libtch"
|
||||
gotch "git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
var n int = 10
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func TestTensorInit(t *testing.T) {
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
gotch "github.com/sugarme/gotch"
|
||||
gotch "git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
)
|
||||
|
||||
// nativeEndian is a ByteOrder for local platform.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package vision
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/nn"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/nn"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// AlexNet implementation
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package aug
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// RandomAffine is transformation of the image keeping center invariant.
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type GaussianBlur struct {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Ref. https://github.com/pytorch/vision/blob/f1d734213af65dc06e777877d315973ba8386080/torchvision/transforms/functional_tensor.py
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package aug
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// RandomAutocontrast autocontrasts the pixels of the given image randomly with a given probability.
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
// "math"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type RandomCrop struct {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"log"
|
||||
"math"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Randomly selects a rectangle region in an torch Tensor image and erases its pixels.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package aug
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// RandomEqualize equalizes the histogram of the given image randomly with a given probability.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package aug
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// RandomHorizontalFlip horizontally flips the given image randomly with a given probability.
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
func gaussianKernel1D(ks int64, sigma float64, dtype gotch.DType, device gotch.Device) *ts.Tensor {
|
||||
|
|
|
@ -3,7 +3,7 @@ package aug
|
|||
import (
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// GrayScale converts image to grayscale.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package aug
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
type RandomInvert struct {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package aug
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// Normalize normalizes a tensor image with mean and standard deviation.
|
||||
|
|
|
@ -3,8 +3,8 @@ package aug
|
|||
import (
|
||||
// "fmt"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// RandomPerspective performs a random perspective transformation of the given image with a given probability.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package aug
|
||||
|
||||
import (
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
)
|
||||
|
||||
// RandomPosterize posterizes the image randomly with a given probability by reducing the
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/sugarme/gotch"
|
||||
"github.com/sugarme/gotch/ts"
|
||||
"github.com/sugarme/gotch/vision"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/ts"
|
||||
"git.andr3h3nriqu3s.com/andr3/gotch/vision"
|
||||
)
|
||||
|
||||
type ResizeModule struct {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user