def three_layer_convnet(x, params):
“”"
Performs the forward pass of a three-layer convolutional network with the
architecture defined above.
Inputs:
- x: A PyTorch Tensor of shape (N, 3, H, W) giving a minibatch of images
- params: A list of PyTorch Tensors giving the weights and biases for the
  network; should contain the following:
  - conv_w1: PyTorch Tensor of shape (channel_1, 3, KH1, KW1) giving weights
    for the first convolutional layer
  - conv_b1: PyTorch Tensor of shape (channel_1,) giving biases for the first
    convolutional layer
  - conv_w2: PyTorch Tensor of shape (channel_2, channel_1, KH2, KW2) giving
    weights for the second convolutional layer
  - conv_b2: PyTorch Tensor of shape (channel_2,) giving biases for the second
    convolutional layer
  - fc_w: PyTorch Tensor giving weights for the fully-connected layer. Can you
    figure out what the shape should be?
  - fc_b: PyTorch Tensor giving biases for the fully-connected layer. Can you
    figure out what the shape should be?

Returns:
- scores: PyTorch Tensor of shape (N, C) giving classification scores for x
"""
conv_w1, conv_b1, conv_w2, conv_b2, fc_w, fc_b = params
scores = None
import torch.nn as nn
pad1 = 2
pad2 = 1
channel_input = x.shape[1]
channel_1 = conv_w1.shape[0]
channel_2 = conv_w2.shape[0]
KW1, KH1 = conv_w1.shape[2:]
KW2, KH2 = conv_w2.shape[2:]

conv1 = nn.Conv2d(channel_input,channel_1,(KW1,KH1),stride = 1,padding = pad1,padding_mode = 'zeros',bias=True)
conv1.weight = nn.Parameter(conv_w1)
conv1.bias = nn.Parameter(conv_b1)

relu = nn.ReLU()

conv2 = nn.Conv2d(channel_1,channel_2,(KW2,KH2),stride = 1,padding = pad2,padding_mode = 'zeros',bias=True)
conv2.weight = nn.Parameter(conv_w2)
conv2_bias = nn.Parameter(conv_b2)

################################################################################
# TODO: Implement the forward pass for the three-layer ConvNet.                #
################################################################################
# *****START OF YOUR CODE (DO NOT DELETE/MODIFY THIS LINE)*****

out = conv1(x)
out = relu(out)
out = conv2(out)
out = relu(out)
out = flatten(out)
scores = out.mm(fc_w)+fc_b

pass


return scores