I am getting the following error while trying to use Conv2D  from  torch.nn:
AttributeError: module 'torch.nn' has no attribute 'Conv2D'
I am wondering why it is happening?
This is the code that I’m running.
model = pretrainedmodels.__dict__['squeezenet1_1'](num_classes=1000, pretrained='imagenet')
model.last_conv = nn.Conv2D(512, 3, 1, 1)

This is my environment information:
PyTorch version: 1.5.1
Is debug build: No
CUDA used to build PyTorch: 10.2
OS: Ubuntu 16.04.6 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
CMake version: version 3.5.1
Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.0.130
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
Versions of relevant libraries:
[pip3] numpy==1.19.0
[pip3] torch==1.5.1
[pip3] torchvision==0.6.1