def shape2d(a):
    if type(a) == int:
        return [a, a]
    if isinstance(a, (list, tuple)):
        assert len(a) == 2
        return list(a)
    raise RuntimeError("Illegal shape: {}".format(a))
a: a int or tuple/list of length 2
dataset/ETHPy150Open ppwwyyxx/tensorpack/tensorpack/models/_common.py/shape2d