Dewei_Hu:

What I want is, all the filters should be initialized with the same weight (share the weights)


You could certainly initialize all 8 filters to the same value either by directly set the values:
T, D, filter_maps = 2, 3, 4
kernel_size=5
layer = nn.Conv1d(T*D,filter_maps*T,kernel_size,groups=T)

with torch.no_grad():
    ref = layer.weight[0:1]
    layer.weight.copy_(ref.repeat(8, 1, 1))

print(layer.weight)

or by using the functional API and stacking the filters.



 Dewei_Hu:

and in gradient descent, they could be updated to the same value.


Unfortunately that won’t work directly, since you are using 2 groups. Even though all filters are equal, they would use different input channels and would thus also create different outputs and gradients:
x = torch.randn(2, 6, 24)
out = layer(x)
out.mean().backward()
print(layer.weight.grad)