storage

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BFloat16

type BFloat16 struct {
	// contains filtered or unexported fields
}

func (*BFloat16) Get

func (f *BFloat16) Get() interface{}

func (*BFloat16) GetRequiresGrad

func (b *BFloat16) GetRequiresGrad() bool

func (*BFloat16) GetShape

func (b *BFloat16) GetShape() []int64

func (*BFloat16) New

func (*BFloat16) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*BFloat16) SetRequiresGrad

func (b *BFloat16) SetRequiresGrad(requiresGrad bool)

func (*BFloat16) SetShape

func (b *BFloat16) SetShape(shape []int64)

func (*BFloat16) Type

func (*BFloat16) Type() StorageType

type Byte

type Byte struct {
	// contains filtered or unexported fields
}

func (*Byte) Get

func (b *Byte) Get() interface{}

func (*Byte) GetRequiresGrad

func (b *Byte) GetRequiresGrad() bool

func (*Byte) GetShape

func (b *Byte) GetShape() []int64

func (*Byte) New

func (*Byte) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Byte) SetRequiresGrad

func (b *Byte) SetRequiresGrad(requiresGrad bool)

func (*Byte) SetShape

func (b *Byte) SetShape(shape []int64)

func (*Byte) Type

func (*Byte) Type() StorageType

type Char

type Char struct {
	// contains filtered or unexported fields
}

func (*Char) Get

func (c *Char) Get() interface{}

func (*Char) GetRequiresGrad

func (b *Char) GetRequiresGrad() bool

func (*Char) GetShape

func (b *Char) GetShape() []int64

func (*Char) New

func (*Char) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Char) SetRequiresGrad

func (b *Char) SetRequiresGrad(requiresGrad bool)

func (*Char) SetShape

func (b *Char) SetShape(shape []int64)

func (*Char) Type

func (*Char) Type() StorageType

type Double

type Double struct {
	// contains filtered or unexported fields
}

func (*Double) Get

func (f *Double) Get() interface{}

func (*Double) GetRequiresGrad

func (b *Double) GetRequiresGrad() bool

func (*Double) GetShape

func (b *Double) GetShape() []int64

func (*Double) New

func (*Double) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Double) SetRequiresGrad

func (b *Double) SetRequiresGrad(requiresGrad bool)

func (*Double) SetShape

func (b *Double) SetShape(shape []int64)

func (*Double) Type

func (*Double) Type() StorageType

type Float

type Float struct {
	// contains filtered or unexported fields
}

func (*Float) Get

func (f *Float) Get() interface{}

func (*Float) GetRequiresGrad

func (b *Float) GetRequiresGrad() bool

func (*Float) GetShape

func (b *Float) GetShape() []int64

func (*Float) New

func (*Float) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Float) SetRequiresGrad

func (b *Float) SetRequiresGrad(requiresGrad bool)

func (*Float) SetShape

func (b *Float) SetShape(shape []int64)

func (*Float) Type

func (*Float) Type() StorageType

type Half

type Half struct {
	// contains filtered or unexported fields
}

func (*Half) Get

func (f *Half) Get() interface{}

func (*Half) GetRequiresGrad

func (b *Half) GetRequiresGrad() bool

func (*Half) GetShape

func (b *Half) GetShape() []int64

func (*Half) New

func (*Half) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Half) SetRequiresGrad

func (b *Half) SetRequiresGrad(requiresGrad bool)

func (*Half) SetShape

func (b *Half) SetShape(shape []int64)

func (*Half) Type

func (*Half) Type() StorageType

type Int

type Int struct {
	// contains filtered or unexported fields
}

func (*Int) Get

func (i *Int) Get() interface{}

func (*Int) GetRequiresGrad

func (b *Int) GetRequiresGrad() bool

func (*Int) GetShape

func (b *Int) GetShape() []int64

func (*Int) New

func (*Int) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Int) SetRequiresGrad

func (b *Int) SetRequiresGrad(requiresGrad bool)

func (*Int) SetShape

func (b *Int) SetShape(shape []int64)

func (*Int) Type

func (*Int) Type() StorageType

type Long

type Long struct {
	// contains filtered or unexported fields
}

func (*Long) Get

func (l *Long) Get() interface{}

func (*Long) GetRequiresGrad

func (b *Long) GetRequiresGrad() bool

func (*Long) GetShape

func (b *Long) GetShape() []int64

func (*Long) New

func (*Long) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Long) SetRequiresGrad

func (b *Long) SetRequiresGrad(requiresGrad bool)

func (*Long) SetShape

func (b *Long) SetShape(shape []int64)

func (*Long) Type

func (*Long) Type() StorageType

type Short

type Short struct {
	// contains filtered or unexported fields
}

func (*Short) Get

func (s *Short) Get() interface{}

func (*Short) GetRequiresGrad

func (b *Short) GetRequiresGrad() bool

func (*Short) GetShape

func (b *Short) GetShape() []int64

func (*Short) New

func (*Short) New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)

func (*Short) SetRequiresGrad

func (b *Short) SetRequiresGrad(requiresGrad bool)

func (*Short) SetShape

func (b *Short) SetShape(shape []int64)

func (*Short) Type

func (*Short) Type() StorageType

type Storage

type Storage interface {
	New(wg *sync.WaitGroup, size int, file *zip.File) (Storage, error)
	SetShape(shape []int64)
	GetShape() []int64
	SetRequiresGrad(requiresGrad bool)
	GetRequiresGrad() bool
	Type() StorageType
	Get() interface{}
}

type StorageType

type StorageType byte
const (
	TypeBFloat16 StorageType = iota // torch.bfloat16
	TypeHalf                        // torch.half, torch.float16
	TypeFloat                       // torch.float, torch.float32
	TypeDouble                      // torch.double, torch.float64
	TypeByte                        // torch.byte, torch.uint8
	TypeChar                        // torch.char, torch.int8
	TypeShort                       // torch.short, torch.int16
	TypeInt                         // torch.int, torch.int32
	TypeLong                        // torch.long, torch.int64
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL