synapse

package
v1.9.55 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: GPL-3.0, GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATA_PATH   string = "/data"
	SYMBOL_PATH string = "/data/symbol"
	PARAM_PATH  string = "/data/params"
)
View Source
const MinMemoryUsage int64 = 2 * 1024 * 1024 * 1024
View Source
const PLUGIN_PATH string = "plugins/"
View Source
const PLUGIN_POST_FIX string = "_cvm.so"
View Source
const ReservedMemoryUsage int64 = 512 * 1024 * 1024

Variables

View Source
var (
	KERNEL_RUNTIME_ERROR = errors.New("Kernel runtime error")
	KERNEL_LOGIC_ERROR   = errors.New("Kernel logic error")
)
View Source
var CvmFixHashes = map[string][]byte{
	"0x53f8e0b0c93dedff2706e28643804470d67d79a9f1447b75dab09304ed8d1fe0": []byte{19, 52, 238, 252, 208, 237, 223, 227, 243, 91},
	"0xe0c42bc0779d627e14fba7c4e6f355644aa2535dfe9786d64684fb05f1de615c": []byte{6, 252, 4, 59, 242, 0, 247, 30, 224, 217},
}

Functions

func RLPHashString added in v1.0.0

func RLPHashString(x interface{}) string

func ReadData added in v1.0.0

func ReadData(r *inference.NpyReader) ([]byte, error)

Types

type Config

type Config struct {
	// StorageDir    string `toml:",omitempty"`
	IsNotCache     bool   `toml:",omitempty"`
	DeviceType     string `toml:",omitempty"`
	DeviceId       int    `toml:",omitempty"`
	IsRemoteInfer  bool   `toml:",omitempty"`
	InferURI       string `toml:",omitempty"`
	Debug          bool   `toml:",omitempty"`
	MaxMemoryUsage int64
	Storagefs      torrentfs.CVMStorage
}
var DefaultConfig Config = Config{

	IsNotCache:     false,
	DeviceType:     "cpu",
	DeviceId:       0,
	IsRemoteInfer:  false,
	InferURI:       "",
	Debug:          false,
	MaxMemoryUsage: 4 * 1024 * 1024 * 1024,
}

type Synapse

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

func Engine

func Engine() *Synapse

func New

func New(config *Config) *Synapse

func (*Synapse) Available added in v1.9.51

func (s *Synapse) Available(infoHash string, rawSize int64) error

func (*Synapse) Close

func (s *Synapse) Close()

func (*Synapse) GetGasByInfoHash added in v1.0.0

func (s *Synapse) GetGasByInfoHash(modelInfoHash string) (gas uint64, err error)

func (*Synapse) InferByInfoHash

func (s *Synapse) InferByInfoHash(modelInfoHash, inputInfoHash string) ([]byte, error)

func (*Synapse) InferByInputContent

func (s *Synapse) InferByInputContent(modelInfoHash string, inputContent []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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