mkl

package
v0.0.0-...-c5f678a Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mkl wraps wraps the Intel MKL DNN functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetError

func GetError(err Error) error

Convert MKL DNN error code to go error

Types

type Attr

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

func NewAttr

func NewAttr() *Attr

func (*Attr) Release

func (a *Attr) Release()

type Buffer

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

func NewBuffer

func NewBuffer(size int) Buffer

Allocate a block of memory of given no. of 32 bit words - align on 64 byte boundary

func (Buffer) Capacity

func (b Buffer) Capacity() int

func (Buffer) Data

func (b Buffer) Data() unsafe.Pointer

func (Buffer) Release

func (b Buffer) Release()

type Error

type Error C.dnnError_t

type Layer

type Layer struct {
	Resource
	Fwd, BData     *Primitive
	BFilter, BBias *Primitive
	// contains filtered or unexported fields
}

Layer structure represents a DNN layer definition and associated layouts and primitives

func BatchNorm

func BatchNorm(attr *Attr, n, c, h, w int, epsilon float64) *Layer

Setup new batch normalisation layer

func Convolution

func Convolution(attr *Attr, n, c, h, w, nFeats, filtSize, stride int, padding, noBias bool) *Layer

Setup new convolution layer

func NewLayer

func NewLayer(typ string, inShape, outShape []int) *Layer

func Pooling

func Pooling(attr *Attr, n, c, h, w, size, stride int, padding, average bool) *Layer

Setup new max pooling or average pooling layer

func (*Layer) Alloc

func (l *Layer) Alloc(typ C.dnnResourceType_t)

func (*Layer) BiasShape

func (l *Layer) BiasShape() []int

func (*Layer) FilterShape

func (l *Layer) FilterShape() []int

func (*Layer) InShape

func (l *Layer) InShape() []int

func (*Layer) OutShape

func (l *Layer) OutShape() []int

func (*Layer) Release

func (l *Layer) Release()

func (*Layer) String

func (l *Layer) String() string

func (*Layer) Type

func (l *Layer) Type() string

func (*Layer) Worksize

func (l *Layer) Worksize() int

type Layout

type Layout struct {
	Dims []int
	// contains filtered or unexported fields
}

DNN layout container reprents a n dimensional tensor

func NewLayout

func NewLayout(dims []int) *Layout

func (*Layout) Release

func (l *Layout) Release()

func (*Layout) Size

func (l *Layout) Size() int

Get size of layout in 32 bit words

type Primitive

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

DNN primitive type represents an operation such as a convolution or a conversion

func NewPrimitive

func NewPrimitive() *Primitive

func (*Primitive) Ptr

func (p *Primitive) Ptr() unsafe.Pointer

func (*Primitive) Release

func (p *Primitive) Release()

type Resource

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

Resources associated with layer

func (Resource) Dst

func (r Resource) Dst() Buffer

func (Resource) ResPtr

func (r Resource) ResPtr() unsafe.Pointer

func (Resource) SetDiffDst

func (r Resource) SetDiffDst(p unsafe.Pointer)

func (Resource) SetDiffSrc

func (r Resource) SetDiffSrc(p unsafe.Pointer)

func (Resource) SetParams

func (r Resource) SetParams(W, B, dW, dB unsafe.Pointer)

func (Resource) SetSrc

func (r Resource) SetSrc(p unsafe.Pointer)

func (Resource) SetStatsData

func (r Resource) SetStatsData(w, dw, runMean, runVar unsafe.Pointer)

func (Resource) String

func (r Resource) String() string

Jump to

Keyboard shortcuts

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