mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
* Conv2d, MaxPool2d, and AvgPool2d have one argument for each of ksize, stride, and pad. This argument can be either a single number or a tuple of (h, w)
7 lines
111 B
Python
7 lines
111 B
Python
import collections
|
|
|
|
def _pair(x):
|
|
if isinstance(x, collections.Iterable):
|
|
return x
|
|
return x, x
|