How can I plot loss with epoch?

I have a model like this:

PCConvLstmNet(
  (conv): Sequential(
    (0): Conv1d(1, 4, kernel_size=(7,), stride=(3,))
    (1): BatchNorm1d(4, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (2): ReLU()
    (3): Conv1d(4, 8, kernel_size=(7,), stride=(3,))
    (4): BatchNorm1d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (5): ReLU()
    (6): Conv1d(8, 16, kernel_size=(7,), stride=(3,))
    (7): BatchNorm1d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (8): ReLU()
  )
  (lstm): GRU(16, 16, batch_first=True)
)

how can I plot loss with epoch? (I am new in pytorch)

You could take a look at this tutorial which shows how you can print the loss. Note that the current code snippet uses a condition using the steps in the DataLoader so you might want to move the print statement into the epoch loop.