Conv2d constructor
Conv2d(})
Implementation
Conv2d(
this.inChannels,
this.outChannels, {
int kernel = 3,
int? kernelH,
int? kernelW,
this.stride = 1,
this.padding = 0,
bool bias = true,
Device device = Device.CPU,
int seed = 0,
}) : kernelH = kernelH ?? kernel,
kernelW = kernelW ?? kernel,
weight = _initWeight(
outChannels,
inChannels,
kernelH ?? kernel,
kernelW ?? kernel,
device,
seed,
),
bias = bias
? Tensor.fill([outChannels], 0.0, requiresGrad: true, device: device)
: null;