/
api_nocuda.go
32 lines (24 loc) · 961 Bytes
/
api_nocuda.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// +build !cuda
package nnops
import (
G "gorgonia.org/gorgonia"
"gorgonia.org/tensor"
)
func Conv2d(im, filter *G.Node, kernelShape tensor.Shape, pad, stride, dilation []int) (retVal *G.Node, err error) {
return G.Conv2d(im, filter, kernelShape, pad, stride, dilation)
}
func Conv1d(in, filter *G.Node, kernel, pad, stride, dilation int) (*G.Node, error) {
return Conv2d(in, filter, tensor.Shape{1, kernel}, []int{0, pad}, []int{1, stride}, []int{1, dilation})
}
func MaxPool2D(x *G.Node, kernel tensor.Shape, pad, stride []int) (*G.Node, error) {
return G.MaxPool2D(x, kernel, pad, stride)
}
func Dropout(x *G.Node, prob float64) (retVal *G.Node, err error) {
return G.Dropout(x, prob)
}
func Rectify(x *G.Node) (retVal *G.Node, err error) {
return G.Rectify(x)
}
func BatchNorm(x, scale, bias *G.Node, momentum, epsilon float64) (retVal, γ, β *G.Node, op *G.BatchNormOp, err error) {
return G.BatchNorm(x, scale, bias, momentum, epsilon)
}