From the function of definition for nn.conv1d
torch.nn.Conv1d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros')

C_in = 1,
C_out = 1,
K  = 3
S = 1
P = 0
From the slide 63 of lecture 5, cs231n, the size of the L(A) : 1 X 5 X 1
So, the filter stops cross correlation at A[5] ie. 4 because of it goes out of bounds in the next stride.

image1666×808 229 KB