Conv2d constructor

Conv2d(
  1. int inChannels,
  2. int outChannels, {
  3. int kernel = 3,
  4. int? kernelH,
  5. int? kernelW,
  6. int stride = 1,
  7. int padding = 0,
  8. bool bias = true,
  9. Device device = Device.CPU,
  10. int seed = 0,
})

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;