caffe2

package module
v0.0.0-...-c380afe Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2018 License: MIT Imports: 6 Imported by: 0

README

go-caffe2 GoDoc

This provides caffe2 bindings for Go.

You need to install caffe2 to your system first.

$ go get -u github.com/d4l3k/go-caffe2

See TestNet for an example of creating a new net with blobs and running it: https://github.com/d4l3k/go-caffe2/blob/master/net_test.go

Development

Check the code out with submodules

$ git clone --recurse-submodules -j16 git@github.com:d4l3k/go-caffe2.git

Install go protoc: https://github.com/golang/protobuf#installation

Generate protobuf sources and test:

make

License

go-caffe2 is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

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

func (*Blob) Deserialize

func (b *Blob) Deserialize(content []byte)

func (*Blob) FromProto

func (b *Blob) FromProto(p *caffe2pb.BlobProto) error

func (*Blob) Proto

func (b *Blob) Proto() (*caffe2pb.BlobProto, error)

func (*Blob) Reset

func (b *Blob) Reset()

func (*Blob) Serialize

func (b *Blob) Serialize() []byte

TODO: make this not do 4 memory copies to get from C to Go

func (*Blob) TypeName

func (b *Blob) TypeName() string

type Net

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

type Workspace

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

func NewWorkspace

func NewWorkspace() *Workspace

NewWorkspace creates a new workspace. The underlying C++ workspace is freed via a finalizer and all child Blobs and Nets have a pointer to the workspace so there won't ever be any unsafe memory accesses.

func (*Workspace) CreateBlob

func (w *Workspace) CreateBlob(blob string) *Blob

func (*Workspace) CreateLocalBlob

func (w *Workspace) CreateLocalBlob(blob string) *Blob

func (*Workspace) CreateNet

func (w *Workspace) CreateNet(net *caffe2pb.NetDef) (*Net, error)

func (*Workspace) DeleteNet

func (w *Workspace) DeleteNet(name string)

func (*Workspace) GetBlob

func (w *Workspace) GetBlob(blob string) *Blob

func (*Workspace) GetNet

func (w *Workspace) GetNet(name string) *Net

func (*Workspace) HasBlob

func (w *Workspace) HasBlob(blob string) bool

func (*Workspace) NewChild

func (p *Workspace) NewChild() *Workspace

NewChild returns a new child workspace that inherits blobs from the parent workspace.

func (*Workspace) RemoveBlob

func (w *Workspace) RemoveBlob(blob string) error

func (*Workspace) RunNet

func (w *Workspace) RunNet(name string) error

func (*Workspace) RunPlan

func (w *Workspace) RunPlan(plan *caffe2pb.PlanDef) error

Directories

Path Synopsis
Package caffe2pb is a generated protocol buffer package.
Package caffe2pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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