def test_conv2d_param_sweep():
    hwOpts = [3, 4]
    padOpts = [0, 1]
    groupsOpts = [1, 2]
    dilationOpts = [1, 2]
    strideOpts = [1, 2]
    Setting = namedtuple('Setting', ['h', 'w', 'p', 'g', 'd', 's'])
    settings = [Setting(h=h, w=w, p=p, g=g, d=d, s=s) for h in hwOpts for w in hwOpts for p in padOpts for g in groupsOpts for d in dilationOpts for s in strideOpts]
    for setting in settings:

        def conv2d_param_sweep(inputs, filters):
            conv = F.conv2d(inputs, filters, padding=setting.p, groups=setting.g)
            return F.relu(conv)
        inputs = torch.randn(2, 4, setting.h, setting.w)
        filters = torch.randn(8, (4 / setting.g), 3, 3)
        jitVsGlow(conv2d_param_sweep, inputs, filters)
def test_conv2d_param_sweep():
    hwOpts = [3, 4]
    padOpts = [0, 1]
    groupsOpts = [1, 2]
    dilationOpts = [1, 2]
    strideOpts = [1, 2]
    Setting = namedtuple('Setting', ['h', 'w', 'p', 'g', 'd', 's'])
    settings = [Setting(h=h, w=w, p=p, g=g, d=d, s=s) for h in hwOpts for w in hwOpts for p in padOpts for g in groupsOpts for d in dilationOpts for s in strideOpts]
    for setting in settings:

        def conv2d_param_sweep(inputs, filters):
            conv = F.conv2d(inputs, filters, padding=setting.p, groups=setting.g)
            return F.relu(conv)
        inputs = torch.randn(2, 4, setting.h, setting.w)
        filters = torch.randn(8, (4 / setting.g), 3, 3)
        jitVsGlow(conv2d_param_sweep, inputs, filters)