std :: ml::gpu_cudnn
Struct std::CudaConv2D
struct CudaConv2D {
struct CudaBuf weight;
struct CudaBuf bias;
unsigned long inChannels;
unsigned long outChannels;
unsigned long kH;
unsigned long kW;
unsigned long stride;
unsigned long padding;
}A Conv2D (cnn.h) whose weight [outC, inC, kH, kW] and bias [outC] live on the GPU. weight.dev == 0 if the upload failed.
Fields
Methods
§
int forward(
struct CudaBuf x,
struct CudaBuf y,
unsigned long batch,
unsigned long height,
unsigned long width,
) constsource · definition§
int forward_relu(
struct CudaBuf x,
struct CudaBuf y,
unsigned long batch,
unsigned long height,
unsigned long width,
) constsource · definitiony = relu(conv(x) + bias), fused.