Conv2d constructor

Conv2d(
  1. int inChannels,
  2. int outChannels,
  3. int kernelSize, {
  4. int stride = 1,
  5. int padding = 0,
  6. bool useBias = true,
})

Implementation

Conv2d(
  this.inChannels,
  this.outChannels,
  this.kernelSize, {
  this.stride = 1,
  this.padding = 0,
  bool useBias = true,
}) {
  weight = Tensor.zeros([outChannels, inChannels, kernelSize, kernelSize]);
  if (useBias) {
    bias = Tensor.zeros([outChannels]);
  }
}