Documentation ¶
Index ¶
- func BuildCompoundKernel(typeArgs []acc.TypeArg) (string, string)
- type ConvLayer
- type ConvLayerBase
- func (n *ConvLayerBase) BpropConv(i backends.Tensor, f backends.Tensor, o backends.Tensor, x backends.Tensor, ...)
- func (n *ConvLayerBase) C() int
- func (n *ConvLayerBase) CompoundOps(o backends.Tensor, x backends.Tensor, bias backends.Tensor, ...)
- func (n *ConvLayerBase) DHW() []int
- func (n *ConvLayerBase) DimF() []int
- func (n *ConvLayerBase) DimF2() []int
- func (n *ConvLayerBase) DimI() []int
- func (n *ConvLayerBase) DimI2() []int
- func (n *ConvLayerBase) DimO() []int
- func (n *ConvLayerBase) DimO2() []int
- func (n *ConvLayerBase) DimS() []int
- func (n *ConvLayerBase) FpropConv(i backends.Tensor, f backends.Tensor, o backends.Tensor, x backends.Tensor, ...)
- func (n *ConvLayerBase) Init(lib *CpuGenerator, dtype base.Dtype, params *ConvParams)
- func (n *ConvLayerBase) K() int
- func (n *ConvLayerBase) M() int
- func (n *ConvLayerBase) MPQ() []int
- func (n *ConvLayerBase) N() int
- func (n *ConvLayerBase) NCK() []int
- func (n *ConvLayerBase) NOut() int
- func (n *ConvLayerBase) P() int
- func (n *ConvLayerBase) Padding() []int
- func (n *ConvLayerBase) Q() int
- func (n *ConvLayerBase) SizeF() int
- func (n *ConvLayerBase) SizeI() int
- func (n *ConvLayerBase) SizeO() int
- func (n *ConvLayerBase) Strides() []int
- func (n *ConvLayerBase) TRS() []int
- func (n *ConvLayerBase) UpdateConv(i backends.Tensor, e backends.Tensor, u backends.Tensor, alpha float64, ...)
- type ConvParams
- type CpuDeviceAllocation
- type CpuGenerator
- func (b *CpuGenerator) Assign(out *acc.AccTensor, value backends.Value) backends.Value
- func (b *CpuGenerator) Binarize(ary backends.Tensor, out backends.Tensor, stochastic bool) backends.Tensor
- func (b *CpuGenerator) BpropConv(layer backends.ConvLayerBase, f backends.Tensor, e backends.Tensor, ...)
- func (b *CpuGenerator) BpropLrn(layer backends.LrnLayer, i backends.Tensor, o backends.Tensor, ...)
- func (b *CpuGenerator) BpropPool(layer backends.PoolLayer, i backends.Tensor, o backends.Tensor, ...)
- func (b *CpuGenerator) BpropRelu(layer backends.Layer, x backends.Tensor, errors backends.Tensor, ...) backends.Value
- func (b *CpuGenerator) BpropSkipNode(errors backends.Tensor, deltas backends.Tensor, alpha float64, beta float64)
- func (b *CpuGenerator) BpropTransform(nglayer backends.Layer, transform backends.Transform, outputs backends.Tensor, ...)
- func (b *CpuGenerator) BuildProlog()
- func (b *CpuGenerator) CompoundBpropBn(deltaOut backends.Tensor, gradGamma backends.Tensor, gradBeta backends.Tensor, ...)
- func (b *CpuGenerator) CompoundDot(x backends.Tensor, y backends.Tensor, z backends.Tensor, alpha float64, ...) backends.Tensor
- func (b *CpuGenerator) CompoundDotCpu(x *acc.AccTensor, y *acc.AccTensor, z *acc.AccTensor, alpha float64, ...) *acc.AccTensor
- func (b *CpuGenerator) CompoundFpropBn(x backends.Tensor, xsum backends.Tensor, xvar backends.Tensor, ...)
- func (b *CpuGenerator) CompoundKernel(args []backends.Value) backends.Value
- func (b *CpuGenerator) ConfigureCodeOutput(buildMainCpp bool, filePrefix string, hostNamespace string, ...)
- func (b *CpuGenerator) FormatBufferRef(tensor backends.Tensor, paren bool) string
- func (b *CpuGenerator) FpropConv(layer backends.ConvLayerBase, i backends.Tensor, f backends.Tensor, ...)
- func (b *CpuGenerator) FpropLrn(layer backends.LrnLayer, i backends.Tensor, o backends.Tensor, ...)
- func (b *CpuGenerator) FpropPool(layer backends.PoolLayer, i backends.Tensor, o backends.Tensor, ...)
- func (b *CpuGenerator) FpropRelu(layer backends.Layer, x backends.Tensor, slope float64) backends.Value
- func (b *CpuGenerator) FpropSkipNode(x backends.Tensor, y backends.Tensor, beta float64)
- func (b *CpuGenerator) FpropSoftmax(x backends.Value, axis int) backends.Value
- func (b *CpuGenerator) FpropTransform(nglayer backends.Layer, transform backends.Transform, inputs backends.Tensor, ...)
- func (b *CpuGenerator) GetData(dest string, start string, stop string, x backends.Tensor) string
- func (b *CpuGenerator) GetFloat(src acc.DeviceAllocation, size int) string
- func (b *CpuGenerator) GetInt(src acc.DeviceAllocation, size int) string
- func (b *CpuGenerator) GetMetricSum(x backends.Tensor, start string, stop string) string
- func (b *CpuGenerator) Init(self generators.Generator, rngSeed int, defaultDtype base.Dtype, ...)
- func (b *CpuGenerator) LookupKernel(key string) *Kernel
- func (b *CpuGenerator) MakeBinaryMask(out backends.Tensor, keepThresh float64)
- func (b *CpuGenerator) MemAlloc(nbytes int) acc.DeviceAllocation
- func (b *CpuGenerator) MemcpyDtodAsync(dest acc.DeviceAllocation, src acc.DeviceAllocation, size int)
- func (b *CpuGenerator) MemsetD16Async(dest acc.DeviceAllocation, data uint16, count int)
- func (b *CpuGenerator) MemsetD32Async(dest acc.DeviceAllocation, data uint32, count int)
- func (b *CpuGenerator) MemsetD8Async(dest acc.DeviceAllocation, data uint8, count int)
- func (b *CpuGenerator) NewBatchNormLayer(inShape []int) backends.BatchNormLayer
- func (b *CpuGenerator) NewConvLayer(dtype base.Dtype, params *backends.ConvParams) backends.ConvLayer
- func (b *CpuGenerator) NewDeconvLayer(dtype base.Dtype, params *backends.DeconvParams) backends.DeconvLayer
- func (b *CpuGenerator) NewLrnLayer(dtype base.Dtype, params *backends.LrnParams) backends.LrnLayer
- func (b *CpuGenerator) NewPoolLayer(dtype base.Dtype, params *backends.PoolParams) backends.PoolLayer
- func (b *CpuGenerator) NewReluLayer() backends.Layer
- func (b *CpuGenerator) OutputCode(outDir string) error
- func (b *CpuGenerator) RegisterKernel(key string, kernel *Kernel)
- func (b *CpuGenerator) RngNormal(out backends.Tensor, loc float64, scale float64, size []int)
- func (b *CpuGenerator) RngUniform(out backends.Tensor, low float64, high float64, size []int)
- func (b *CpuGenerator) ScratchBufferInit()
- func (b *CpuGenerator) ScratchBufferOffset(size int) acc.DeviceAllocation
- func (b *CpuGenerator) SetScratchSize(args ...int)
- func (b *CpuGenerator) UpdateConv(layer backends.ConvLayerBase, i backends.Tensor, e backends.Tensor, ...)
- type DeconvLayer
- type Kernel
- type LrnLayer
- func (n *LrnLayer) BpropLrn(i backends.Tensor, o backends.Tensor, e backends.Tensor, delta backends.Tensor, ...)
- func (n *LrnLayer) FpropLrn(i backends.Tensor, o backends.Tensor, denom backends.Tensor, ascale float64, ...)
- func (n *LrnLayer) Init(lib *CpuGenerator, dtype base.Dtype, params *backends.LrnParams)
- type PoolLayer
- func (n *PoolLayer) BpropPool(i backends.Tensor, o backends.Tensor, argmax backends.Tensor, alpha float64, ...)
- func (n *PoolLayer) C() int
- func (n *PoolLayer) DHW() []int
- func (n *PoolLayer) DimF2() []int
- func (n *PoolLayer) DimI() []int
- func (n *PoolLayer) DimI2() []int
- func (n *PoolLayer) DimO() []int
- func (n *PoolLayer) DimO2() []int
- func (n *PoolLayer) FpropPool(i backends.Tensor, o backends.Tensor, argmax backends.Tensor, beta float64)
- func (n *PoolLayer) Init(lib *CpuGenerator, dtype base.Dtype, params *backends.PoolParams)
- func (n *PoolLayer) JTRS() []int
- func (n *PoolLayer) K() int
- func (n *PoolLayer) M() int
- func (n *PoolLayer) MPQ() []int
- func (n *PoolLayer) N() int
- func (n *PoolLayer) NOut() int
- func (n *PoolLayer) Op() backends.PoolOp
- func (n *PoolLayer) P() int
- func (n *PoolLayer) Padding() []int
- func (n *PoolLayer) Q() int
- func (n *PoolLayer) SizeF() int
- func (n *PoolLayer) SizeI() int
- func (n *PoolLayer) SizeO() int
- func (n *PoolLayer) Strides() []int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConvLayer ¶
type ConvLayer struct {
ConvLayerBase
}
func NewConvLayer ¶
func NewConvLayer( lib *CpuGenerator, dtype base.Dtype, params *backends.ConvParams) *ConvLayer
func (*ConvLayer) Init ¶
func (n *ConvLayer) Init( lib *CpuGenerator, dtype base.Dtype, params *backends.ConvParams)
type ConvLayerBase ¶
type ConvLayerBase struct {
// contains filtered or unexported fields
}
func (*ConvLayerBase) C ¶
func (n *ConvLayerBase) C() int
func (*ConvLayerBase) CompoundOps ¶
func (*ConvLayerBase) DHW ¶
func (n *ConvLayerBase) DHW() []int
func (*ConvLayerBase) DimF ¶
func (n *ConvLayerBase) DimF() []int
func (*ConvLayerBase) DimF2 ¶
func (n *ConvLayerBase) DimF2() []int
func (*ConvLayerBase) DimI ¶
func (n *ConvLayerBase) DimI() []int
func (*ConvLayerBase) DimI2 ¶
func (n *ConvLayerBase) DimI2() []int
func (*ConvLayerBase) DimO ¶
func (n *ConvLayerBase) DimO() []int
func (*ConvLayerBase) DimO2 ¶
func (n *ConvLayerBase) DimO2() []int
func (*ConvLayerBase) DimS ¶
func (n *ConvLayerBase) DimS() []int
func (*ConvLayerBase) Init ¶
func (n *ConvLayerBase) Init(lib *CpuGenerator, dtype base.Dtype, params *ConvParams)
func (*ConvLayerBase) K ¶
func (n *ConvLayerBase) K() int
func (*ConvLayerBase) M ¶
func (n *ConvLayerBase) M() int
func (*ConvLayerBase) MPQ ¶
func (n *ConvLayerBase) MPQ() []int
func (*ConvLayerBase) N ¶
func (n *ConvLayerBase) N() int
func (*ConvLayerBase) NCK ¶
func (n *ConvLayerBase) NCK() []int
func (*ConvLayerBase) NOut ¶
func (n *ConvLayerBase) NOut() int
func (*ConvLayerBase) P ¶
func (n *ConvLayerBase) P() int
func (*ConvLayerBase) Padding ¶
func (n *ConvLayerBase) Padding() []int
func (*ConvLayerBase) Q ¶
func (n *ConvLayerBase) Q() int
func (*ConvLayerBase) SizeF ¶
func (n *ConvLayerBase) SizeF() int
func (*ConvLayerBase) SizeI ¶
func (n *ConvLayerBase) SizeI() int
func (*ConvLayerBase) SizeO ¶
func (n *ConvLayerBase) SizeO() int
func (*ConvLayerBase) Strides ¶
func (n *ConvLayerBase) Strides() []int
func (*ConvLayerBase) TRS ¶
func (n *ConvLayerBase) TRS() []int
type ConvParams ¶
type ConvParams struct { N int C int K int D int H int W int T int R int S int M int P int Q int PadD int PadH int PadW int StrD int StrH int StrW int DilD int DilH int DilW int }
func (*ConvParams) InitConv ¶
func (a *ConvParams) InitConv(params *backends.ConvParams)
func (*ConvParams) InitDeconv ¶
func (a *ConvParams) InitDeconv(params *backends.DeconvParams)
type CpuDeviceAllocation ¶
type CpuDeviceAllocation struct {
// contains filtered or unexported fields
}
func NewCpuDeviceAllocation ¶
func NewCpuDeviceAllocation(index int, nbytes int, offset int) *CpuDeviceAllocation
func (*CpuDeviceAllocation) Add ¶
func (a *CpuDeviceAllocation) Add(offset int) acc.DeviceAllocation
type CpuGenerator ¶
type CpuGenerator struct { acc.AccGeneratorBase // contains filtered or unexported fields }
func NewCpuGenerator ¶
func (*CpuGenerator) BpropSkipNode ¶
func (*CpuGenerator) BpropTransform ¶
func (*CpuGenerator) BuildProlog ¶
func (b *CpuGenerator) BuildProlog()
func (*CpuGenerator) CompoundBpropBn ¶
func (*CpuGenerator) CompoundDot ¶
func (*CpuGenerator) CompoundDotCpu ¶
func (*CpuGenerator) CompoundFpropBn ¶
func (b *CpuGenerator) CompoundFpropBn( x backends.Tensor, xsum backends.Tensor, xvar backends.Tensor, gmean backends.Tensor, gvar backends.Tensor, gamma backends.Tensor, beta backends.Tensor, y backends.Tensor, eps float64, rho float64, computeBatchSum bool, accumbeta float64, relu bool, binary bool, inference bool, outputs backends.Tensor, later backends.BatchNormLayer)
func (*CpuGenerator) CompoundKernel ¶
func (b *CpuGenerator) CompoundKernel(args []backends.Value) backends.Value
func (*CpuGenerator) ConfigureCodeOutput ¶
func (b *CpuGenerator) ConfigureCodeOutput( buildMainCpp bool, filePrefix string, hostNamespace string, kernelPrefix string)
func (*CpuGenerator) FormatBufferRef ¶
func (b *CpuGenerator) FormatBufferRef(tensor backends.Tensor, paren bool) string
func (*CpuGenerator) FpropSkipNode ¶
func (*CpuGenerator) FpropSoftmax ¶
func (*CpuGenerator) FpropTransform ¶
func (*CpuGenerator) GetFloat ¶
func (b *CpuGenerator) GetFloat(src acc.DeviceAllocation, size int) string
func (*CpuGenerator) GetInt ¶
func (b *CpuGenerator) GetInt(src acc.DeviceAllocation, size int) string
func (*CpuGenerator) GetMetricSum ¶
func (*CpuGenerator) Init ¶
func (b *CpuGenerator) Init( self generators.Generator, rngSeed int, defaultDtype base.Dtype, stochasticRound int, bench bool, scratchSize int, histBins int, histOffset int, compatMode backends.CompatMode)
func (*CpuGenerator) LookupKernel ¶
func (b *CpuGenerator) LookupKernel(key string) *Kernel
func (*CpuGenerator) MakeBinaryMask ¶
func (b *CpuGenerator) MakeBinaryMask(out backends.Tensor, keepThresh float64)
func (*CpuGenerator) MemAlloc ¶
func (b *CpuGenerator) MemAlloc(nbytes int) acc.DeviceAllocation
func (*CpuGenerator) MemcpyDtodAsync ¶
func (b *CpuGenerator) MemcpyDtodAsync( dest acc.DeviceAllocation, src acc.DeviceAllocation, size int)
func (*CpuGenerator) MemsetD16Async ¶
func (b *CpuGenerator) MemsetD16Async(dest acc.DeviceAllocation, data uint16, count int)
func (*CpuGenerator) MemsetD32Async ¶
func (b *CpuGenerator) MemsetD32Async(dest acc.DeviceAllocation, data uint32, count int)
func (*CpuGenerator) MemsetD8Async ¶
func (b *CpuGenerator) MemsetD8Async(dest acc.DeviceAllocation, data uint8, count int)
func (*CpuGenerator) NewBatchNormLayer ¶
func (b *CpuGenerator) NewBatchNormLayer(inShape []int) backends.BatchNormLayer
func (*CpuGenerator) NewConvLayer ¶
func (b *CpuGenerator) NewConvLayer( dtype base.Dtype, params *backends.ConvParams) backends.ConvLayer
func (*CpuGenerator) NewDeconvLayer ¶
func (b *CpuGenerator) NewDeconvLayer( dtype base.Dtype, params *backends.DeconvParams) backends.DeconvLayer
func (*CpuGenerator) NewLrnLayer ¶
func (*CpuGenerator) NewPoolLayer ¶
func (b *CpuGenerator) NewPoolLayer( dtype base.Dtype, params *backends.PoolParams) backends.PoolLayer
func (*CpuGenerator) NewReluLayer ¶
func (b *CpuGenerator) NewReluLayer() backends.Layer
func (*CpuGenerator) OutputCode ¶
func (b *CpuGenerator) OutputCode(outDir string) error
func (*CpuGenerator) RegisterKernel ¶
func (b *CpuGenerator) RegisterKernel(key string, kernel *Kernel)
func (*CpuGenerator) RngUniform ¶
func (*CpuGenerator) ScratchBufferInit ¶
func (b *CpuGenerator) ScratchBufferInit()
func (*CpuGenerator) ScratchBufferOffset ¶
func (b *CpuGenerator) ScratchBufferOffset(size int) acc.DeviceAllocation
func (*CpuGenerator) SetScratchSize ¶
func (b *CpuGenerator) SetScratchSize(args ...int)
func (*CpuGenerator) UpdateConv ¶
type DeconvLayer ¶
type DeconvLayer struct {
ConvLayerBase
}
func NewDeconvLayer ¶
func NewDeconvLayer( lib *CpuGenerator, dtype base.Dtype, params *backends.DeconvParams) *DeconvLayer
func (*DeconvLayer) Init ¶
func (n *DeconvLayer) Init( lib *CpuGenerator, dtype base.Dtype, params *backends.DeconvParams)
type LrnLayer ¶
type LrnLayer struct {
PoolLayer
}
func NewLrnLayer ¶
type PoolLayer ¶
type PoolLayer struct {
// contains filtered or unexported fields
}
func NewPoolLayer ¶
func NewPoolLayer(lib *CpuGenerator, dtype base.Dtype, params *backends.PoolParams) *PoolLayer
func (*PoolLayer) Init ¶
func (n *PoolLayer) Init(lib *CpuGenerator, dtype base.Dtype, params *backends.PoolParams)
Click to show internal directories.
Click to hide internal directories.