weights

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindWeights

func FindWeights(fw FileWalker) ([]string, []string, error)

Types

type FileWalker

type FileWalker func(root string, walkFn filepath.WalkFunc) error

FileWalker is a function type that walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root.

type Manifest added in v0.8.3

type Manifest struct {
	Files map[string]Metadata `json:"files"`
}

Manifest contains metadata about weights files in a model

func LoadManifest added in v0.8.3

func LoadManifest(filename string) (*Manifest, error)

LoadManifest loads a manifest from a file

func NewManifest added in v0.8.3

func NewManifest() *Manifest

NewManifest creates a new manifest

func (*Manifest) AddFile added in v0.8.3

func (m *Manifest) AddFile(path string) error

AddFile adds a file to the manifest, calculating its CRC32 checksum

func (*Manifest) Equal added in v0.8.3

func (m *Manifest) Equal(other *Manifest) bool

Equal compares the files in two manifests for strict equality

func (*Manifest) Save added in v0.8.3

func (m *Manifest) Save(filename string) error

Save saves a manifest to a file

type Metadata added in v0.8.3

type Metadata struct {
	// CRC32 is the CRC32 checksum of the file encoded as a hexadecimal string
	CRC32 string `json:"crc32"`
}

Metadata contains information about a file

Jump to

Keyboard shortcuts

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