Move the name of the module

This commit is contained in:
Goncalves Henriques, Andre (UG - Computer Science) 2024-04-21 15:15:00 +01:00
parent db661550e5
commit 9257404edd
116 changed files with 220 additions and 217 deletions

View File

@ -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) # 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)

View File

@ -3,7 +3,7 @@ package gotch
import ( import (
"log" "log"
lib "github.com/sugarme/gotch/libtch" lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
) )
type Device struct { type Device struct {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"reflect" "reflect"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// DataLoader combines a dataset and a sampler and provides // DataLoader combines a dataset and a sampler and provides

View File

@ -5,7 +5,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch/dutil" "git.andr3h3nriqu3s.com/andr3/gotch/dutil"
) )
func TestNewDataLoader(t *testing.T) { func TestNewDataLoader(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch/dutil" "git.andr3h3nriqu3s.com/andr3/gotch/dutil"
) )
func TestNewSliceDataset(t *testing.T) { func TestNewSliceDataset(t *testing.T) {

View File

@ -3,7 +3,7 @@ package dutil_test
import ( import (
"testing" "testing"
"github.com/sugarme/gotch/dutil" "git.andr3h3nriqu3s.com/andr3/gotch/dutil"
) )
func TestNewKFold(t *testing.T) { func TestNewKFold(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch/dutil" "git.andr3h3nriqu3s.com/andr3/gotch/dutil"
) )
func TestSequentialSampler(t *testing.T) { func TestSequentialSampler(t *testing.T) {

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
"github.com/sugarme/gotch/vision/aug" "git.andr3h3nriqu3s.com/andr3/gotch/vision/aug"
) )
func main() { func main() {

View File

@ -3,8 +3,8 @@ package main
import ( import (
"fmt" "fmt"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func main() { func main() {

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
const ( const (

View File

@ -12,10 +12,10 @@ import (
"log" "log"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
func convBn(p *nn.Path, cIn, cOut int64) *nn.SequentialT { func convBn(p *nn.Path, cIn, cOut int64) *nn.SequentialT {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func main() { func main() {

View File

@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
var device string var device string

View File

@ -5,10 +5,10 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
var ( var (

View File

@ -9,9 +9,9 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
var ( var (

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"math/rand" "math/rand"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
const ( const (

View File

@ -7,10 +7,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
func main() { func main() {

View File

@ -7,10 +7,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
const ( const (

View File

@ -3,9 +3,9 @@ package main
import ( import (
"fmt" "fmt"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
const ( const (

View File

@ -3,7 +3,7 @@ package main
import ( import (
"flag" "flag"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
) )
var ( var (

View File

@ -5,10 +5,10 @@ import (
"log" "log"
"runtime" "runtime"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
const ( const (

View File

@ -10,10 +10,10 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
const ( const (

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/pickle" "git.andr3h3nriqu3s.com/andr3/gotch/pickle"
) )
func main() { func main() {

View File

@ -10,10 +10,10 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
var ( var (

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func main() { func main() {

View File

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func main() { func main() {

View File

@ -3,8 +3,8 @@ package main
import ( import (
"fmt" "fmt"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func main() { func main() {

View File

@ -9,10 +9,10 @@ import (
"log" "log"
"path/filepath" "path/filepath"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
var ( var (

View File

@ -17,9 +17,9 @@ import (
"log" "log"
"math/rand" "math/rand"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
var ( var (

View File

@ -9,9 +9,9 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type Block struct { type Block struct {

View File

@ -15,8 +15,8 @@ import (
"golang.org/x/image/draw" "golang.org/x/image/draw"
"golang.org/x/image/font" "golang.org/x/image/font"
"github.com/sugarme/gotch/example/yolo/freetype" "git.andr3h3nriqu3s.com/andr3/gotch/example/yolo/freetype"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
var ( var (

View File

@ -8,10 +8,10 @@ import (
"path/filepath" "path/filepath"
"sort" "sort"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
const ( const (

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/sugarme/gotch module git.andr3h3nriqu3s.com/andr3/gotch
go 1.20 go 1.20

View File

@ -6,7 +6,7 @@ import (
"math" "math"
"testing" "testing"
float16 "github.com/sugarme/gotch/half" float16 "git.andr3h3nriqu3s.com/andr3/gotch/half"
) )
// prevent compiler optimizing out code by assigning to these // prevent compiler optimizing out code by assigning to these

View File

@ -11,7 +11,7 @@ import (
"math" "math"
"testing" "testing"
float16 "github.com/sugarme/gotch/half" float16 "git.andr3h3nriqu3s.com/andr3/gotch/half"
) )
// wantF32toF16bits is a tiny subset of expected values // wantF32toF16bits is a tiny subset of expected values

View File

@ -5,7 +5,7 @@ package nn
import ( import (
"log" "log"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Batch-normalization config. // Batch-normalization config.

View File

@ -5,7 +5,7 @@ package nn
import ( import (
"log" "log"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type ConvTranspose1DConfig struct { type ConvTranspose1DConfig struct {

View File

@ -7,7 +7,7 @@ import (
"math" "math"
"reflect" "reflect"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Conv1DConfig: // Conv1DConfig:

View File

@ -3,7 +3,7 @@ package nn
// Layers defined by closure // Layers defined by closure
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type Func struct { type Func struct {

View File

@ -6,8 +6,8 @@ import (
"math" "math"
"strings" "strings"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type Init interface { type Init interface {

View File

@ -5,8 +5,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Test whether InitTensor() can cause memory blow-up due to accumulate gradient. // Test whether InitTensor() can cause memory blow-up due to accumulate gradient.

View File

@ -5,7 +5,7 @@ import (
"log" "log"
"strings" "strings"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// TrainableCModule is a trainable version of JIT Pytorch module // TrainableCModule is a trainable version of JIT Pytorch module

View File

@ -2,7 +2,7 @@ package nn
// A layer-normalization layer. // A layer-normalization layer.
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Layer-normalization config. // Layer-normalization config.

View File

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"math" "math"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// LinearConfig is a configuration for a linear layer // LinearConfig is a configuration for a linear layer

View File

@ -1,7 +1,7 @@
package nn package nn
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type lossFnOptions struct { type lossFnOptions struct {

View File

@ -7,7 +7,7 @@ import (
"log" "log"
"math" "math"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Optimizer is a struct object to run gradient descent. // Optimizer is a struct object to run gradient descent.

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func TestOptimizer(t *testing.T) { func TestOptimizer(t *testing.T) {

View File

@ -1,7 +1,7 @@
package nn package nn
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Dropout: // Dropout:

View File

@ -3,8 +3,8 @@ package nn
import ( import (
"fmt" "fmt"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type State interface{} type State interface{}

View File

@ -5,9 +5,9 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func gruTest(rnnConfig *nn.RNNConfig, t *testing.T) { func gruTest(rnnConfig *nn.RNNConfig, t *testing.T) {

View File

@ -6,8 +6,8 @@ import (
"math" "math"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
) )
func TestLambdaLR(t *testing.T) { func TestLambdaLR(t *testing.T) {

View File

@ -3,8 +3,8 @@ package nn
// A sequential layer used to chain multiple layers and closures. // A sequential layer used to chain multiple layers and closures.
import ( import (
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Sequential is a layer (container) that combines multiple other layers. // Sequential is a layer (container) that combines multiple other layers.

View File

@ -3,7 +3,7 @@ package nn
// Sparse layers // Sparse layers
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Configuration option for an embedding layer. // Configuration option for an embedding layer.

View File

@ -4,9 +4,9 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func embeddingTest(embeddingConfig *nn.EmbeddingConfig, t *testing.T) { func embeddingTest(embeddingConfig *nn.EmbeddingConfig, t *testing.T) {

View File

@ -8,8 +8,8 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// SEP is a separator to separate path elements in the tensor names. // SEP is a separator to separate path elements in the tensor names.

View File

@ -8,9 +8,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func TestVarStoreEntry(t *testing.T) { func TestVarStoreEntry(t *testing.T) {

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/pickle" "git.andr3h3nriqu3s.com/andr3/gotch/pickle"
) )
func ExampleLoadInfo() { func ExampleLoadInfo() {

View File

@ -20,9 +20,9 @@ import (
"reflect" "reflect"
"sort" "sort"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
const hexMagicNumber = "1950a86a20f9469cfc6c" const hexMagicNumber = "1950a86a20f9469cfc6c"

View File

@ -6,8 +6,8 @@ import (
"io" "io"
"math" "math"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/half" "git.andr3h3nriqu3s.com/andr3/gotch/half"
) )
// This file implements Pytorch storage data types. // This file implements Pytorch storage data types.

View File

@ -3,8 +3,8 @@ package ts_test
import ( import (
"fmt" "fmt"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func ExampleTensor_MustArange() { func ExampleTensor_MustArange() {

View File

@ -3,8 +3,8 @@ package ts_test
import ( import (
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// GOMAXPROCS=8 go test -bench=BenchmarkConv2d -benchtime=100x -run=^a | tee op-conv-bench.txt // GOMAXPROCS=8 go test -bench=BenchmarkConv2d -benchtime=100x -run=^a | tee op-conv-bench.txt

View File

@ -7,7 +7,7 @@ import (
"os" "os"
"path/filepath" "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 // Iter2 is an iterator over a pair of tensors which have the same first dimension

View File

@ -8,8 +8,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func TestTextData_NewTextData(t *testing.T) { func TestTextData_NewTextData(t *testing.T) {

View File

@ -8,7 +8,7 @@ import (
"runtime/debug" "runtime/debug"
"unsafe" "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 // ptrToString check C pointer for null. If not null, get value

View File

@ -5,7 +5,7 @@ import "C"
import ( import (
// "unsafe" // "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. // LoadHwc returns a tensor of shape [height, width, channels] on success.

View File

@ -66,7 +66,7 @@ import (
"log" "log"
"reflect" "reflect"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
) )
type NewAxis struct{} type NewAxis struct{}

View File

@ -4,8 +4,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func TestIntegerIndex(t *testing.T) { func TestIntegerIndex(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
) )
type Iterator interface { type Iterator interface {

View File

@ -14,8 +14,8 @@ import (
"reflect" "reflect"
"unsafe" "unsafe"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
lib "github.com/sugarme/gotch/libtch" lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
) )
type CIValue struct { type CIValue struct {

View File

@ -4,7 +4,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func roundTrip(v interface{}, t *testing.T) { func roundTrip(v interface{}, t *testing.T) {

View File

@ -5,7 +5,7 @@ package ts
import( import(
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
) )

View File

@ -11,7 +11,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
) )
const ( const (

View File

@ -4,8 +4,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func TestNpyHeaderParse(t *testing.T) { func TestNpyHeaderParse(t *testing.T) {

View File

@ -3,7 +3,7 @@ package ts
import ( import (
"log" "log"
lib "github.com/sugarme/gotch/libtch" lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
) )
type COptimizer struct { type COptimizer struct {

View File

@ -3,8 +3,8 @@ package ts_test
import ( import (
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func ExampleTensor_Split(t *testing.T) { func ExampleTensor_Split(t *testing.T) {

View File

@ -7,7 +7,7 @@ import (
"log" "log"
"unsafe" "unsafe"
lib "github.com/sugarme/gotch/libtch" lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
) )
// NOTE. This is a temporarily patched to make it run. // NOTE. This is a temporarily patched to make it run.

View File

@ -7,7 +7,7 @@ import (
"reflect" "reflect"
"strconv" "strconv"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
) )
func (ts *Tensor) ValueGo() interface{} { func (ts *Tensor) ValueGo() interface{} {

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func TestTensor_Format(t *testing.T) { func TestTensor_Format(t *testing.T) {

View File

@ -6,8 +6,8 @@ import (
"runtime" "runtime"
"sync/atomic" "sync/atomic"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
lib "github.com/sugarme/gotch/libtch" lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
) )
type Scalar struct { type Scalar struct {

View File

@ -9,8 +9,8 @@ import(
"unsafe" "unsafe"
"fmt" "fmt"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
lib "github.com/sugarme/gotch/libtch" lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
) )

View File

@ -17,8 +17,8 @@ import (
"time" "time"
"unsafe" "unsafe"
gotch "github.com/sugarme/gotch" gotch "git.andr3h3nriqu3s.com/andr3/gotch"
lib "github.com/sugarme/gotch/libtch" lib "git.andr3h3nriqu3s.com/andr3/gotch/libtch"
) )
var ( var (

View File

@ -8,7 +8,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
) )
var n int = 10 var n int = 10

View File

@ -4,8 +4,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func TestTensorInit(t *testing.T) { func TestTensorInit(t *testing.T) {

View File

@ -12,7 +12,7 @@ import (
"reflect" "reflect"
"unsafe" "unsafe"
gotch "github.com/sugarme/gotch" gotch "git.andr3h3nriqu3s.com/andr3/gotch"
) )
// nativeEndian is a ByteOrder for local platform. // nativeEndian is a ByteOrder for local platform.

View File

@ -1,8 +1,8 @@
package vision package vision
import ( import (
"github.com/sugarme/gotch/nn" "git.andr3h3nriqu3s.com/andr3/gotch/nn"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// AlexNet implementation // AlexNet implementation

View File

@ -1,8 +1,8 @@
package aug package aug
import ( import (
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// RandomAffine is transformation of the image keeping center invariant. // RandomAffine is transformation of the image keeping center invariant.

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type GaussianBlur struct { type GaussianBlur struct {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"log" "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 // Ref. https://github.com/pytorch/vision/blob/f1d734213af65dc06e777877d315973ba8386080/torchvision/transforms/functional_tensor.py

View File

@ -1,7 +1,7 @@
package aug package aug
import ( 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. // RandomAutocontrast autocontrasts the pixels of the given image randomly with a given probability.

View File

@ -6,8 +6,8 @@ import (
// "math" // "math"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type RandomCrop struct { type RandomCrop struct {

View File

@ -5,8 +5,8 @@ import (
"log" "log"
"math" "math"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Randomly selects a rectangle region in an torch Tensor image and erases its pixels. // Randomly selects a rectangle region in an torch Tensor image and erases its pixels.

View File

@ -1,7 +1,7 @@
package aug package aug
import ( 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. // RandomEqualize equalizes the histogram of the given image randomly with a given probability.

View File

@ -1,8 +1,8 @@
package aug package aug
import ( import (
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// RandomHorizontalFlip horizontally flips the given image randomly with a given probability. // RandomHorizontalFlip horizontally flips the given image randomly with a given probability.

View File

@ -7,8 +7,8 @@ import (
"math/rand" "math/rand"
"time" "time"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
func gaussianKernel1D(ks int64, sigma float64, dtype gotch.DType, device gotch.Device) *ts.Tensor { func gaussianKernel1D(ks int64, sigma float64, dtype gotch.DType, device gotch.Device) *ts.Tensor {

View File

@ -3,7 +3,7 @@ package aug
import ( import (
"log" "log"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// GrayScale converts image to grayscale. // GrayScale converts image to grayscale.

View File

@ -1,7 +1,7 @@
package aug package aug
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
type RandomInvert struct { type RandomInvert struct {

View File

@ -1,7 +1,7 @@
package aug package aug
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// Normalize normalizes a tensor image with mean and standard deviation. // Normalize normalizes a tensor image with mean and standard deviation.

View File

@ -3,8 +3,8 @@ package aug
import ( import (
// "fmt" // "fmt"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// RandomPerspective performs a random perspective transformation of the given image with a given probability. // RandomPerspective performs a random perspective transformation of the given image with a given probability.

View File

@ -1,7 +1,7 @@
package aug package aug
import ( import (
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
) )
// RandomPosterize posterizes the image randomly with a given probability by reducing the // RandomPosterize posterizes the image randomly with a given probability by reducing the

View File

@ -4,9 +4,9 @@ import (
"fmt" "fmt"
"log" "log"
"github.com/sugarme/gotch" "git.andr3h3nriqu3s.com/andr3/gotch"
"github.com/sugarme/gotch/ts" "git.andr3h3nriqu3s.com/andr3/gotch/ts"
"github.com/sugarme/gotch/vision" "git.andr3h3nriqu3s.com/andr3/gotch/vision"
) )
type ResizeModule struct { type ResizeModule struct {

Some files were not shown because too many files have changed in this diff Show More