capi

package
v0.0.0-...-814de94 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ArgumentsNames = 0
View Source
const AuxNames = 2
View Source
const MaxArgsCount = 16
View Source
const MaxCacheArgsCount = 16 * 2
View Source
const OutoutNames = 1
View Source
const WithArguments = 1
View Source
const WithAuxStates = 4
View Source
const WithOutputs = 2
View Source
const WithoutOutput = 8

Variables

View Source
var GpuCount int = 0
View Source
var LibVersion = 0

Functions

func Backward

func Backward(exec ExecutorHandle) error

func Cache

func Cache(a interface{}) *C.char

func ComposeSymbol

func ComposeSymbol(handle SymbolHandle, name string, a ...SymbolHandle) error

func ContextRandomSeed

func ContextRandomSeed(seed, devType, devNo int) error

func FillInfo

func FillInfo(nfo *NDArrayInfo) error

func Fillargs

func Fillargs(keys []*C.char, vals []*C.char, ap []interface{}) int

func Forward

func Forward(exec ExecutorHandle, train bool) error

func GetNDArrayRawData

func GetNDArrayRawData(handle NDArrayHandle, p unsafe.Pointer, len int) error

func ImperativeInvokeInOut1

func ImperativeInvokeInOut1(op MxnetOp, h NDArrayHandle, o NDArrayHandle, a ...interface{}) error

func ImperativeInvokeInplace1

func ImperativeInvokeInplace1(op MxnetOp, h NDArrayHandle, a ...interface{}) error

func InferShapes

func InferShapes(handle SymbolHandle, with map[string][]int, selector int) (map[string][]int, error)

func ListNames

func ListNames(handle SymbolHandle, kind int) ([]string, error)

func OptimizerUpdate

func OptimizerUpdate(op MxnetOp, params, grads, state1 NDArrayHandle, state2 NDArrayHandle, a ...interface{}) error

func RandomSeed

func RandomSeed(seed int) error

func ReleaseExecutor

func ReleaseExecutor(handle ExecutorHandle)

func ReleaseNDArry

func ReleaseNDArry(handle NDArrayHandle)

func ReleaseSymbol

func ReleaseSymbol(handle SymbolHandle)

func SetNDArrayRawData

func SetNDArrayRawData(handle NDArrayHandle, p unsafe.Pointer, len int) int

func ToJson

func ToJson(sym SymbolHandle) ([]byte, error)

Types

type ExecutorHandle

type ExecutorHandle = C.ExecutorHandle

func Bind

func Bind(symbol SymbolHandle, devType, devNo int, args []NDArrayHandle, grads []NDArrayHandle, aux []NDArrayHandle) (ExecutorHandle, error)

type MxnetKey

type MxnetKey int
const (
	KeyEmpty MxnetKey = iota
	KeyLow
	KeyHigh
	KeyScalar
	KeyLhs
	KeyRhs
	KeyData
	KeyExclude
	KeyAxis
	KeyMode
	KeyNormalization
	KeyLr
	KeyMomentum
	KeyWd
	KeyBeta1
	KeyBeta2
	KeyEpsilon
	KeyEps
	KeyLoc
	KeyScale
	KeyKeepdims
	KeyNoBias
	KeyNumGroup
	KeyNumFilter
	KeyKernel
	KeyStride
	KeyPad
	KeyActType
	KeyPoolType
	KeyPoolConv
	KeyFlatten
	KeyNumHidden
	KeyMultiOutput
	KeyNumArgs
	KeyNoKey
)

func (MxnetKey) Value

func (k MxnetKey) Value() string

type MxnetOp

type MxnetOp int
const (
	OpEmpty MxnetOp = iota
	OpRandomUniform
	OpRandomNormal
	OpCopyTo
	OpAdd
	OpAddScalar
	OpSub
	OpSubScalar
	OpSubScalarR
	OpMul
	OpMulScalar
	OpDiv
	OpDivScalar
	OpDivScalarR
	OpMean
	OpStack
	OpAbs
	OpBlockGrad
	OpMakeLoss
	OpZeros
	OpPowerScalar
	OpPowerScalarR
	OpSgdUpdate
	OpSgdMomUpdate
	OpAdamUpdate
	OpLogSoftmax
	OpSoftmax
	OpSoftmaxOutput
	OpSoftmaxCE
	OpSoftmaxAC
	OpSum
	OpDot
	OpPick
	OpSquare
	OpConcat
	OpConvolution
	OpActivation
	OpPooling
	OpFullyConnected
	OpFlatten
	OpLog
	OpCosh
	OpNot
	OpSigmoid
	OpTanh
	OpSin
	OpBatchNorm
	OpNoOp
)

func (MxnetOp) Value

func (o MxnetOp) Value() string

type NDArrayHandle

type NDArrayHandle = C.NDArrayHandle

func NewNDArrayHandle

func NewNDArrayHandle(devType int, devNo int, dtype int, shape [4]int, slen int) (NDArrayHandle, error)

type NDArrayInfo

type NDArrayInfo struct {
	Handle NDArrayHandle
	Dim    []int
	Type   int
}

func GetOutputs

func GetOutputs(exec ExecutorHandle) ([]NDArrayInfo, error)

type SymbolHandle

type SymbolHandle = C.SymbolHandle

func CreateVariable

func CreateVariable(name string) (SymbolHandle, int)

func GetInternals

func GetInternals(s SymbolHandle) (SymbolHandle, error)

func GroupSymbols

func GroupSymbols(s []SymbolHandle) (SymbolHandle, error)

func NewSymbol

func NewSymbol(op MxnetOp, attr map[MxnetKey]string, a ...interface{}) (SymbolHandle, error)

Jump to

Keyboard shortcuts

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