I am not sure since I have done it long ago, but I think I have done something like:
model = torchvision.models.resnet18()
model.conv1 = nn.Conv2d(num_input_channel, 64, kernel_size=7, stride=2, padding=3,bias=False)

I hope it can help.