# 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_1/inductor_cache/4m/c4mcarghhikyuoixort2auhhvktolbfre37asm6l7rnaltlf2s4u.py
# Unsorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
triton_poi_fused_0 = async_compile.triton('triton_poi_fused_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=[64, 16], tile_hint=TileHint.SQUARE,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_0(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 64
    xnumel = 16
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 8
    y1 = (yindex // 8)
    tmp0 = tl.load(in_ptr0 + (x2 + (16*y3)), xmask & ymask, eviction_policy='evict_last')
    tl.store(out_ptr0 + (y0 + (8*x2) + (128*y1)), tmp0, xmask & ymask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/wl/cwlspyajtbqyjxcwpv7patze6a5tqyfbiwclnjg2ydxgnpjgcomw.py
# Unsorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
triton_poi_fused_1 = async_compile.triton('triton_poi_fused_1', '''
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=[32, 4096], tile_hint=TileHint.SQUARE,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_1(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 32
    xnumel = 4096
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, YBLOCK], True, tl.int1)
    x2 = xindex
    y3 = yindex
    y0 = yindex % 8
    y1 = (yindex // 8)
    tmp0 = tl.load(in_ptr0 + (x2 + (4096*y3)), ymask, eviction_policy='evict_last')
    tl.store(out_ptr0 + (y0 + (8*x2) + (32768*y1)), tmp0, ymask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/ch/cchvtnveahpbef57eyebh5xsfar4eodpscnqbem76zlls7g4dtbt.py
# Unsorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
triton_poi_fused_2 = async_compile.triton('triton_poi_fused_2', '''
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=[16384, 16], tile_hint=TileHint.SQUARE,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_2(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 10240
    xnumel = 16
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 40
    y1 = (yindex // 40)
    tmp0 = tl.load(in_ptr0 + (x2 + (16*y3)), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + (y0 + (40*x2) + (640*y1)), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/vd/cvdq3e3rctpnnvcpsqi6ljowjydylaevj43juwya2lkq2gt4x6rm.py
# Unsorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
triton_poi_fused_3 = async_compile.triton('triton_poi_fused_3', '''
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=[131072, 16], tile_hint=TileHint.SQUARE,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_3(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 131072
    xnumel = 16
    yoffset = (tl.program_id(1) + tl.program_id(2) * tl.num_programs(1)) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 256
    y1 = (yindex // 256)
    tmp0 = tl.load(in_ptr0 + (x2 + (16*y3)), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + (y0 + (256*x2) + (4096*y1)), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/ga/cga4qqmcosilvhj57sx2o6k4jmyvhesrnz4ef2jnsmeg27hzsjis.py
# Unsorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
triton_poi_fused_4 = async_compile.triton('triton_poi_fused_4', '''
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=[524288, 16], tile_hint=TileHint.SQUARE,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_4(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 524288
    xnumel = 16
    yoffset = (tl.program_id(1) + tl.program_id(2) * tl.num_programs(1)) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 512
    y1 = (yindex // 512)
    tmp0 = tl.load(in_ptr0 + (x2 + (16*y3)), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + (y0 + (512*x2) + (8192*y1)), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/xt/cxtdntmfzt4pxgg4ax4nwqbr2saif6gvx5tu6mhjtr3mmu6joqnz.py
# Topologically Sorted Source Nodes: [conv2d], Original ATen: [aten.convolution]
# Source node to ATen node mapping:
#   conv2d => convolution
# Graph fragment:
#   %convolution : [num_users=3] = call_function[target=torch.ops.aten.convolution.default](args = (%primals_3, %primals_1, %primals_2, [2, 2], [1, 1], [1, 1], False, [0, 0], 1), kwargs = {})
triton_poi_fused_convolution_5 = async_compile.triton('triton_poi_fused_convolution_5', '''
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=[32768], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_5', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_convolution_5(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 32768
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 8
    tmp0 = tl.load(in_out_ptr0 + (x2), None)
    tmp1 = tl.load(in_ptr0 + (x0), None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + (x2), tmp2, None)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/6h/c6hyzpdamaawo2mofyxckf5uc76dns3pw3d5al7dfi3wyq6yjh63.py
# Topologically Sorted Source Nodes: [x], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   x => cat
# Graph fragment:
#   %cat : [num_users=2] = call_function[target=torch.ops.aten.cat.default](args = ([%where, %where_1, %where_2, %where_3, %where_4], 1), kwargs = {})
triton_poi_fused_cat_6 = async_compile.triton('triton_poi_fused_cat_6', '''
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: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_6', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_6(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 163840
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x0 = xindex % 40
    x1 = (xindex // 40)
    x2 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 8, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + ((8*x1) + x0), tmp4, eviction_policy='evict_last', other=0.0)
    tmp6 = 0.0
    tmp7 = tmp5 > tmp6
    tmp8 = 1.0
    tmp9 = tmp5 * tmp8
    tmp10 = libdevice.expm1(tmp9)
    tmp11 = tmp10 * tmp8
    tmp12 = tl.where(tmp7, tmp9, tmp11)
    tmp13 = tl.full(tmp12.shape, 0.0, tmp12.dtype)
    tmp14 = tl.where(tmp4, tmp12, tmp13)
    tmp15 = tmp0 >= tmp3
    tmp16 = tl.full([1], 16, tl.int64)
    tmp17 = tmp0 < tmp16
    tmp18 = tmp15 & tmp17
    tmp19 = tl.load(in_ptr1 + ((8*x1) + ((-8) + x0)), tmp18, eviction_policy='evict_last', other=0.0)
    tmp20 = tmp19 > tmp6
    tmp21 = tmp19 * tmp8
    tmp22 = libdevice.expm1(tmp21)
    tmp23 = tmp22 * tmp8
    tmp24 = tl.where(tmp20, tmp21, tmp23)
    tmp25 = tl.full(tmp24.shape, 0.0, tmp24.dtype)
    tmp26 = tl.where(tmp18, tmp24, tmp25)
    tmp27 = tmp0 >= tmp16
    tmp28 = tl.full([1], 24, tl.int64)
    tmp29 = tmp0 < tmp28
    tmp30 = tmp27 & tmp29
    tmp31 = tl.load(in_ptr2 + ((8*x1) + ((-16) + x0)), tmp30, eviction_policy='evict_last', other=0.0)
    tmp32 = tmp31 > tmp6
    tmp33 = tmp31 * tmp8
    tmp34 = libdevice.expm1(tmp33)
    tmp35 = tmp34 * tmp8
    tmp36 = tl.where(tmp32, tmp33, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp30, tmp36, tmp37)
    tmp39 = tmp0 >= tmp28
    tmp40 = tl.full([1], 32, tl.int64)
    tmp41 = tmp0 < tmp40
    tmp42 = tmp39 & tmp41
    tmp43 = tl.load(in_ptr3 + ((8*x1) + ((-24) + x0)), tmp42, eviction_policy='evict_last', other=0.0)
    tmp44 = tmp43 > tmp6
    tmp45 = tmp43 * tmp8
    tmp46 = libdevice.expm1(tmp45)
    tmp47 = tmp46 * tmp8
    tmp48 = tl.where(tmp44, tmp45, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp42, tmp48, tmp49)
    tmp51 = tmp0 >= tmp40
    tmp52 = tl.full([1], 40, tl.int64)
    tmp53 = tmp0 < tmp52
    tmp54 = tl.load(in_ptr4 + ((8*x1) + ((-32) + x0)), tmp51, eviction_policy='evict_last', other=0.0)
    tmp55 = tmp54 > tmp6
    tmp56 = tmp54 * tmp8
    tmp57 = libdevice.expm1(tmp56)
    tmp58 = tmp57 * tmp8
    tmp59 = tl.where(tmp55, tmp56, tmp58)
    tmp60 = tl.full(tmp59.shape, 0.0, tmp59.dtype)
    tmp61 = tl.where(tmp51, tmp59, tmp60)
    tmp62 = tl.where(tmp42, tmp50, tmp61)
    tmp63 = tl.where(tmp30, tmp38, tmp62)
    tmp64 = tl.where(tmp18, tmp26, tmp63)
    tmp65 = tl.where(tmp4, tmp14, tmp64)
    tl.store(out_ptr0 + (x2), tmp65, None)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/vj/cvjjtqkvuaimcvmfmqshxjakjxckfp5zdb4eja5sx6ncidpg3myx.py
# Topologically Sorted Source Nodes: [conv2d_5, x_1], Original ATen: [aten.convolution, aten.elu]
# Source node to ATen node mapping:
#   conv2d_5 => convolution_5
#   x_1 => expm1_5, gt_5, mul_15, mul_17, where_5
# Graph fragment:
#   %convolution_5 : [num_users=3] = call_function[target=torch.ops.aten.convolution.default](args = (%cat, %primals_12, %primals_13, [2, 2], [1, 1], [1, 1], False, [0, 0], 1), kwargs = {})
#   %gt_5 : [num_users=1] = call_function[target=torch.ops.aten.gt.Scalar](args = (%convolution_5, 0), kwargs = {})
#   %mul_15 : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%convolution_5, 1.0), kwargs = {})
#   %expm1_5 : [num_users=1] = call_function[target=torch.ops.aten.expm1.default](args = (%mul_15,), kwargs = {})
#   %mul_17 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%expm1_5, 1.0), kwargs = {})
#   %where_5 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%gt_5, %mul_15, %mul_17), kwargs = {})
triton_poi_fused_convolution_elu_7 = async_compile.triton('triton_poi_fused_convolution_elu_7', '''
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: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_elu_7', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_convolution_elu_7(in_out_ptr0, in_ptr0, 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)
    x2 = xindex
    x0 = xindex % 256
    tmp0 = tl.load(in_out_ptr0 + (x2), None)
    tmp1 = tl.load(in_ptr0 + (x0), None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 1.0
    tmp6 = tmp2 * tmp5
    tmp7 = libdevice.expm1(tmp6)
    tmp8 = tmp7 * tmp5
    tmp9 = tl.where(tmp4, tmp6, tmp8)
    tl.store(in_out_ptr0 + (x2), tmp2, None)
    tl.store(out_ptr0 + (x2), tmp9, None)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/ws/cwsnognqaoy6k7trwgilh4cusquy2v3bpu4jlrjeyz2bjvzn2mwr.py
# Topologically Sorted Source Nodes: [conv2d_6, x_2], Original ATen: [aten.convolution, aten.elu]
# Source node to ATen node mapping:
#   conv2d_6 => convolution_6
#   x_2 => expm1_6, gt_6, mul_18, mul_20, where_6
# Graph fragment:
#   %convolution_6 : [num_users=3] = call_function[target=torch.ops.aten.convolution.default](args = (%where_5, %primals_14, %primals_15, [2, 2], [1, 1], [1, 1], False, [0, 0], 1), kwargs = {})
#   %gt_6 : [num_users=1] = call_function[target=torch.ops.aten.gt.Scalar](args = (%convolution_6, 0), kwargs = {})
#   %mul_18 : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%convolution_6, 1.0), kwargs = {})
#   %expm1_6 : [num_users=1] = call_function[target=torch.ops.aten.expm1.default](args = (%mul_18,), kwargs = {})
#   %mul_20 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%expm1_6, 1.0), kwargs = {})
#   %where_6 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%gt_6, %mul_18, %mul_20), kwargs = {})
triton_poi_fused_convolution_elu_8 = async_compile.triton('triton_poi_fused_convolution_elu_8', '''
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=[131072], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_elu_8', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_convolution_elu_8(in_out_ptr0, in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 131072
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 512
    tmp0 = tl.load(in_out_ptr0 + (x2), None)
    tmp1 = tl.load(in_ptr0 + (x0), None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 1.0
    tmp6 = tmp2 * tmp5
    tmp7 = libdevice.expm1(tmp6)
    tmp8 = tmp7 * tmp5
    tmp9 = tl.where(tmp4, tmp6, tmp8)
    tl.store(in_out_ptr0 + (x2), tmp2, None)
    tl.store(out_ptr0 + (x2), tmp9, None)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/xr/cxrrysiyglkcq7eoy2ingqrapathub6xg6g5dxm5ck3l2rmd4dxm.py
# Topologically Sorted Source Nodes: [conv2d_7, x_3], Original ATen: [aten.convolution, aten.elu]
# Source node to ATen node mapping:
#   conv2d_7 => convolution_7
#   x_3 => expm1_7, gt_7, mul_21, mul_23, where_7
# Graph fragment:
#   %convolution_7 : [num_users=3] = call_function[target=torch.ops.aten.convolution.default](args = (%where_6, %primals_16, %primals_17, [2, 2], [1, 1], [1, 1], False, [0, 0], 1), kwargs = {})
#   %gt_7 : [num_users=1] = call_function[target=torch.ops.aten.gt.Scalar](args = (%convolution_7, 0), kwargs = {})
#   %mul_21 : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%convolution_7, 1.0), kwargs = {})
#   %expm1_7 : [num_users=1] = call_function[target=torch.ops.aten.expm1.default](args = (%mul_21,), kwargs = {})
#   %mul_23 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%expm1_7, 1.0), kwargs = {})
#   %where_7 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%gt_7, %mul_21, %mul_23), kwargs = {})
triton_poi_fused_convolution_elu_9 = async_compile.triton('triton_poi_fused_convolution_elu_9', '''
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=[65536], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_elu_9', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_convolution_elu_9(in_out_ptr0, in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 65536
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 1024
    tmp0 = tl.load(in_out_ptr0 + (x2), None)
    tmp1 = tl.load(in_ptr0 + (x0), None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 1.0
    tmp6 = tmp2 * tmp5
    tmp7 = libdevice.expm1(tmp6)
    tmp8 = tmp7 * tmp5
    tmp9 = tl.where(tmp4, tmp6, tmp8)
    tl.store(in_out_ptr0 + (x2), tmp2, None)
    tl.store(out_ptr0 + (x2), tmp9, None)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/me/cmei55vt5o7njhvbzn6oh7wwejyrgvxzinpwsvxwvbaiyts5ctqo.py
# Topologically Sorted Source Nodes: [avg_pool2d, x_4], Original ATen: [aten.avg_pool2d, aten.squeeze]
# Source node to ATen node mapping:
#   avg_pool2d => avg_pool2d
#   x_4 => squeeze
# Graph fragment:
#   %avg_pool2d : [num_users=1] = call_function[target=torch.ops.aten.avg_pool2d.default](args = (%where_7, [2, 2]), kwargs = {})
#   %squeeze : [num_users=1] = call_function[target=torch.ops.aten.squeeze.default](args = (%avg_pool2d,), kwargs = {})
triton_poi_fused_avg_pool2d_squeeze_10 = async_compile.triton('triton_poi_fused_avg_pool2d_squeeze_10', '''
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=[16, 1024], tile_hint=TileHint.SQUARE,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_avg_pool2d_squeeze_10', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_avg_pool2d_squeeze_10(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 16
    xnumel = 1024
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x3 = xindex
    y0 = yindex % 2
    y4 = (yindex // 2)
    y2 = (yindex // 4)
    y5 = yindex % 4
    tmp0 = tl.load(in_ptr0 + (x3 + (2048*y0) + (8192*y4)), xmask & ymask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1024 + x3 + (2048*y0) + (8192*y4)), xmask & ymask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (4096 + x3 + (2048*y0) + (8192*y4)), xmask & ymask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (5120 + x3 + (2048*y0) + (8192*y4)), xmask & ymask, eviction_policy='evict_last')
    tmp2 = tmp1 + tmp0
    tmp4 = tmp3 + tmp2
    tmp6 = tmp5 + tmp4
    tmp7 = 0.25
    tmp8 = tmp6 * tmp7
    tl.store(out_ptr0 + (y5 + (4*x3) + (4096*y2)), tmp8, xmask & ymask)
''', 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 = args
    args.clear()
    assert_size_stride(primals_1, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_2, (8, ), (1, ))
    assert_size_stride(primals_3, (4, 8, 64, 64), (32768, 4096, 64, 1))
    assert_size_stride(primals_4, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_5, (8, ), (1, ))
    assert_size_stride(primals_6, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_7, (8, ), (1, ))
    assert_size_stride(primals_8, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_9, (8, ), (1, ))
    assert_size_stride(primals_10, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_11, (8, ), (1, ))
    assert_size_stride(primals_12, (256, 40, 4, 4), (640, 16, 4, 1))
    assert_size_stride(primals_13, (256, ), (1, ))
    assert_size_stride(primals_14, (512, 256, 4, 4), (4096, 16, 4, 1))
    assert_size_stride(primals_15, (512, ), (1, ))
    assert_size_stride(primals_16, (1024, 512, 4, 4), (8192, 16, 4, 1))
    assert_size_stride(primals_17, (1024, ), (1, ))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        stream0 = get_raw_stream(0)
        triton_poi_fused_0.run(primals_1, buf0, 64, 16, grid=grid(64, 16), stream=stream0)
        del primals_1
        buf1 = empty_strided_cuda((4, 8, 64, 64), (32768, 1, 512, 8), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_1.run(primals_3, buf1, 32, 4096, grid=grid(32, 4096), stream=stream0)
        del primals_3
        buf2 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_0.run(primals_4, buf2, 64, 16, grid=grid(64, 16), stream=stream0)
        del primals_4
        buf3 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_0.run(primals_6, buf3, 64, 16, grid=grid(64, 16), stream=stream0)
        del primals_6
        buf4 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_0.run(primals_8, buf4, 64, 16, grid=grid(64, 16), stream=stream0)
        del primals_8
        buf5 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_0.run(primals_10, buf5, 64, 16, grid=grid(64, 16), stream=stream0)
        del primals_10
        buf6 = empty_strided_cuda((256, 40, 4, 4), (640, 1, 160, 40), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_2.run(primals_12, buf6, 10240, 16, grid=grid(10240, 16), stream=stream0)
        del primals_12
        buf7 = empty_strided_cuda((512, 256, 4, 4), (4096, 1, 1024, 256), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_3.run(primals_14, buf7, 131072, 16, grid=grid(131072, 16), stream=stream0)
        del primals_14
        buf8 = empty_strided_cuda((1024, 512, 4, 4), (8192, 1, 2048, 512), torch.float32)
        # Unsorted Source Nodes: [], Original ATen: []
        triton_poi_fused_4.run(primals_16, buf8, 524288, 16, grid=grid(524288, 16), stream=stream0)
        del primals_16
        # Topologically Sorted Source Nodes: [conv2d], Original ATen: [aten.convolution]
        buf9 = extern_kernels.convolution(buf1, buf0, stride=(2, 2), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf9, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf10 = buf9; del buf9  # reuse
        # Topologically Sorted Source Nodes: [conv2d], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_5.run(buf10, primals_2, 32768, grid=grid(32768), stream=stream0)
        del primals_2
        # Topologically Sorted Source Nodes: [conv2d_1], Original ATen: [aten.convolution]
        buf11 = extern_kernels.convolution(buf1, buf2, stride=(2, 2), padding=(3, 3), dilation=(2, 2), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf11, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf12 = buf11; del buf11  # reuse
        # Topologically Sorted Source Nodes: [conv2d_1], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_5.run(buf12, primals_5, 32768, grid=grid(32768), stream=stream0)
        del primals_5
        # Topologically Sorted Source Nodes: [conv2d_2], Original ATen: [aten.convolution]
        buf13 = extern_kernels.convolution(buf1, buf3, stride=(2, 2), padding=(6, 6), dilation=(4, 4), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf13, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf14 = buf13; del buf13  # reuse
        # Topologically Sorted Source Nodes: [conv2d_2], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_5.run(buf14, primals_7, 32768, grid=grid(32768), stream=stream0)
        del primals_7
        # Topologically Sorted Source Nodes: [conv2d_3], Original ATen: [aten.convolution]
        buf15 = extern_kernels.convolution(buf1, buf4, stride=(2, 2), padding=(12, 12), dilation=(8, 8), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf15, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf16 = buf15; del buf15  # reuse
        # Topologically Sorted Source Nodes: [conv2d_3], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_5.run(buf16, primals_9, 32768, grid=grid(32768), stream=stream0)
        del primals_9
        # Topologically Sorted Source Nodes: [conv2d_4], Original ATen: [aten.convolution]
        buf17 = extern_kernels.convolution(buf1, buf5, stride=(2, 2), padding=(24, 24), dilation=(16, 16), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf18 = buf17; del buf17  # reuse
        # Topologically Sorted Source Nodes: [conv2d_4], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_5.run(buf18, primals_11, 32768, grid=grid(32768), stream=stream0)
        del primals_11
        buf19 = empty_strided_cuda((4, 40, 32, 32), (40960, 1, 1280, 40), torch.float32)
        # Topologically Sorted Source Nodes: [x], Original ATen: [aten.cat]
        triton_poi_fused_cat_6.run(buf10, buf12, buf14, buf16, buf18, buf19, 163840, grid=grid(163840), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d_5], Original ATen: [aten.convolution]
        buf20 = extern_kernels.convolution(buf19, buf6, stride=(2, 2), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf20, (4, 256, 16, 16), (65536, 1, 4096, 256))
        buf21 = buf20; del buf20  # reuse
        buf22 = empty_strided_cuda((4, 256, 16, 16), (65536, 1, 4096, 256), torch.float32)
        # Topologically Sorted Source Nodes: [conv2d_5, x_1], Original ATen: [aten.convolution, aten.elu]
        triton_poi_fused_convolution_elu_7.run(buf21, primals_13, buf22, 262144, grid=grid(262144), stream=stream0)
        del primals_13
        # Topologically Sorted Source Nodes: [conv2d_6], Original ATen: [aten.convolution]
        buf23 = extern_kernels.convolution(buf22, buf7, stride=(2, 2), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf23, (4, 512, 8, 8), (32768, 1, 4096, 512))
        buf24 = buf23; del buf23  # reuse
        buf25 = empty_strided_cuda((4, 512, 8, 8), (32768, 1, 4096, 512), torch.float32)
        # Topologically Sorted Source Nodes: [conv2d_6, x_2], Original ATen: [aten.convolution, aten.elu]
        triton_poi_fused_convolution_elu_8.run(buf24, primals_15, buf25, 131072, grid=grid(131072), stream=stream0)
        del primals_15
        # Topologically Sorted Source Nodes: [conv2d_7], Original ATen: [aten.convolution]
        buf26 = extern_kernels.convolution(buf25, buf8, stride=(2, 2), padding=(1, 1), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf26, (4, 1024, 4, 4), (16384, 1, 4096, 1024))
        buf27 = buf26; del buf26  # reuse
        buf28 = empty_strided_cuda((4, 1024, 4, 4), (16384, 1, 4096, 1024), torch.float32)
        # Topologically Sorted Source Nodes: [conv2d_7, x_3], Original ATen: [aten.convolution, aten.elu]
        triton_poi_fused_convolution_elu_9.run(buf27, primals_17, buf28, 65536, grid=grid(65536), stream=stream0)
        del primals_17
        buf29 = empty_strided_cuda((4, 1024, 2, 2), (4096, 4, 2, 1), torch.float32)
        # Topologically Sorted Source Nodes: [avg_pool2d, x_4], Original ATen: [aten.avg_pool2d, aten.squeeze]
        triton_poi_fused_avg_pool2d_squeeze_10.run(buf28, buf29, 16, 1024, grid=grid(16, 1024), stream=stream0)
    return (buf29, buf0, buf1, buf2, buf3, buf4, buf5, buf6, buf7, buf8, buf10, buf12, buf14, buf16, buf18, buf19, buf21, buf22, buf24, buf25, buf27, buf28, )


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((8, 8, 4, 4), (128, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 8, 64, 64), (32768, 4096, 64, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((8, 8, 4, 4), (128, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((8, 8, 4, 4), (128, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((8, 8, 4, 4), (128, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((8, 8, 4, 4), (128, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((8, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((256, 40, 4, 4), (640, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((512, 256, 4, 4), (4096, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((512, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_16 = rand_strided((1024, 512, 4, 4), (8192, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_17 = rand_strided((1024, ), (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])
    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
import torch.nn.functional as F


class EncoderCNN(nn.Module):

    def __init__(self, latent_dim=1024):
        super(EncoderCNN, self).__init__()
        self.latent_dim = latent_dim
        self.conv1_1 = nn.Conv2d(8, 8, 4, stride=2, dilation=1, padding=1)
        self.conv1_2 = nn.Conv2d(8, 8, 4, stride=2, dilation=2, padding=3)
        self.conv1_4 = nn.Conv2d(8, 8, 4, stride=2, dilation=4, padding=6)
        self.conv1_8 = nn.Conv2d(8, 8, 4, stride=2, dilation=8, padding=12)
        self.conv1_16 = nn.Conv2d(8, 8, 4, stride=2, dilation=16, padding=24)
        self.conv2 = nn.Conv2d(8 * 5, self.latent_dim // 4, 4, stride=2,
            padding=1)
        self.conv3 = nn.Conv2d(self.latent_dim // 4, self.latent_dim // 2, 
            4, stride=2, padding=1)
        self.conv4 = nn.Conv2d(self.latent_dim // 2, self.latent_dim, 4,
            stride=2, padding=1)

    def forward(self, x):
        x1 = F.elu(self.conv1_1(x))
        x2 = F.elu(self.conv1_2(x))
        x4 = F.elu(self.conv1_4(x))
        x8 = F.elu(self.conv1_8(x))
        x16 = F.elu(self.conv1_16(x))
        x = torch.cat((x1, x2, x4, x8, x16), dim=1)
        x = F.elu(self.conv2(x))
        x = F.elu(self.conv3(x))
        x = F.elu(self.conv4(x))
        x = F.avg_pool2d(x, 2).squeeze()
        return x

    def train_order_block_ids(self):
        return [[0, 9], [10, 15]]


def get_inputs():
    return [torch.rand([4, 8, 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.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda


@triton.jit
def triton_poi_fused_0(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    ynumel = 64
    xnumel = 16
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 8
    y1 = yindex // 8
    tmp0 = tl.load(in_ptr0 + (x2 + 16 * y3), xmask & ymask, eviction_policy
        ='evict_last')
    tl.store(out_ptr0 + (y0 + 8 * x2 + 128 * y1), tmp0, xmask & ymask)


@triton.jit
def triton_poi_fused_1(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    ynumel = 32
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    x2 = xindex
    y3 = yindex
    y0 = yindex % 8
    y1 = yindex // 8
    tmp0 = tl.load(in_ptr0 + (x2 + 4096 * y3), ymask, eviction_policy=
        'evict_last')
    tl.store(out_ptr0 + (y0 + 8 * x2 + 32768 * y1), tmp0, ymask)


@triton.jit
def triton_poi_fused_2(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    xnumel = 16
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 40
    y1 = yindex // 40
    tmp0 = tl.load(in_ptr0 + (x2 + 16 * y3), xmask, eviction_policy=
        'evict_last')
    tl.store(out_ptr0 + (y0 + 40 * x2 + 640 * y1), tmp0, xmask)


@triton.jit
def triton_poi_fused_3(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    xnumel = 16
    yoffset = (tl.program_id(1) + tl.program_id(2) * tl.num_programs(1)
        ) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 256
    y1 = yindex // 256
    tmp0 = tl.load(in_ptr0 + (x2 + 16 * y3), xmask, eviction_policy=
        'evict_last')
    tl.store(out_ptr0 + (y0 + 256 * x2 + 4096 * y1), tmp0, xmask)


@triton.jit
def triton_poi_fused_4(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    xnumel = 16
    yoffset = (tl.program_id(1) + tl.program_id(2) * tl.num_programs(1)
        ) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 512
    y1 = yindex // 512
    tmp0 = tl.load(in_ptr0 + (x2 + 16 * y3), xmask, eviction_policy=
        'evict_last')
    tl.store(out_ptr0 + (y0 + 512 * x2 + 8192 * y1), tmp0, xmask)


@triton.jit
def triton_poi_fused_convolution_5(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 8
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x2, tmp2, None)


@triton.jit
def triton_poi_fused_cat_6(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4,
    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 % 40
    x1 = xindex // 40
    x2 = xindex
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 8, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (8 * x1 + x0), tmp4, eviction_policy=
        'evict_last', other=0.0)
    tmp6 = 0.0
    tmp7 = tmp5 > tmp6
    tmp8 = 1.0
    tmp9 = tmp5 * tmp8
    tmp10 = libdevice.expm1(tmp9)
    tmp11 = tmp10 * tmp8
    tmp12 = tl.where(tmp7, tmp9, tmp11)
    tmp13 = tl.full(tmp12.shape, 0.0, tmp12.dtype)
    tmp14 = tl.where(tmp4, tmp12, tmp13)
    tmp15 = tmp0 >= tmp3
    tmp16 = tl.full([1], 16, tl.int64)
    tmp17 = tmp0 < tmp16
    tmp18 = tmp15 & tmp17
    tmp19 = tl.load(in_ptr1 + (8 * x1 + (-8 + x0)), tmp18, eviction_policy=
        'evict_last', other=0.0)
    tmp20 = tmp19 > tmp6
    tmp21 = tmp19 * tmp8
    tmp22 = libdevice.expm1(tmp21)
    tmp23 = tmp22 * tmp8
    tmp24 = tl.where(tmp20, tmp21, tmp23)
    tmp25 = tl.full(tmp24.shape, 0.0, tmp24.dtype)
    tmp26 = tl.where(tmp18, tmp24, tmp25)
    tmp27 = tmp0 >= tmp16
    tmp28 = tl.full([1], 24, tl.int64)
    tmp29 = tmp0 < tmp28
    tmp30 = tmp27 & tmp29
    tmp31 = tl.load(in_ptr2 + (8 * x1 + (-16 + x0)), tmp30, eviction_policy
        ='evict_last', other=0.0)
    tmp32 = tmp31 > tmp6
    tmp33 = tmp31 * tmp8
    tmp34 = libdevice.expm1(tmp33)
    tmp35 = tmp34 * tmp8
    tmp36 = tl.where(tmp32, tmp33, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp30, tmp36, tmp37)
    tmp39 = tmp0 >= tmp28
    tmp40 = tl.full([1], 32, tl.int64)
    tmp41 = tmp0 < tmp40
    tmp42 = tmp39 & tmp41
    tmp43 = tl.load(in_ptr3 + (8 * x1 + (-24 + x0)), tmp42, eviction_policy
        ='evict_last', other=0.0)
    tmp44 = tmp43 > tmp6
    tmp45 = tmp43 * tmp8
    tmp46 = libdevice.expm1(tmp45)
    tmp47 = tmp46 * tmp8
    tmp48 = tl.where(tmp44, tmp45, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp42, tmp48, tmp49)
    tmp51 = tmp0 >= tmp40
    tl.full([1], 40, tl.int64)
    tmp54 = tl.load(in_ptr4 + (8 * x1 + (-32 + x0)), tmp51, eviction_policy
        ='evict_last', other=0.0)
    tmp55 = tmp54 > tmp6
    tmp56 = tmp54 * tmp8
    tmp57 = libdevice.expm1(tmp56)
    tmp58 = tmp57 * tmp8
    tmp59 = tl.where(tmp55, tmp56, tmp58)
    tmp60 = tl.full(tmp59.shape, 0.0, tmp59.dtype)
    tmp61 = tl.where(tmp51, tmp59, tmp60)
    tmp62 = tl.where(tmp42, tmp50, tmp61)
    tmp63 = tl.where(tmp30, tmp38, tmp62)
    tmp64 = tl.where(tmp18, tmp26, tmp63)
    tmp65 = tl.where(tmp4, tmp14, tmp64)
    tl.store(out_ptr0 + x2, tmp65, None)


@triton.jit
def triton_poi_fused_convolution_elu_7(in_out_ptr0, in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 256
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 1.0
    tmp6 = tmp2 * tmp5
    tmp7 = libdevice.expm1(tmp6)
    tmp8 = tmp7 * tmp5
    tmp9 = tl.where(tmp4, tmp6, tmp8)
    tl.store(in_out_ptr0 + x2, tmp2, None)
    tl.store(out_ptr0 + x2, tmp9, None)


@triton.jit
def triton_poi_fused_convolution_elu_8(in_out_ptr0, in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 512
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 1.0
    tmp6 = tmp2 * tmp5
    tmp7 = libdevice.expm1(tmp6)
    tmp8 = tmp7 * tmp5
    tmp9 = tl.where(tmp4, tmp6, tmp8)
    tl.store(in_out_ptr0 + x2, tmp2, None)
    tl.store(out_ptr0 + x2, tmp9, None)


@triton.jit
def triton_poi_fused_convolution_elu_9(in_out_ptr0, in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 1024
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 1.0
    tmp6 = tmp2 * tmp5
    tmp7 = libdevice.expm1(tmp6)
    tmp8 = tmp7 * tmp5
    tmp9 = tl.where(tmp4, tmp6, tmp8)
    tl.store(in_out_ptr0 + x2, tmp2, None)
    tl.store(out_ptr0 + x2, tmp9, None)


@triton.jit
def triton_poi_fused_avg_pool2d_squeeze_10(in_ptr0, out_ptr0, ynumel,
    xnumel, YBLOCK: tl.constexpr, XBLOCK: tl.constexpr):
    ynumel = 16
    xnumel = 1024
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x3 = xindex
    y0 = yindex % 2
    y4 = yindex // 2
    y2 = yindex // 4
    y5 = yindex % 4
    tmp0 = tl.load(in_ptr0 + (x3 + 2048 * y0 + 8192 * y4), xmask & ymask,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1024 + x3 + 2048 * y0 + 8192 * y4), xmask &
        ymask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (4096 + x3 + 2048 * y0 + 8192 * y4), xmask &
        ymask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (5120 + x3 + 2048 * y0 + 8192 * y4), xmask &
        ymask, eviction_policy='evict_last')
    tmp2 = tmp1 + tmp0
    tmp4 = tmp3 + tmp2
    tmp6 = tmp5 + tmp4
    tmp7 = 0.25
    tmp8 = tmp6 * tmp7
    tl.store(out_ptr0 + (y5 + 4 * x3 + 4096 * y2), tmp8, xmask & ymask)


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) = args
    args.clear()
    assert_size_stride(primals_1, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_2, (8,), (1,))
    assert_size_stride(primals_3, (4, 8, 64, 64), (32768, 4096, 64, 1))
    assert_size_stride(primals_4, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_5, (8,), (1,))
    assert_size_stride(primals_6, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_7, (8,), (1,))
    assert_size_stride(primals_8, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_9, (8,), (1,))
    assert_size_stride(primals_10, (8, 8, 4, 4), (128, 16, 4, 1))
    assert_size_stride(primals_11, (8,), (1,))
    assert_size_stride(primals_12, (256, 40, 4, 4), (640, 16, 4, 1))
    assert_size_stride(primals_13, (256,), (1,))
    assert_size_stride(primals_14, (512, 256, 4, 4), (4096, 16, 4, 1))
    assert_size_stride(primals_15, (512,), (1,))
    assert_size_stride(primals_16, (1024, 512, 4, 4), (8192, 16, 4, 1))
    assert_size_stride(primals_17, (1024,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_0[grid(64, 16)](primals_1, buf0, 64, 16, XBLOCK=16,
            YBLOCK=64, num_warps=4, num_stages=1)
        del primals_1
        buf1 = empty_strided_cuda((4, 8, 64, 64), (32768, 1, 512, 8), torch
            .float32)
        triton_poi_fused_1[grid(32, 4096)](primals_3, buf1, 32, 4096,
            XBLOCK=32, YBLOCK=32, num_warps=4, num_stages=1)
        del primals_3
        buf2 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        triton_poi_fused_0[grid(64, 16)](primals_4, buf2, 64, 16, XBLOCK=16,
            YBLOCK=64, num_warps=4, num_stages=1)
        del primals_4
        buf3 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        triton_poi_fused_0[grid(64, 16)](primals_6, buf3, 64, 16, XBLOCK=16,
            YBLOCK=64, num_warps=4, num_stages=1)
        del primals_6
        buf4 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        triton_poi_fused_0[grid(64, 16)](primals_8, buf4, 64, 16, XBLOCK=16,
            YBLOCK=64, num_warps=4, num_stages=1)
        del primals_8
        buf5 = empty_strided_cuda((8, 8, 4, 4), (128, 1, 32, 8), torch.float32)
        triton_poi_fused_0[grid(64, 16)](primals_10, buf5, 64, 16, XBLOCK=
            16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_10
        buf6 = empty_strided_cuda((256, 40, 4, 4), (640, 1, 160, 40), torch
            .float32)
        triton_poi_fused_2[grid(10240, 16)](primals_12, buf6, 10240, 16,
            XBLOCK=16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_12
        buf7 = empty_strided_cuda((512, 256, 4, 4), (4096, 1, 1024, 256),
            torch.float32)
        triton_poi_fused_3[grid(131072, 16)](primals_14, buf7, 131072, 16,
            XBLOCK=16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_14
        buf8 = empty_strided_cuda((1024, 512, 4, 4), (8192, 1, 2048, 512),
            torch.float32)
        triton_poi_fused_4[grid(524288, 16)](primals_16, buf8, 524288, 16,
            XBLOCK=16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_16
        buf9 = extern_kernels.convolution(buf1, buf0, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf9, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf10 = buf9
        del buf9
        triton_poi_fused_convolution_5[grid(32768)](buf10, primals_2, 32768,
            XBLOCK=128, num_warps=4, num_stages=1)
        del primals_2
        buf11 = extern_kernels.convolution(buf1, buf2, stride=(2, 2),
            padding=(3, 3), dilation=(2, 2), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf11, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf12 = buf11
        del buf11
        triton_poi_fused_convolution_5[grid(32768)](buf12, primals_5, 32768,
            XBLOCK=128, num_warps=4, num_stages=1)
        del primals_5
        buf13 = extern_kernels.convolution(buf1, buf3, stride=(2, 2),
            padding=(6, 6), dilation=(4, 4), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf13, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf14 = buf13
        del buf13
        triton_poi_fused_convolution_5[grid(32768)](buf14, primals_7, 32768,
            XBLOCK=128, num_warps=4, num_stages=1)
        del primals_7
        buf15 = extern_kernels.convolution(buf1, buf4, stride=(2, 2),
            padding=(12, 12), dilation=(8, 8), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf15, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf16 = buf15
        del buf15
        triton_poi_fused_convolution_5[grid(32768)](buf16, primals_9, 32768,
            XBLOCK=128, num_warps=4, num_stages=1)
        del primals_9
        buf17 = extern_kernels.convolution(buf1, buf5, stride=(2, 2),
            padding=(24, 24), dilation=(16, 16), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 8, 32, 32), (8192, 1, 256, 8))
        buf18 = buf17
        del buf17
        triton_poi_fused_convolution_5[grid(32768)](buf18, primals_11, 
            32768, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_11
        buf19 = empty_strided_cuda((4, 40, 32, 32), (40960, 1, 1280, 40),
            torch.float32)
        triton_poi_fused_cat_6[grid(163840)](buf10, buf12, buf14, buf16,
            buf18, buf19, 163840, XBLOCK=512, num_warps=8, num_stages=1)
        buf20 = extern_kernels.convolution(buf19, buf6, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf20, (4, 256, 16, 16), (65536, 1, 4096, 256))
        buf21 = buf20
        del buf20
        buf22 = empty_strided_cuda((4, 256, 16, 16), (65536, 1, 4096, 256),
            torch.float32)
        triton_poi_fused_convolution_elu_7[grid(262144)](buf21, primals_13,
            buf22, 262144, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_13
        buf23 = extern_kernels.convolution(buf22, buf7, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf23, (4, 512, 8, 8), (32768, 1, 4096, 512))
        buf24 = buf23
        del buf23
        buf25 = empty_strided_cuda((4, 512, 8, 8), (32768, 1, 4096, 512),
            torch.float32)
        triton_poi_fused_convolution_elu_8[grid(131072)](buf24, primals_15,
            buf25, 131072, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_15
        buf26 = extern_kernels.convolution(buf25, buf8, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf26, (4, 1024, 4, 4), (16384, 1, 4096, 1024))
        buf27 = buf26
        del buf26
        buf28 = empty_strided_cuda((4, 1024, 4, 4), (16384, 1, 4096, 1024),
            torch.float32)
        triton_poi_fused_convolution_elu_9[grid(65536)](buf27, primals_17,
            buf28, 65536, XBLOCK=512, num_warps=4, num_stages=1)
        del primals_17
        buf29 = empty_strided_cuda((4, 1024, 2, 2), (4096, 4, 2, 1), torch.
            float32)
        triton_poi_fused_avg_pool2d_squeeze_10[grid(16, 1024)](buf28, buf29,
            16, 1024, XBLOCK=64, YBLOCK=16, num_warps=4, num_stages=1)
    return (buf29, buf0, buf1, buf2, buf3, buf4, buf5, buf6, buf7, buf8,
        buf10, buf12, buf14, buf16, buf18, buf19, buf21, buf22, buf24,
        buf25, buf27, buf28)


class EncoderCNNNew(nn.Module):

    def __init__(self, latent_dim=1024):
        super(EncoderCNNNew, self).__init__()
        self.latent_dim = latent_dim
        self.conv1_1 = nn.Conv2d(8, 8, 4, stride=2, dilation=1, padding=1)
        self.conv1_2 = nn.Conv2d(8, 8, 4, stride=2, dilation=2, padding=3)
        self.conv1_4 = nn.Conv2d(8, 8, 4, stride=2, dilation=4, padding=6)
        self.conv1_8 = nn.Conv2d(8, 8, 4, stride=2, dilation=8, padding=12)
        self.conv1_16 = nn.Conv2d(8, 8, 4, stride=2, dilation=16, padding=24)
        self.conv2 = nn.Conv2d(8 * 5, self.latent_dim // 4, 4, stride=2,
            padding=1)
        self.conv3 = nn.Conv2d(self.latent_dim // 4, self.latent_dim // 2, 
            4, stride=2, padding=1)
        self.conv4 = nn.Conv2d(self.latent_dim // 2, self.latent_dim, 4,
            stride=2, padding=1)

    def train_order_block_ids(self):
        return [[0, 9], [10, 15]]

    def forward(self, input_0):
        primals_1 = self.conv1_1.weight
        primals_2 = self.conv1_1.bias
        primals_4 = self.conv1_2.weight
        primals_5 = self.conv1_2.bias
        primals_6 = self.conv1_4.weight
        primals_7 = self.conv1_4.bias
        primals_8 = self.conv1_8.weight
        primals_9 = self.conv1_8.bias
        primals_10 = self.conv1_16.weight
        primals_11 = self.conv1_16.bias
        primals_12 = self.conv2.weight
        primals_13 = self.conv2.bias
        primals_14 = self.conv3.weight
        primals_15 = self.conv3.bias
        primals_16 = self.conv4.weight
        primals_17 = self.conv4.bias
        primals_3 = 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])
        return output[0]
