Problem about nn.Conv2D

recently I find a definition of network that confused me:
def net():
layers = []
layers += [nn.Conv2d(3, 128, kernel_size=(1, 3)[True])]

return layers

what dose it means of [True] after kernel_size=(1, 3), I have not seen this before

>> (1,3)[True]

(1,3) is a tuple and we’re indexing into it with True, which becomes 1. so it’s equivalent to

(1, 3)[1]
1 Like