I don't understand something that I encounter when I read the official documentation

When I read the official documentation of maxpool2d,it looked like this


I don’t understand the meaning of union and[T,] and tuple[T,]

you can either use this argument as a single variable of type T or as a tuple containing variables of type T.
for eg: you can use as kernel_size=2 or as kernel_size=(2,3)

2 Likes

Check python docs for more infomations.

1 Like

Thank you very much!