Inconsistent tensor size, expected tensor [8] and src [1] to have the same number of elements, but got 8 and 1 elements respectively while running model

I am trying to run an evolutionary model for lunar lander but i get this error when running the model
it takes observation space of 8 and action space of 4
HERE IS THE ERROR`Input In [7], in test_model(agent)
10 while not done:
11 params = unpack(agent[‘params’])
—> 12 probs = model(state,params)
13 action = torch.distributions.Categorical(probs=probs).sample()
14 state_,reward,done,info = env.step(action.item())

Input In [1], in model(x, params)
3 def model(x,params):
4 l1,b1,l2,b2,l3,b3 = params
----> 5 y = torch.nn.functional.linear(x,l1,b1)
6 y=torch.relu(y)
7 y = torch.nn.functional.linear(y,l2,b2)

RuntimeError: inconsistent tensor size, expected tensor [8] and src [1] to have the same number of elements, but got 8 and 1 elements respectively`

here is code generating the error
`
def model(x,params):
l1,b1,l2,b2,l3,b3 = params
y = torch.nn.functional.linear(x,l1,b1)
y=torch.relu(y)
y = torch.nn.functional.linear(y,l2,b2)
y=torch.relu(y)
y = torch.nn.functional.linear(y,l2,b3)
y=torch.log_softmax(y,dim=0)
return y

def unpack(params,layers=[(25,8),(10,25),(4,10)]):
`

Check the sahpes of x, l1, and b1 and make sure they are compatible with the linear layer as the shape mismatch is raised in: y = torch.nn.functional.linear(x,l1,b1).