Thank so much Aman_Singh for leading as a newbie with pytorch . I changed my code to:
output = model(data)
output=output.detach().numpy()
print(output)
Y_pred.append(output)
print(Y_pred.shape)
And I am getting the values and printed the shape : (300, 1, 1) of my tensor.
Do I  have to reshape it in order plot it ?  my X_test is of shape (300,)
Cheers