common

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "version"
)

Variables

This section is empty.

Functions

func InitOperator

func InitOperator(op Operator, graphDef []byte, options *tf.SessionOptions) error

InitOperator is initializes operator using graphDef passes as a byte buffer.

func InitUsingB64Graph

func InitUsingB64Graph(op Operator, b64SerializedGraph string, options *tf.SessionOptions) error

InitUsingB64Graph initializes an operator with a graph and a session.

func InitUsingGraphFile

func InitUsingGraphFile(op Operator, graphFile string, options *tf.SessionOptions) error

InitUsingGraphFile reads graph from a file and initializes the operator.

func InitUsingGraphReader

func InitUsingGraphReader(op Operator, graphReader io.Reader, options *tf.SessionOptions) error

InitUsingGraphReader reads graph using an io reader and initializes the operator.

Types

type Op

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

Op is the operator for TF interface.

func (*Op) Close

func (op *Op) Close() error

Close closes the tensorflow session.

func (*Op) GetGraph

func (op *Op) GetGraph() *tensorflow.Graph

func (*Op) GetSession

func (op *Op) GetSession() *tensorflow.Session

func (*Op) SetGraph

func (op *Op) SetGraph(graph *tensorflow.Graph)

func (*Op) SetSession

func (op *Op) SetSession(sess *tensorflow.Session)

func (*Op) Version

func (op *Op) Version() (string, error)

Version prints version info of the graph def and the tensorflow library being used.

type Operator

type Operator interface {
	// Version returns version info.
	Version() (string, error)
	// GetGraph retrieves graph.
	GetGraph() *tensorflow.Graph
	// SetGraph assigns graph to the operator.
	SetGraph(*tensorflow.Graph)
	// GetSession gets the session.
	GetSession() *tensorflow.Session
	// SetSession assigns session to the operator.
	SetSession(*tensorflow.Session)
}

Operator defines a generic operator to interface with TF.

Jump to

Keyboard shortcuts

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