Documentation ¶
Index ¶
- Variables
- func FloatBits16to32(u16 uint16) uint32
- func Load(filename string) (interface{}, error)
- func LoadWithUnpickler(filename string, newUnpickler func(r io.Reader) pickle.Unpickler) (interface{}, error)
- type BFloat16Storage
- type BFloat16StorageClass
- type BaseStorage
- type BoolStorage
- type BoolStorageClass
- type ByteStorage
- type ByteStorageClass
- type CharStorage
- type CharStorageClass
- type DoubleStorage
- type DoubleStorageClass
- type FloatStorage
- type FloatStorageClass
- type HalfStorage
- type HalfStorageClass
- type IntStorage
- type IntStorageClass
- type LimitedBufferReader
- type LongStorage
- type LongStorageClass
- type RebuildTensorV2
- type ShortStorage
- type ShortStorageClass
- type StorageClassInterface
- type StorageInterface
- type Tensor
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidMagicNumber = errors.New("invalid pytorch magic number")
View Source
var ErrInvalidProtocolVersion = errors.New("invalid pytorch protocol version")
Functions ¶
func FloatBits16to32 ¶
FloatBits16to32 converts the bits representation of a Half Float (16 bits) number to an IEEE 754 float representation (32 bits) From http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf
Types ¶
type BFloat16Storage ¶ added in v0.2.0
type BFloat16Storage struct { BaseStorage Data []float32 }
func (*BFloat16Storage) SetFromFile ¶ added in v0.2.0
func (f *BFloat16Storage) SetFromFile(r io.Reader) error
func (*BFloat16Storage) SetFromFileWithSize ¶ added in v0.2.0
func (f *BFloat16Storage) SetFromFileWithSize(r io.Reader, size int) error
type BFloat16StorageClass ¶ added in v0.2.0
type BFloat16StorageClass struct{}
func (*BFloat16StorageClass) New ¶ added in v0.2.0
func (f *BFloat16StorageClass) New(size int, location string) StorageInterface
type BaseStorage ¶
type BoolStorage ¶
type BoolStorage struct { BaseStorage Data []bool }
func (*BoolStorage) SetFromFile ¶
func (f *BoolStorage) SetFromFile(r io.Reader) error
func (*BoolStorage) SetFromFileWithSize ¶
func (f *BoolStorage) SetFromFileWithSize(r io.Reader, size int) error
type BoolStorageClass ¶
type BoolStorageClass struct{}
func (*BoolStorageClass) New ¶
func (f *BoolStorageClass) New(size int, location string) StorageInterface
type ByteStorage ¶
type ByteStorage struct { BaseStorage Data []uint8 }
func (*ByteStorage) SetFromFile ¶
func (f *ByteStorage) SetFromFile(r io.Reader) error
func (*ByteStorage) SetFromFileWithSize ¶
func (f *ByteStorage) SetFromFileWithSize(r io.Reader, size int) error
type ByteStorageClass ¶
type ByteStorageClass struct{}
func (*ByteStorageClass) New ¶
func (f *ByteStorageClass) New(size int, location string) StorageInterface
type CharStorage ¶
type CharStorage struct { BaseStorage Data []int8 }
func (*CharStorage) SetFromFile ¶
func (f *CharStorage) SetFromFile(r io.Reader) error
func (*CharStorage) SetFromFileWithSize ¶
func (f *CharStorage) SetFromFileWithSize(r io.Reader, size int) error
type CharStorageClass ¶
type CharStorageClass struct{}
func (*CharStorageClass) New ¶
func (f *CharStorageClass) New(size int, location string) StorageInterface
type DoubleStorage ¶
type DoubleStorage struct { BaseStorage Data []float64 }
func (*DoubleStorage) SetFromFile ¶
func (f *DoubleStorage) SetFromFile(r io.Reader) error
func (*DoubleStorage) SetFromFileWithSize ¶
func (f *DoubleStorage) SetFromFileWithSize(r io.Reader, size int) error
type DoubleStorageClass ¶
type DoubleStorageClass struct{}
func (*DoubleStorageClass) New ¶
func (f *DoubleStorageClass) New(size int, location string) StorageInterface
type FloatStorage ¶
type FloatStorage struct { BaseStorage Data []float32 }
func (*FloatStorage) SetFromFile ¶
func (f *FloatStorage) SetFromFile(r io.Reader) error
func (*FloatStorage) SetFromFileWithSize ¶
func (f *FloatStorage) SetFromFileWithSize(r io.Reader, size int) error
type FloatStorageClass ¶
type FloatStorageClass struct{}
func (*FloatStorageClass) New ¶
func (f *FloatStorageClass) New(size int, location string) StorageInterface
type HalfStorage ¶
type HalfStorage struct { BaseStorage Data []float32 }
func (*HalfStorage) SetFromFile ¶
func (f *HalfStorage) SetFromFile(r io.Reader) error
func (*HalfStorage) SetFromFileWithSize ¶
func (f *HalfStorage) SetFromFileWithSize(r io.Reader, size int) error
type HalfStorageClass ¶
type HalfStorageClass struct{}
func (*HalfStorageClass) New ¶
func (f *HalfStorageClass) New(size int, location string) StorageInterface
type IntStorage ¶
type IntStorage struct { BaseStorage Data []int32 }
func (*IntStorage) SetFromFile ¶
func (f *IntStorage) SetFromFile(r io.Reader) error
func (*IntStorage) SetFromFileWithSize ¶
func (f *IntStorage) SetFromFileWithSize(r io.Reader, size int) error
type IntStorageClass ¶
type IntStorageClass struct{}
func (*IntStorageClass) New ¶
func (f *IntStorageClass) New(size int, location string) StorageInterface
type LimitedBufferReader ¶
type LimitedBufferReader struct {
// contains filtered or unexported fields
}
func NewLimitedBufferReader ¶
func NewLimitedBufferReader( r io.Reader, dataSize, scalarSize, bufferSize int, ) *LimitedBufferReader
func (*LimitedBufferReader) HasNext ¶
func (br *LimitedBufferReader) HasNext() bool
func (*LimitedBufferReader) ReadNext ¶
func (br *LimitedBufferReader) ReadNext() ([]byte, error)
type LongStorage ¶
type LongStorage struct { BaseStorage Data []int64 }
func (*LongStorage) SetFromFile ¶
func (f *LongStorage) SetFromFile(r io.Reader) error
func (*LongStorage) SetFromFileWithSize ¶
func (f *LongStorage) SetFromFileWithSize(r io.Reader, size int) error
type LongStorageClass ¶
type LongStorageClass struct{}
func (*LongStorageClass) New ¶
func (f *LongStorageClass) New(size int, location string) StorageInterface
type RebuildTensorV2 ¶
type RebuildTensorV2 struct{}
func (*RebuildTensorV2) Call ¶
func (r *RebuildTensorV2) Call(args ...interface{}) (interface{}, error)
type ShortStorage ¶
type ShortStorage struct { BaseStorage Data []int16 }
func (*ShortStorage) SetFromFile ¶
func (f *ShortStorage) SetFromFile(r io.Reader) error
func (*ShortStorage) SetFromFileWithSize ¶
func (f *ShortStorage) SetFromFileWithSize(r io.Reader, size int) error
type ShortStorageClass ¶
type ShortStorageClass struct{}
func (*ShortStorageClass) New ¶
func (f *ShortStorageClass) New(size int, location string) StorageInterface
type StorageClassInterface ¶
type StorageClassInterface interface {
New(size int, location string) StorageInterface
}
type StorageInterface ¶
Click to show internal directories.
Click to hide internal directories.