synapse

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: GPL-3.0, GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Model_V1 = "model-v1"
)

Functions

func CheckMetaHash

func CheckMetaHash(version string, infoHash string) error

func DumpToFile

func DumpToFile(fname string, data []byte) error

func ReadImage

func ReadImage(inputFilePath string) ([]byte, error)

Types

type Config

type Config struct {
	StorageDir string
	IsNotCache bool
}

type NpyReader

type NpyReader struct {

	// The numpy data type of the array
	Dtype string

	// The endianness of the binary data
	Endian binary.ByteOrder

	// The version number of the file format
	Version int

	// The shape of the array as specified in the file.
	Shape []int

	// If true, the data are flattened in column-major order,
	// otherwise they are flattened in row-major order.
	ColumnMajor bool
	// contains filtered or unexported fields
}

NpyReader can read data from a Numpy binary array into a Go slice.

func NewFileReader

func NewFileReader(f string) (*NpyReader, error)

NewFileReader is a convenience method returning a NpyReader that can be used to obtain array data from the given named file. Call one of the GetXXX methods to obtain the data slice.

func NewReader

func NewReader(r io.Reader) (*NpyReader, error)

NewReader returns a NpyReader that can be used to obtain array data as a Go slice. The Go slice has a type matching the dtype in the Numpy file. Call one of the GetXX methods to obtain the slice.

func (*NpyReader) GetBytes

func (rdr *NpyReader) GetBytes() ([]byte, error)

func (*NpyReader) GetFloat32

func (rdr *NpyReader) GetFloat32() ([]float32, error)

GetFloat32 returns the array data as a slice of float32 values.

func (*NpyReader) GetFloat64

func (rdr *NpyReader) GetFloat64() ([]float64, error)

GetFloat64 returns the array data as a slice of float64 values.

func (*NpyReader) GetInt16

func (rdr *NpyReader) GetInt16() ([]int16, error)

GetInt16 returns the array data as a slice of int16 values.

func (*NpyReader) GetInt32

func (rdr *NpyReader) GetInt32() ([]int32, error)

GetInt32 returns the array data as a slice of int32 values.

func (*NpyReader) GetInt64

func (rdr *NpyReader) GetInt64() ([]int64, error)

GetInt64 returns the array data as a slice of int64 values.

func (*NpyReader) GetInt8

func (rdr *NpyReader) GetInt8() ([]int8, error)

GetInt8 returns the array data as a slice of int8 values.

func (*NpyReader) GetUInt8

func (rdr *NpyReader) GetUInt8() ([]uint8, error)

type Synapse

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

func Engine

func Engine() *Synapse

func New

func New(config Config) *Synapse

func (*Synapse) Close

func (s *Synapse) Close()

func (*Synapse) InferByInfoHash

func (s *Synapse) InferByInfoHash(modelInfoHash, inputInfoHash string) (uint64, error)

func (*Synapse) InferByInputContent

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

func (*Synapse) RemoteInferByInfoHash

func (s *Synapse) RemoteInferByInfoHash(modelInfoHash, inputInfoHash, uri string) (uint64, error)

func (*Synapse) RemoteInferByInputContent

func (s *Synapse) RemoteInferByInputContent(modelInfoHash, uri string, addr string, slot string) (uint64, error)

func (*Synapse) VerifyInput

func (s *Synapse) VerifyInput(inputInfoHash string) error

func (*Synapse) VerifyModel

func (s *Synapse) VerifyModel(modelInfoHash string) error

Jump to

Keyboard shortcuts

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