If you would like to use a similar method, you could use the functional API.
Using this approach you can specify the weight with dimensions [in_channels, out_channels, kernel_w, kernel_h]:
import torch.nn.functional as F

weights = ...
F.conv_transpose2d(input, weight)

If you don’t need the functional API, you could use the Module which you’ve already mentioned.
kernel_size is just part of the arguments you have to specify, so it’s not a substitute for filter.
Have a look at the DCGAN example 188 to see how it’s used.