# AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _align as align
from torch import device, empty_strided
from torch._inductor.async_compile import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels
from torch._inductor.codegen.multi_kernel import MultiKernelCall
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid, split_scan_grid, grid_combo_kernels, start_graph, end_graph
from torch._C import _cuda_getCurrentRawStream as get_raw_stream

aten = torch.ops.aten
inductor_ops = torch.ops.inductor
_quantized = torch.ops._quantized
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor
alloc_from_pool = torch.ops.inductor._alloc_from_pool
async_compile = AsyncCompile()


# kernel path: runs/run_shard_4/inductor_cache/xt/cxtkxbuil7mp4w2vi2sujbaxa6dkeig5rsoswqo7mepdr66ra5cf.py
# Topologically Sorted Source Nodes: [y], Original ATen: [aten.relu]
# Source node to ATen node mapping:
#   y => relu
# Graph fragment:
#   %relu : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%convolution,), kwargs = {})
triton_poi_fused_relu_0 = async_compile.triton('triton_poi_fused_relu_0', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[262144], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_relu_0', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_relu_0(in_out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 262144
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x0 = xindex
    tmp0 = tl.load(in_out_ptr0 + (x0), None)
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tl.store(in_out_ptr0 + (x0), tmp2, None)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, primals_11, primals_12, primals_13, primals_14, primals_15, primals_16, primals_17, primals_18, primals_19, primals_20, primals_21 = args
    args.clear()
    assert_size_stride(primals_1, (16, 1, 3, 3), (9, 9, 3, 1))
    assert_size_stride(primals_2, (4, 1, 64, 64), (4096, 4096, 64, 1))
    assert_size_stride(primals_3, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_4, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_5, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_6, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_7, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_8, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_9, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_10, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_11, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_12, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_13, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_14, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_15, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_16, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_17, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_18, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_19, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_20, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_21, (1, 16, 3, 3), (144, 9, 3, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        # Topologically Sorted Source Nodes: [conv2d], Original ATen: [aten.convolution]
        buf0 = extern_kernels.convolution(primals_2, primals_1, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf1 = buf0; del buf0  # reuse
        # Topologically Sorted Source Nodes: [y], Original ATen: [aten.relu]
        stream0 = get_raw_stream(0)
        triton_poi_fused_relu_0.run(buf1, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_1], Original ATen: [aten.convolution]
        buf2 = extern_kernels.convolution(buf1, primals_3, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf2, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf3 = buf2; del buf2  # reuse
        # Topologically Sorted Source Nodes: [y_1], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf3, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_2], Original ATen: [aten.convolution]
        buf4 = extern_kernels.convolution(buf3, primals_4, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf4, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf5 = buf4; del buf4  # reuse
        # Topologically Sorted Source Nodes: [y_2], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf5, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_3], Original ATen: [aten.convolution]
        buf6 = extern_kernels.convolution(buf5, primals_5, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf6, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf7 = buf6; del buf6  # reuse
        # Topologically Sorted Source Nodes: [y_3], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf7, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_4], Original ATen: [aten.convolution]
        buf8 = extern_kernels.convolution(buf7, primals_6, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf8, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf9 = buf8; del buf8  # reuse
        # Topologically Sorted Source Nodes: [y_4], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf9, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_5], Original ATen: [aten.convolution]
        buf10 = extern_kernels.convolution(buf9, primals_7, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf10, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf11 = buf10; del buf10  # reuse
        # Topologically Sorted Source Nodes: [y_5], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf11, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_6], Original ATen: [aten.convolution]
        buf12 = extern_kernels.convolution(buf11, primals_8, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf12, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf13 = buf12; del buf12  # reuse
        # Topologically Sorted Source Nodes: [y_6], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf13, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_7], Original ATen: [aten.convolution]
        buf14 = extern_kernels.convolution(buf13, primals_9, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf15 = buf14; del buf14  # reuse
        # Topologically Sorted Source Nodes: [y_7], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf15, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_8], Original ATen: [aten.convolution]
        buf16 = extern_kernels.convolution(buf15, primals_10, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf16, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf17 = buf16; del buf16  # reuse
        # Topologically Sorted Source Nodes: [y_8], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf17, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_9], Original ATen: [aten.convolution]
        buf18 = extern_kernels.convolution(buf17, primals_11, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf18, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf19 = buf18; del buf18  # reuse
        # Topologically Sorted Source Nodes: [y_9], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf19, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_10], Original ATen: [aten.convolution]
        buf20 = extern_kernels.convolution(buf19, primals_12, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf20, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf21 = buf20; del buf20  # reuse
        # Topologically Sorted Source Nodes: [y_10], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf21, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_11], Original ATen: [aten.convolution]
        buf22 = extern_kernels.convolution(buf21, primals_13, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf22, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf23 = buf22; del buf22  # reuse
        # Topologically Sorted Source Nodes: [y_11], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf23, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_12], Original ATen: [aten.convolution]
        buf24 = extern_kernels.convolution(buf23, primals_14, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf24, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf25 = buf24; del buf24  # reuse
        # Topologically Sorted Source Nodes: [y_12], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf25, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_13], Original ATen: [aten.convolution]
        buf26 = extern_kernels.convolution(buf25, primals_15, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf26, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf27 = buf26; del buf26  # reuse
        # Topologically Sorted Source Nodes: [y_13], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf27, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_14], Original ATen: [aten.convolution]
        buf28 = extern_kernels.convolution(buf27, primals_16, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf28, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf29 = buf28; del buf28  # reuse
        # Topologically Sorted Source Nodes: [y_14], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf29, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_15], Original ATen: [aten.convolution]
        buf30 = extern_kernels.convolution(buf29, primals_17, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf30, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf31 = buf30; del buf30  # reuse
        # Topologically Sorted Source Nodes: [y_15], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf31, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_16], Original ATen: [aten.convolution]
        buf32 = extern_kernels.convolution(buf31, primals_18, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf32, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf33 = buf32; del buf32  # reuse
        # Topologically Sorted Source Nodes: [y_16], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf33, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_17], Original ATen: [aten.convolution]
        buf34 = extern_kernels.convolution(buf33, primals_19, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf34, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf35 = buf34; del buf34  # reuse
        # Topologically Sorted Source Nodes: [y_17], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf35, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_18], Original ATen: [aten.convolution]
        buf36 = extern_kernels.convolution(buf35, primals_20, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf36, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf37 = buf36; del buf36  # reuse
        # Topologically Sorted Source Nodes: [y_18], Original ATen: [aten.relu]
        triton_poi_fused_relu_0.run(buf37, 262144, grid=grid(262144), stream=stream0)
        # Topologically Sorted Source Nodes: [y_19], Original ATen: [aten.convolution]
        buf38 = extern_kernels.convolution(buf37, primals_21, stride=(1, 1), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf38, (4, 1, 64, 64), (4096, 4096, 64, 1))
    return (buf38, primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, primals_11, primals_12, primals_13, primals_14, primals_15, primals_16, primals_17, primals_18, primals_19, primals_20, primals_21, buf1, buf3, buf5, buf7, buf9, buf11, buf13, buf15, buf17, buf19, buf21, buf23, buf25, buf27, buf29, buf31, buf33, buf35, buf37, )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((16, 1, 3, 3), (9, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((4, 1, 64, 64), (4096, 4096, 64, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_16 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_17 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_18 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_19 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_20 = rand_strided((16, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_21 = rand_strided((1, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, primals_11, primals_12, primals_13, primals_14, primals_15, primals_16, primals_17, primals_18, primals_19, primals_20, primals_21])
    return print_performance(fn, times=times, repeat=repeat)


if __name__ == "__main__":
    from torch._inductor.wrapper_benchmark import compiled_module_main
    compiled_module_main('None', benchmark_compiled_module)

import torch
import torch.nn as nn


def load_param(model1_path, model2):
    dict_param1 = torch.load(model1_path)
    dict_param2 = dict(model2.named_parameters())
    for name2 in dict_param2:
        if name2 in dict_param1:
            dict_param2[name2].data.copy_(dict_param1[name2].data)
    model2.load_state_dict(dict_param2)
    return model2


class SmallVDSR_16x(nn.Module):

    def __init__(self, model=False, fixed=False):
        super(SmallVDSR_16x, self).__init__()
        self.fixed = fixed
        self.conv1 = nn.Conv2d(1, 16, 3, 1, 1, bias=False)
        self.conv2 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv3 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv4 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv5 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv6 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv7 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv8 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv9 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv10 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv11 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv12 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv13 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv14 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv15 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv16 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv17 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv18 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv19 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv20 = nn.Conv2d(16, 1, 3, 1, 1, bias=False)
        self.relu = nn.ReLU()
        if model:
            load_param(model, self)
        if fixed:
            for param in self.parameters():
                param.requires_grad = False

    def forward_stem(self, y):
        y = self.relu(self.conv1(y))
        out1 = y
        y = self.relu(self.conv2(y))
        out2 = y
        y = self.relu(self.conv3(y))
        out3 = y
        y = self.relu(self.conv4(y))
        out4 = y
        y = self.relu(self.conv5(y))
        out5 = y
        y = self.relu(self.conv6(y))
        out6 = y
        y = self.relu(self.conv7(y))
        out7 = y
        y = self.relu(self.conv8(y))
        out8 = y
        y = self.relu(self.conv9(y))
        out9 = y
        y = self.relu(self.conv10(y))
        out10 = y
        y = self.relu(self.conv11(y))
        out11 = y
        y = self.relu(self.conv12(y))
        out12 = y
        y = self.relu(self.conv13(y))
        out13 = y
        y = self.relu(self.conv14(y))
        out14 = y
        y = self.relu(self.conv15(y))
        out15 = y
        y = self.relu(self.conv16(y))
        out16 = y
        y = self.relu(self.conv17(y))
        out17 = y
        y = self.relu(self.conv18(y))
        out18 = y
        y = self.relu(self.conv19(y))
        out19 = y
        y = self.conv20(y)
        return (out1, out2, out3, out4, out5, out6, out7, out8, out9, out10,
            out11, out12, out13, out14, out15, out16, out17, out18, out19, y)

    def forward_dense(self, y):
        y = self.relu(self.conv1(y))
        out1 = y
        y = self.relu(self.conv2(y))
        out2 = y
        y = self.relu(self.conv3(y))
        out3 = y
        y = self.relu(self.conv4(y))
        out4 = y
        y = self.relu(self.conv5(y))
        out5 = y
        y = self.relu(self.conv6(y))
        out6 = y
        y = self.relu(self.conv7(y))
        out7 = y
        y = self.relu(self.conv8(y))
        out8 = y
        y = self.relu(self.conv9(y))
        out9 = y
        y = self.relu(self.conv10(y))
        out10 = y
        y = self.relu(self.conv11(y))
        out11 = y
        y = self.relu(self.conv12(y))
        out12 = y
        y = self.relu(self.conv13(y))
        out13 = y
        y = self.relu(self.conv14(y))
        out14 = y
        y = self.relu(self.conv15(y))
        out15 = y
        y = self.relu(self.conv16(y))
        out16 = y
        y = self.relu(self.conv17(y))
        out17 = y
        y = self.relu(self.conv18(y))
        out18 = y
        y = self.relu(self.conv19(y))
        out19 = y
        y = self.conv20(y)
        out20 = y
        return (out1, out2, out3, out4, out5, out6, out7, out8, out9, out10,
            out11, out12, out13, out14, out15, out16, out17, out18, out19,
            out20)

    def forward(self, y):
        y = self.relu(self.conv1(y))
        y = self.relu(self.conv2(y))
        y = self.relu(self.conv3(y))
        y = self.relu(self.conv4(y))
        y = self.relu(self.conv5(y))
        y = self.relu(self.conv6(y))
        y = self.relu(self.conv7(y))
        y = self.relu(self.conv8(y))
        y = self.relu(self.conv9(y))
        y = self.relu(self.conv10(y))
        y = self.relu(self.conv11(y))
        y = self.relu(self.conv12(y))
        y = self.relu(self.conv13(y))
        y = self.relu(self.conv14(y))
        y = self.relu(self.conv15(y))
        y = self.relu(self.conv16(y))
        y = self.relu(self.conv17(y))
        y = self.relu(self.conv18(y))
        y = self.relu(self.conv19(y))
        y = self.conv20(y)
        return y


def get_inputs():
    return [torch.rand([4, 1, 64, 64])]


def get_init_inputs():
    return [[], {}]

import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride


@triton.jit
def triton_poi_fused_relu_0(in_out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex
    tmp0 = tl.load(in_out_ptr0 + x0, None)
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tl.store(in_out_ptr0 + x0, tmp2, None)


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15, primals_16, primals_17,
        primals_18, primals_19, primals_20, primals_21) = args
    args.clear()
    assert_size_stride(primals_1, (16, 1, 3, 3), (9, 9, 3, 1))
    assert_size_stride(primals_2, (4, 1, 64, 64), (4096, 4096, 64, 1))
    assert_size_stride(primals_3, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_4, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_5, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_6, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_7, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_8, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_9, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_10, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_11, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_12, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_13, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_14, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_15, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_16, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_17, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_18, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_19, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_20, (16, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_21, (1, 16, 3, 3), (144, 9, 3, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_2, primals_1, stride=(1, 
            1), padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf1 = buf0
        del buf0
        get_raw_stream(0)
        triton_poi_fused_relu_0[grid(262144)](buf1, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf2 = extern_kernels.convolution(buf1, primals_3, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf2, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf3 = buf2
        del buf2
        triton_poi_fused_relu_0[grid(262144)](buf3, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf4 = extern_kernels.convolution(buf3, primals_4, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf4, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf5 = buf4
        del buf4
        triton_poi_fused_relu_0[grid(262144)](buf5, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf6 = extern_kernels.convolution(buf5, primals_5, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf6, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf7 = buf6
        del buf6
        triton_poi_fused_relu_0[grid(262144)](buf7, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf8 = extern_kernels.convolution(buf7, primals_6, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf8, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf9 = buf8
        del buf8
        triton_poi_fused_relu_0[grid(262144)](buf9, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf10 = extern_kernels.convolution(buf9, primals_7, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf10, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf11 = buf10
        del buf10
        triton_poi_fused_relu_0[grid(262144)](buf11, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf12 = extern_kernels.convolution(buf11, primals_8, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf12, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf13 = buf12
        del buf12
        triton_poi_fused_relu_0[grid(262144)](buf13, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf14 = extern_kernels.convolution(buf13, primals_9, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf15 = buf14
        del buf14
        triton_poi_fused_relu_0[grid(262144)](buf15, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf16 = extern_kernels.convolution(buf15, primals_10, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf16, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf17 = buf16
        del buf16
        triton_poi_fused_relu_0[grid(262144)](buf17, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf18 = extern_kernels.convolution(buf17, primals_11, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf18, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf19 = buf18
        del buf18
        triton_poi_fused_relu_0[grid(262144)](buf19, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf20 = extern_kernels.convolution(buf19, primals_12, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf20, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf21 = buf20
        del buf20
        triton_poi_fused_relu_0[grid(262144)](buf21, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf22 = extern_kernels.convolution(buf21, primals_13, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf22, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf23 = buf22
        del buf22
        triton_poi_fused_relu_0[grid(262144)](buf23, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf24 = extern_kernels.convolution(buf23, primals_14, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf24, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf25 = buf24
        del buf24
        triton_poi_fused_relu_0[grid(262144)](buf25, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf26 = extern_kernels.convolution(buf25, primals_15, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf26, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf27 = buf26
        del buf26
        triton_poi_fused_relu_0[grid(262144)](buf27, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf28 = extern_kernels.convolution(buf27, primals_16, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf28, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf29 = buf28
        del buf28
        triton_poi_fused_relu_0[grid(262144)](buf29, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf30 = extern_kernels.convolution(buf29, primals_17, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf30, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf31 = buf30
        del buf30
        triton_poi_fused_relu_0[grid(262144)](buf31, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf32 = extern_kernels.convolution(buf31, primals_18, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf32, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf33 = buf32
        del buf32
        triton_poi_fused_relu_0[grid(262144)](buf33, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf34 = extern_kernels.convolution(buf33, primals_19, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf34, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf35 = buf34
        del buf34
        triton_poi_fused_relu_0[grid(262144)](buf35, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf36 = extern_kernels.convolution(buf35, primals_20, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf36, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf37 = buf36
        del buf36
        triton_poi_fused_relu_0[grid(262144)](buf37, 262144, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf38 = extern_kernels.convolution(buf37, primals_21, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf38, (4, 1, 64, 64), (4096, 4096, 64, 1))
    return (buf38, primals_1, primals_2, primals_3, primals_4, primals_5,
        primals_6, primals_7, primals_8, primals_9, primals_10, primals_11,
        primals_12, primals_13, primals_14, primals_15, primals_16,
        primals_17, primals_18, primals_19, primals_20, primals_21, buf1,
        buf3, buf5, buf7, buf9, buf11, buf13, buf15, buf17, buf19, buf21,
        buf23, buf25, buf27, buf29, buf31, buf33, buf35, buf37)


def load_param(model1_path, model2):
    dict_param1 = torch.load(model1_path)
    dict_param2 = dict(model2.named_parameters())
    for name2 in dict_param2:
        if name2 in dict_param1:
            dict_param2[name2].data.copy_(dict_param1[name2].data)
    model2.load_state_dict(dict_param2)
    return model2


class SmallVDSR_16xNew(nn.Module):

    def __init__(self, model=False, fixed=False):
        super(SmallVDSR_16xNew, self).__init__()
        self.fixed = fixed
        self.conv1 = nn.Conv2d(1, 16, 3, 1, 1, bias=False)
        self.conv2 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv3 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv4 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv5 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv6 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv7 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv8 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv9 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv10 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv11 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv12 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv13 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv14 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv15 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv16 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv17 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv18 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv19 = nn.Conv2d(16, 16, 3, 1, 1, bias=False)
        self.conv20 = nn.Conv2d(16, 1, 3, 1, 1, bias=False)
        self.relu = nn.ReLU()
        if model:
            load_param(model, self)
        if fixed:
            for param in self.parameters():
                param.requires_grad = False

    def forward_stem(self, y):
        y = self.relu(self.conv1(y))
        out1 = y
        y = self.relu(self.conv2(y))
        out2 = y
        y = self.relu(self.conv3(y))
        out3 = y
        y = self.relu(self.conv4(y))
        out4 = y
        y = self.relu(self.conv5(y))
        out5 = y
        y = self.relu(self.conv6(y))
        out6 = y
        y = self.relu(self.conv7(y))
        out7 = y
        y = self.relu(self.conv8(y))
        out8 = y
        y = self.relu(self.conv9(y))
        out9 = y
        y = self.relu(self.conv10(y))
        out10 = y
        y = self.relu(self.conv11(y))
        out11 = y
        y = self.relu(self.conv12(y))
        out12 = y
        y = self.relu(self.conv13(y))
        out13 = y
        y = self.relu(self.conv14(y))
        out14 = y
        y = self.relu(self.conv15(y))
        out15 = y
        y = self.relu(self.conv16(y))
        out16 = y
        y = self.relu(self.conv17(y))
        out17 = y
        y = self.relu(self.conv18(y))
        out18 = y
        y = self.relu(self.conv19(y))
        out19 = y
        y = self.conv20(y)
        return (out1, out2, out3, out4, out5, out6, out7, out8, out9, out10,
            out11, out12, out13, out14, out15, out16, out17, out18, out19, y)

    def forward_dense(self, y):
        y = self.relu(self.conv1(y))
        out1 = y
        y = self.relu(self.conv2(y))
        out2 = y
        y = self.relu(self.conv3(y))
        out3 = y
        y = self.relu(self.conv4(y))
        out4 = y
        y = self.relu(self.conv5(y))
        out5 = y
        y = self.relu(self.conv6(y))
        out6 = y
        y = self.relu(self.conv7(y))
        out7 = y
        y = self.relu(self.conv8(y))
        out8 = y
        y = self.relu(self.conv9(y))
        out9 = y
        y = self.relu(self.conv10(y))
        out10 = y
        y = self.relu(self.conv11(y))
        out11 = y
        y = self.relu(self.conv12(y))
        out12 = y
        y = self.relu(self.conv13(y))
        out13 = y
        y = self.relu(self.conv14(y))
        out14 = y
        y = self.relu(self.conv15(y))
        out15 = y
        y = self.relu(self.conv16(y))
        out16 = y
        y = self.relu(self.conv17(y))
        out17 = y
        y = self.relu(self.conv18(y))
        out18 = y
        y = self.relu(self.conv19(y))
        out19 = y
        y = self.conv20(y)
        out20 = y
        return (out1, out2, out3, out4, out5, out6, out7, out8, out9, out10,
            out11, out12, out13, out14, out15, out16, out17, out18, out19,
            out20)

    def forward(self, input_0):
        primals_1 = self.conv1.weight
        primals_3 = self.conv2.weight
        primals_4 = self.conv3.weight
        primals_5 = self.conv4.weight
        primals_6 = self.conv5.weight
        primals_7 = self.conv6.weight
        primals_8 = self.conv7.weight
        primals_9 = self.conv8.weight
        primals_10 = self.conv9.weight
        primals_11 = self.conv10.weight
        primals_12 = self.conv11.weight
        primals_13 = self.conv12.weight
        primals_14 = self.conv13.weight
        primals_15 = self.conv14.weight
        primals_16 = self.conv15.weight
        primals_17 = self.conv16.weight
        primals_18 = self.conv17.weight
        primals_19 = self.conv18.weight
        primals_20 = self.conv19.weight
        primals_21 = self.conv20.weight
        primals_2 = input_0
        output = call([primals_1, primals_2, primals_3, primals_4,
            primals_5, primals_6, primals_7, primals_8, primals_9,
            primals_10, primals_11, primals_12, primals_13, primals_14,
            primals_15, primals_16, primals_17, primals_18, primals_19,
            primals_20, primals_21])
        return output[0]
