Define input shape and units of conv2d layers

Hello all.

I’m trying to define units, input shape, activations and kernel_initializer for conv2d layers in pytorch, and I think this is something I got from tensorflow and might not work this way here (units as in filters and input shape e.g. [h, w, 2 + zdimension]).

Defining only these parameters torch.nn.Conv2d (*in_channels*, *out_channels*, *kernel_size*, *stride=1*, *padding=0*, *dilation=1*, *groups=1*, *bias=True*, *padding_mode='zeros'* ) doesn’t make much sense to me.

Sorry if this is a silly question, new to torch.

I’m not sure what’s currently not working. The posted code looks alright and should initialize an nn.Conv2d layer. Could you explain your issue a bit more, please?

1 Like

It was working, thank you for the help!