# 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_8/inductor_cache/ok/cok5e6xwrytpg276smpyk5pd3rehmb4nxf3fw4r3rqdnzvwf3xi2.py
# Topologically Sorted Source Nodes: [conv2d, h], Original ATen: [aten.convolution, aten.relu]
# Source node to ATen node mapping:
#   conv2d => convolution
#   h => relu
# Graph fragment:
#   %convolution : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%primals_3, %primals_1, %primals_2, [1, 1], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
#   %relu : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%convolution,), kwargs = {})
triton_poi_fused_convolution_relu_0 = async_compile.triton('triton_poi_fused_convolution_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=[1048576], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '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, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_relu_0', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, '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_convolution_relu_0(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 984064
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 3844) % 64
    tmp0 = tl.load(in_out_ptr0 + (x3), xmask)
    tmp1 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + (x3), tmp4, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/6f/c6fr4cx2vioyzlzm7pznjz6yjupxdcafrkb5pqa3msrv4wdmxh6p.py
# Topologically Sorted Source Nodes: [h_1], Original ATen: [aten.convolution]
# Source node to ATen node mapping:
#   h_1 => convolution_1
# Graph fragment:
#   %convolution_1 : [num_users=2] = call_function[target=torch.ops.aten.convolution.default](args = (%relu, %primals_4, %primals_5, [1, 1], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
triton_poi_fused_convolution_1 = async_compile.triton('triton_poi_fused_convolution_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=[524288], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '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, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_1', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, '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_convolution_1(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 460800
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x1 = (xindex // 3600) % 32
    tmp0 = tl.load(in_out_ptr0 + (x3), None)
    tmp1 = tl.load(in_ptr0 + (x1), None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + (x3), tmp2, None)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/ia/ciabfu5dk5w373uyeecet2pkqnjtbhpm2uyxzzererpezli2tokg.py
# Topologically Sorted Source Nodes: [h_2], Original ATen: [aten._adaptive_avg_pool2d]
# Source node to ATen node mapping:
#   h_2 => _adaptive_avg_pool2d
# Graph fragment:
#   %_adaptive_avg_pool2d : [num_users=1] = call_function[target=torch.ops.aten._adaptive_avg_pool2d.default](args = (%convolution_1, [16, 16]), kwargs = {})
triton_poi_fused__adaptive_avg_pool2d_2 = async_compile.triton('triton_poi_fused__adaptive_avg_pool2d_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=[32768], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '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, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__adaptive_avg_pool2d_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 25, '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__adaptive_avg_pool2d_2(in_ptr0, out_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)
    x1 = (xindex // 16) % 16
    x0 = xindex % 16
    x2 = (xindex // 256)
    x4 = xindex
    tmp0 = ((15*x1) // 4)
    tmp1 = ((75 + (60*x1)) // 16)
    tmp2 = tmp0 < tmp1
    tmp3 = ((15*x0) // 4)
    tmp4 = ((75 + (60*x0)) // 16)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp2 & tmp5
    tmp7 = tl.load(in_ptr0 + ((60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp6, eviction_policy='evict_last', other=0.0)
    tmp8 = 1 + ((15*x0) // 4)
    tmp9 = tmp8 < tmp4
    tmp10 = tmp2 & tmp9
    tmp11 = tl.load(in_ptr0 + (1 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp10, eviction_policy='evict_last', other=0.0)
    tmp12 = tmp11 + tmp7
    tmp13 = 2 + ((15*x0) // 4)
    tmp14 = tmp13 < tmp4
    tmp15 = tmp2 & tmp14
    tmp16 = tl.load(in_ptr0 + (2 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp15, eviction_policy='evict_last', other=0.0)
    tmp17 = tmp16 + tmp12
    tmp18 = 3 + ((15*x0) // 4)
    tmp19 = tmp18 < tmp4
    tmp20 = tmp2 & tmp19
    tmp21 = tl.load(in_ptr0 + (3 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp20, eviction_policy='evict_last', other=0.0)
    tmp22 = tmp21 + tmp17
    tmp23 = 4 + ((15*x0) // 4)
    tmp24 = tmp23 < tmp4
    tmp25 = tmp2 & tmp24
    tmp26 = tl.load(in_ptr0 + (4 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp25, eviction_policy='evict_last', other=0.0)
    tmp27 = tmp26 + tmp22
    tmp28 = 1 + ((15*x1) // 4)
    tmp29 = tmp28 < tmp1
    tmp30 = tmp29 & tmp5
    tmp31 = tl.load(in_ptr0 + (60 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp30, eviction_policy='evict_last', other=0.0)
    tmp32 = tmp31 + tmp27
    tmp33 = tmp29 & tmp9
    tmp34 = tl.load(in_ptr0 + (61 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp33, eviction_policy='evict_last', other=0.0)
    tmp35 = tmp34 + tmp32
    tmp36 = tmp29 & tmp14
    tmp37 = tl.load(in_ptr0 + (62 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp36, eviction_policy='evict_last', other=0.0)
    tmp38 = tmp37 + tmp35
    tmp39 = tmp29 & tmp19
    tmp40 = tl.load(in_ptr0 + (63 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp39, eviction_policy='evict_last', other=0.0)
    tmp41 = tmp40 + tmp38
    tmp42 = tmp29 & tmp24
    tmp43 = tl.load(in_ptr0 + (64 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp42, eviction_policy='evict_last', other=0.0)
    tmp44 = tmp43 + tmp41
    tmp45 = 2 + ((15*x1) // 4)
    tmp46 = tmp45 < tmp1
    tmp47 = tmp46 & tmp5
    tmp48 = tl.load(in_ptr0 + (120 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp47, eviction_policy='evict_last', other=0.0)
    tmp49 = tmp48 + tmp44
    tmp50 = tmp46 & tmp9
    tmp51 = tl.load(in_ptr0 + (121 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp50, eviction_policy='evict_last', other=0.0)
    tmp52 = tmp51 + tmp49
    tmp53 = tmp46 & tmp14
    tmp54 = tl.load(in_ptr0 + (122 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp53, eviction_policy='evict_last', other=0.0)
    tmp55 = tmp54 + tmp52
    tmp56 = tmp46 & tmp19
    tmp57 = tl.load(in_ptr0 + (123 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp56, eviction_policy='evict_last', other=0.0)
    tmp58 = tmp57 + tmp55
    tmp59 = tmp46 & tmp24
    tmp60 = tl.load(in_ptr0 + (124 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp59, eviction_policy='evict_last', other=0.0)
    tmp61 = tmp60 + tmp58
    tmp62 = 3 + ((15*x1) // 4)
    tmp63 = tmp62 < tmp1
    tmp64 = tmp63 & tmp5
    tmp65 = tl.load(in_ptr0 + (180 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp64, eviction_policy='evict_last', other=0.0)
    tmp66 = tmp65 + tmp61
    tmp67 = tmp63 & tmp9
    tmp68 = tl.load(in_ptr0 + (181 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp67, eviction_policy='evict_last', other=0.0)
    tmp69 = tmp68 + tmp66
    tmp70 = tmp63 & tmp14
    tmp71 = tl.load(in_ptr0 + (182 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp70, eviction_policy='evict_last', other=0.0)
    tmp72 = tmp71 + tmp69
    tmp73 = tmp63 & tmp19
    tmp74 = tl.load(in_ptr0 + (183 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp73, eviction_policy='evict_last', other=0.0)
    tmp75 = tmp74 + tmp72
    tmp76 = tmp63 & tmp24
    tmp77 = tl.load(in_ptr0 + (184 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp76, eviction_policy='evict_last', other=0.0)
    tmp78 = tmp77 + tmp75
    tmp79 = 4 + ((15*x1) // 4)
    tmp80 = tmp79 < tmp1
    tmp81 = tmp80 & tmp5
    tmp82 = tl.load(in_ptr0 + (240 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp81, eviction_policy='evict_last', other=0.0)
    tmp83 = tmp82 + tmp78
    tmp84 = tmp80 & tmp9
    tmp85 = tl.load(in_ptr0 + (241 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp84, eviction_policy='evict_last', other=0.0)
    tmp86 = tmp85 + tmp83
    tmp87 = tmp80 & tmp14
    tmp88 = tl.load(in_ptr0 + (242 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp87, eviction_policy='evict_last', other=0.0)
    tmp89 = tmp88 + tmp86
    tmp90 = tmp80 & tmp19
    tmp91 = tl.load(in_ptr0 + (243 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp90, eviction_policy='evict_last', other=0.0)
    tmp92 = tmp91 + tmp89
    tmp93 = tmp80 & tmp24
    tmp94 = tl.load(in_ptr0 + (244 + (60*((15*x1) // 4)) + (3600*x2) + ((15*x0) // 4)), tmp93, eviction_policy='evict_last', other=0.0)
    tmp95 = tmp94 + tmp92
    tmp96 = 1.0
    tmp97 = tl.full(tmp96.shape, 0.0, tmp96.dtype)
    tmp98 = tl.where(tmp6, tmp96, tmp97)
    tmp99 = tl.where(tmp10, tmp96, tmp97)
    tmp100 = tmp99 + tmp98
    tmp101 = tl.where(tmp15, tmp96, tmp97)
    tmp102 = tmp101 + tmp100
    tmp103 = tl.where(tmp20, tmp96, tmp97)
    tmp104 = tmp103 + tmp102
    tmp105 = tl.where(tmp25, tmp96, tmp97)
    tmp106 = tmp105 + tmp104
    tmp107 = tl.where(tmp30, tmp96, tmp97)
    tmp108 = tmp107 + tmp106
    tmp109 = tl.where(tmp33, tmp96, tmp97)
    tmp110 = tmp109 + tmp108
    tmp111 = tl.where(tmp36, tmp96, tmp97)
    tmp112 = tmp111 + tmp110
    tmp113 = tl.where(tmp39, tmp96, tmp97)
    tmp114 = tmp113 + tmp112
    tmp115 = tl.where(tmp42, tmp96, tmp97)
    tmp116 = tmp115 + tmp114
    tmp117 = tl.where(tmp47, tmp96, tmp97)
    tmp118 = tmp117 + tmp116
    tmp119 = tl.where(tmp50, tmp96, tmp97)
    tmp120 = tmp119 + tmp118
    tmp121 = tl.where(tmp53, tmp96, tmp97)
    tmp122 = tmp121 + tmp120
    tmp123 = tl.where(tmp56, tmp96, tmp97)
    tmp124 = tmp123 + tmp122
    tmp125 = tl.where(tmp59, tmp96, tmp97)
    tmp126 = tmp125 + tmp124
    tmp127 = tl.where(tmp64, tmp96, tmp97)
    tmp128 = tmp127 + tmp126
    tmp129 = tl.where(tmp67, tmp96, tmp97)
    tmp130 = tmp129 + tmp128
    tmp131 = tl.where(tmp70, tmp96, tmp97)
    tmp132 = tmp131 + tmp130
    tmp133 = tl.where(tmp73, tmp96, tmp97)
    tmp134 = tmp133 + tmp132
    tmp135 = tl.where(tmp76, tmp96, tmp97)
    tmp136 = tmp135 + tmp134
    tmp137 = tl.where(tmp81, tmp96, tmp97)
    tmp138 = tmp137 + tmp136
    tmp139 = tl.where(tmp84, tmp96, tmp97)
    tmp140 = tmp139 + tmp138
    tmp141 = tl.where(tmp87, tmp96, tmp97)
    tmp142 = tmp141 + tmp140
    tmp143 = tl.where(tmp90, tmp96, tmp97)
    tmp144 = tmp143 + tmp142
    tmp145 = tl.where(tmp93, tmp96, tmp97)
    tmp146 = tmp145 + tmp144
    tmp147 = tmp95 / tmp146
    tl.store(out_ptr0 + (x4), tmp147, None)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/ca/cca6z2m76x4jktokjuqmjldaccaazcofevqls2xr7donpkzkgyem.py
# Topologically Sorted Source Nodes: [h_4], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   h_4 => cat
# Graph fragment:
#   %cat : [num_users=2] = call_function[target=torch.ops.aten.cat.default](args = ([%primals_6, %view], 1), kwargs = {})
triton_poi_fused_cat_3 = async_compile.triton('triton_poi_fused_cat_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=[65536], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '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, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, '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_cat_3(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 32784
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8196
    x1 = (xindex // 8196)
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + ((4*x1) + x0), tmp4 & xmask, eviction_policy='evict_last', other=0.0)
    tmp6 = tmp0 >= tmp3
    tmp7 = tl.full([1], 8196, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tl.load(in_ptr1 + ((8192*x1) + ((-4) + x0)), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp10 = tl.where(tmp4, tmp5, tmp9)
    tl.store(out_ptr0 + (x0 + (8224*x1)), tmp10, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/f5/cf5heh7zqsknyylzco35rgq44mmqhp6toyz3sjs7jglijm2qnp5p.py
# Topologically Sorted Source Nodes: [h_5], Original ATen: [aten.relu]
# Source node to ATen node mapping:
#   h_5 => relu_1
# Graph fragment:
#   %add_tensor_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mm_default_1, %primals_8), kwargs = {})
#   %relu_1 : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%add_tensor_1,), kwargs = {})
triton_poi_fused_relu_4 = async_compile.triton('triton_poi_fused_relu_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=[1024], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '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, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_relu_4', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, '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_4(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 256
    tmp0 = tl.load(in_out_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + (x2), tmp4, xmask)
''', 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 = args
    args.clear()
    assert_size_stride(primals_1, (64, 4, 3, 3), (36, 9, 3, 1))
    assert_size_stride(primals_2, (64, ), (1, ))
    assert_size_stride(primals_3, (4, 4, 64, 64), (16384, 4096, 64, 1))
    assert_size_stride(primals_4, (32, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_5, (32, ), (1, ))
    assert_size_stride(primals_6, (4, 4), (4, 1))
    assert_size_stride(primals_7, (256, 8196), (8196, 1))
    assert_size_stride(primals_8, (256, ), (1, ))
    assert_size_stride(primals_9, (256, 256), (256, 1))
    assert_size_stride(primals_10, (256, ), (1, ))
    assert_size_stride(primals_11, (1, 256), (256, 1))
    assert_size_stride(primals_12, (1, ), (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_3, primals_1, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 64, 62, 62), (246016, 3844, 62, 1))
        buf1 = buf0; del buf0  # reuse
        # Topologically Sorted Source Nodes: [conv2d, h], Original ATen: [aten.convolution, aten.relu]
        stream0 = get_raw_stream(0)
        triton_poi_fused_convolution_relu_0.run(buf1, primals_2, 984064, grid=grid(984064), stream=stream0)
        del primals_2
        # Topologically Sorted Source Nodes: [h_1], Original ATen: [aten.convolution]
        buf2 = extern_kernels.convolution(buf1, primals_4, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf2, (4, 32, 60, 60), (115200, 3600, 60, 1))
        buf3 = buf2; del buf2  # reuse
        # Topologically Sorted Source Nodes: [h_1], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_1.run(buf3, primals_5, 460800, grid=grid(460800), stream=stream0)
        del primals_5
        buf4 = empty_strided_cuda((4, 32, 16, 16), (8192, 256, 16, 1), torch.float32)
        # Topologically Sorted Source Nodes: [h_2], Original ATen: [aten._adaptive_avg_pool2d]
        triton_poi_fused__adaptive_avg_pool2d_2.run(buf3, buf4, 32768, grid=grid(32768), stream=stream0)
        buf5 = empty_strided_cuda((4, 8196), (8224, 1), torch.float32)
        # Topologically Sorted Source Nodes: [h_4], Original ATen: [aten.cat]
        triton_poi_fused_cat_3.run(primals_6, buf4, buf5, 32784, grid=grid(32784), stream=stream0)
        del buf4
        del primals_6
        buf6 = empty_strided_cuda((4, 256), (256, 1), torch.float32)
        # Topologically Sorted Source Nodes: [], Original ATen: []
        extern_kernels.mm(buf5, reinterpret_tensor(primals_7, (8196, 256), (1, 8196), 0), out=buf6)
        buf7 = buf6; del buf6  # reuse
        # Topologically Sorted Source Nodes: [h_5], Original ATen: [aten.relu]
        triton_poi_fused_relu_4.run(buf7, primals_8, 1024, grid=grid(1024), stream=stream0)
        del primals_8
        buf8 = empty_strided_cuda((4, 256), (256, 1), torch.float32)
        # Topologically Sorted Source Nodes: [], Original ATen: []
        extern_kernels.mm(buf7, reinterpret_tensor(primals_9, (256, 256), (1, 256), 0), out=buf8)
        buf9 = buf8; del buf8  # reuse
        # Topologically Sorted Source Nodes: [h_6], Original ATen: [aten.relu]
        triton_poi_fused_relu_4.run(buf9, primals_10, 1024, grid=grid(1024), stream=stream0)
        del primals_10
        buf11 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        # Topologically Sorted Source Nodes: [linear_2], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_12, buf9, reinterpret_tensor(primals_11, (256, 1), (1, 256), 0), alpha=1, beta=1, out=buf11)
        del primals_12
    return (buf11, primals_1, primals_3, primals_4, buf1, buf3, buf5, buf7, buf9, primals_11, primals_9, primals_7, )


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((64, 4, 3, 3), (36, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((64, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 4, 64, 64), (16384, 4096, 64, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((32, 64, 3, 3), (576, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((32, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((256, 8196), (8196, 1), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((256, 256), (256, 1), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((1, 256), (256, 1), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((1, ), (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])
    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
import torch.optim


class GlobalDiscriminator(nn.Module):

    def __init__(self, y_size, M_channels):
        super().__init__()
        self.c0 = nn.Conv2d(M_channels, 64, kernel_size=3)
        self.c1 = nn.Conv2d(64, 32, kernel_size=3)
        self.avgpool = nn.AdaptiveAvgPool2d(16)
        self.l0 = nn.Linear(32 * 16 * 16 + y_size, 256)
        self.l1 = nn.Linear(256, 256)
        self.l2 = nn.Linear(256, 1)

    def forward(self, y, M):
        h = F.relu(self.c0(M))
        h = self.c1(h)
        h = self.avgpool(h)
        h = h.view(M.shape[0], -1)
        h = torch.cat((y, h), dim=1)
        h = F.relu(self.l0(h))
        h = F.relu(self.l1(h))
        return self.l2(h)


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


def get_init_inputs():
    return [[], {'y_size': 4, 'M_channels': 4}]

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
import torch.optim
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_poi_fused_convolution_relu_0(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 984064
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = xindex // 3844 % 64
    tmp0 = tl.load(in_out_ptr0 + x3, xmask)
    tmp1 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + x3, tmp4, xmask)


@triton.jit
def triton_poi_fused_convolution_1(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)
    x3 = xindex
    x1 = xindex // 3600 % 32
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x3, tmp2, None)


@triton.jit
def triton_poi_fused__adaptive_avg_pool2d_2(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)
    x1 = xindex // 16 % 16
    x0 = xindex % 16
    x2 = xindex // 256
    x4 = xindex
    tmp0 = 15 * x1 // 4
    tmp1 = (75 + 60 * x1) // 16
    tmp2 = tmp0 < tmp1
    tmp3 = 15 * x0 // 4
    tmp4 = (75 + 60 * x0) // 16
    tmp5 = tmp3 < tmp4
    tmp6 = tmp2 & tmp5
    tmp7 = tl.load(in_ptr0 + (60 * (15 * x1 // 4) + 3600 * x2 + 15 * x0 // 
        4), tmp6, eviction_policy='evict_last', other=0.0)
    tmp8 = 1 + 15 * x0 // 4
    tmp9 = tmp8 < tmp4
    tmp10 = tmp2 & tmp9
    tmp11 = tl.load(in_ptr0 + (1 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp10, eviction_policy='evict_last', other=0.0)
    tmp12 = tmp11 + tmp7
    tmp13 = 2 + 15 * x0 // 4
    tmp14 = tmp13 < tmp4
    tmp15 = tmp2 & tmp14
    tmp16 = tl.load(in_ptr0 + (2 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp15, eviction_policy='evict_last', other=0.0)
    tmp17 = tmp16 + tmp12
    tmp18 = 3 + 15 * x0 // 4
    tmp19 = tmp18 < tmp4
    tmp20 = tmp2 & tmp19
    tmp21 = tl.load(in_ptr0 + (3 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp20, eviction_policy='evict_last', other=0.0)
    tmp22 = tmp21 + tmp17
    tmp23 = 4 + 15 * x0 // 4
    tmp24 = tmp23 < tmp4
    tmp25 = tmp2 & tmp24
    tmp26 = tl.load(in_ptr0 + (4 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp25, eviction_policy='evict_last', other=0.0)
    tmp27 = tmp26 + tmp22
    tmp28 = 1 + 15 * x1 // 4
    tmp29 = tmp28 < tmp1
    tmp30 = tmp29 & tmp5
    tmp31 = tl.load(in_ptr0 + (60 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp30, eviction_policy='evict_last', other=0.0)
    tmp32 = tmp31 + tmp27
    tmp33 = tmp29 & tmp9
    tmp34 = tl.load(in_ptr0 + (61 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp33, eviction_policy='evict_last', other=0.0)
    tmp35 = tmp34 + tmp32
    tmp36 = tmp29 & tmp14
    tmp37 = tl.load(in_ptr0 + (62 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp36, eviction_policy='evict_last', other=0.0)
    tmp38 = tmp37 + tmp35
    tmp39 = tmp29 & tmp19
    tmp40 = tl.load(in_ptr0 + (63 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp39, eviction_policy='evict_last', other=0.0)
    tmp41 = tmp40 + tmp38
    tmp42 = tmp29 & tmp24
    tmp43 = tl.load(in_ptr0 + (64 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp42, eviction_policy='evict_last', other=0.0)
    tmp44 = tmp43 + tmp41
    tmp45 = 2 + 15 * x1 // 4
    tmp46 = tmp45 < tmp1
    tmp47 = tmp46 & tmp5
    tmp48 = tl.load(in_ptr0 + (120 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp47, eviction_policy='evict_last', other=0.0)
    tmp49 = tmp48 + tmp44
    tmp50 = tmp46 & tmp9
    tmp51 = tl.load(in_ptr0 + (121 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp50, eviction_policy='evict_last', other=0.0)
    tmp52 = tmp51 + tmp49
    tmp53 = tmp46 & tmp14
    tmp54 = tl.load(in_ptr0 + (122 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp53, eviction_policy='evict_last', other=0.0)
    tmp55 = tmp54 + tmp52
    tmp56 = tmp46 & tmp19
    tmp57 = tl.load(in_ptr0 + (123 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp56, eviction_policy='evict_last', other=0.0)
    tmp58 = tmp57 + tmp55
    tmp59 = tmp46 & tmp24
    tmp60 = tl.load(in_ptr0 + (124 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp59, eviction_policy='evict_last', other=0.0)
    tmp61 = tmp60 + tmp58
    tmp62 = 3 + 15 * x1 // 4
    tmp63 = tmp62 < tmp1
    tmp64 = tmp63 & tmp5
    tmp65 = tl.load(in_ptr0 + (180 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp64, eviction_policy='evict_last', other=0.0)
    tmp66 = tmp65 + tmp61
    tmp67 = tmp63 & tmp9
    tmp68 = tl.load(in_ptr0 + (181 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp67, eviction_policy='evict_last', other=0.0)
    tmp69 = tmp68 + tmp66
    tmp70 = tmp63 & tmp14
    tmp71 = tl.load(in_ptr0 + (182 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp70, eviction_policy='evict_last', other=0.0)
    tmp72 = tmp71 + tmp69
    tmp73 = tmp63 & tmp19
    tmp74 = tl.load(in_ptr0 + (183 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp73, eviction_policy='evict_last', other=0.0)
    tmp75 = tmp74 + tmp72
    tmp76 = tmp63 & tmp24
    tmp77 = tl.load(in_ptr0 + (184 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp76, eviction_policy='evict_last', other=0.0)
    tmp78 = tmp77 + tmp75
    tmp79 = 4 + 15 * x1 // 4
    tmp80 = tmp79 < tmp1
    tmp81 = tmp80 & tmp5
    tmp82 = tl.load(in_ptr0 + (240 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp81, eviction_policy='evict_last', other=0.0)
    tmp83 = tmp82 + tmp78
    tmp84 = tmp80 & tmp9
    tmp85 = tl.load(in_ptr0 + (241 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp84, eviction_policy='evict_last', other=0.0)
    tmp86 = tmp85 + tmp83
    tmp87 = tmp80 & tmp14
    tmp88 = tl.load(in_ptr0 + (242 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp87, eviction_policy='evict_last', other=0.0)
    tmp89 = tmp88 + tmp86
    tmp90 = tmp80 & tmp19
    tmp91 = tl.load(in_ptr0 + (243 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp90, eviction_policy='evict_last', other=0.0)
    tmp92 = tmp91 + tmp89
    tmp93 = tmp80 & tmp24
    tmp94 = tl.load(in_ptr0 + (244 + 60 * (15 * x1 // 4) + 3600 * x2 + 15 *
        x0 // 4), tmp93, eviction_policy='evict_last', other=0.0)
    tmp95 = tmp94 + tmp92
    tmp96 = 1.0
    tmp97 = tl.full(tmp96.shape, 0.0, tmp96.dtype)
    tmp98 = tl.where(tmp6, tmp96, tmp97)
    tmp99 = tl.where(tmp10, tmp96, tmp97)
    tmp100 = tmp99 + tmp98
    tmp101 = tl.where(tmp15, tmp96, tmp97)
    tmp102 = tmp101 + tmp100
    tmp103 = tl.where(tmp20, tmp96, tmp97)
    tmp104 = tmp103 + tmp102
    tmp105 = tl.where(tmp25, tmp96, tmp97)
    tmp106 = tmp105 + tmp104
    tmp107 = tl.where(tmp30, tmp96, tmp97)
    tmp108 = tmp107 + tmp106
    tmp109 = tl.where(tmp33, tmp96, tmp97)
    tmp110 = tmp109 + tmp108
    tmp111 = tl.where(tmp36, tmp96, tmp97)
    tmp112 = tmp111 + tmp110
    tmp113 = tl.where(tmp39, tmp96, tmp97)
    tmp114 = tmp113 + tmp112
    tmp115 = tl.where(tmp42, tmp96, tmp97)
    tmp116 = tmp115 + tmp114
    tmp117 = tl.where(tmp47, tmp96, tmp97)
    tmp118 = tmp117 + tmp116
    tmp119 = tl.where(tmp50, tmp96, tmp97)
    tmp120 = tmp119 + tmp118
    tmp121 = tl.where(tmp53, tmp96, tmp97)
    tmp122 = tmp121 + tmp120
    tmp123 = tl.where(tmp56, tmp96, tmp97)
    tmp124 = tmp123 + tmp122
    tmp125 = tl.where(tmp59, tmp96, tmp97)
    tmp126 = tmp125 + tmp124
    tmp127 = tl.where(tmp64, tmp96, tmp97)
    tmp128 = tmp127 + tmp126
    tmp129 = tl.where(tmp67, tmp96, tmp97)
    tmp130 = tmp129 + tmp128
    tmp131 = tl.where(tmp70, tmp96, tmp97)
    tmp132 = tmp131 + tmp130
    tmp133 = tl.where(tmp73, tmp96, tmp97)
    tmp134 = tmp133 + tmp132
    tmp135 = tl.where(tmp76, tmp96, tmp97)
    tmp136 = tmp135 + tmp134
    tmp137 = tl.where(tmp81, tmp96, tmp97)
    tmp138 = tmp137 + tmp136
    tmp139 = tl.where(tmp84, tmp96, tmp97)
    tmp140 = tmp139 + tmp138
    tmp141 = tl.where(tmp87, tmp96, tmp97)
    tmp142 = tmp141 + tmp140
    tmp143 = tl.where(tmp90, tmp96, tmp97)
    tmp144 = tmp143 + tmp142
    tmp145 = tl.where(tmp93, tmp96, tmp97)
    tmp146 = tmp145 + tmp144
    tmp147 = tmp95 / tmp146
    tl.store(out_ptr0 + x4, tmp147, None)


@triton.jit
def triton_poi_fused_cat_3(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 32784
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8196
    x1 = xindex // 8196
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (4 * x1 + x0), tmp4 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp6 = tmp0 >= tmp3
    tl.full([1], 8196, tl.int64)
    tmp9 = tl.load(in_ptr1 + (8192 * x1 + (-4 + x0)), tmp6 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp10 = tl.where(tmp4, tmp5, tmp9)
    tl.store(out_ptr0 + (x0 + 8224 * x1), tmp10, xmask)


@triton.jit
def triton_poi_fused_relu_4(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl.constexpr
    ):
    xnumel = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 256
    tmp0 = tl.load(in_out_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + x2, tmp4, xmask)


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
        ) = args
    args.clear()
    assert_size_stride(primals_1, (64, 4, 3, 3), (36, 9, 3, 1))
    assert_size_stride(primals_2, (64,), (1,))
    assert_size_stride(primals_3, (4, 4, 64, 64), (16384, 4096, 64, 1))
    assert_size_stride(primals_4, (32, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_5, (32,), (1,))
    assert_size_stride(primals_6, (4, 4), (4, 1))
    assert_size_stride(primals_7, (256, 8196), (8196, 1))
    assert_size_stride(primals_8, (256,), (1,))
    assert_size_stride(primals_9, (256, 256), (256, 1))
    assert_size_stride(primals_10, (256,), (1,))
    assert_size_stride(primals_11, (1, 256), (256, 1))
    assert_size_stride(primals_12, (1,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_3, primals_1, stride=(1, 
            1), padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 64, 62, 62), (246016, 3844, 62, 1))
        buf1 = buf0
        del buf0
        get_raw_stream(0)
        triton_poi_fused_convolution_relu_0[grid(984064)](buf1, primals_2, 
            984064, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_2
        buf2 = extern_kernels.convolution(buf1, primals_4, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf2, (4, 32, 60, 60), (115200, 3600, 60, 1))
        buf3 = buf2
        del buf2
        triton_poi_fused_convolution_1[grid(460800)](buf3, primals_5, 
            460800, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_5
        buf4 = empty_strided_cuda((4, 32, 16, 16), (8192, 256, 16, 1),
            torch.float32)
        triton_poi_fused__adaptive_avg_pool2d_2[grid(32768)](buf3, buf4, 
            32768, XBLOCK=128, num_warps=4, num_stages=1)
        buf5 = empty_strided_cuda((4, 8196), (8224, 1), torch.float32)
        triton_poi_fused_cat_3[grid(32784)](primals_6, buf4, buf5, 32784,
            XBLOCK=256, num_warps=4, num_stages=1)
        del buf4
        del primals_6
        buf6 = empty_strided_cuda((4, 256), (256, 1), torch.float32)
        extern_kernels.mm(buf5, reinterpret_tensor(primals_7, (8196, 256),
            (1, 8196), 0), out=buf6)
        buf7 = buf6
        del buf6
        triton_poi_fused_relu_4[grid(1024)](buf7, primals_8, 1024, XBLOCK=
            256, num_warps=4, num_stages=1)
        del primals_8
        buf8 = empty_strided_cuda((4, 256), (256, 1), torch.float32)
        extern_kernels.mm(buf7, reinterpret_tensor(primals_9, (256, 256), (
            1, 256), 0), out=buf8)
        buf9 = buf8
        del buf8
        triton_poi_fused_relu_4[grid(1024)](buf9, primals_10, 1024, XBLOCK=
            256, num_warps=4, num_stages=1)
        del primals_10
        buf11 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.addmm(primals_12, buf9, reinterpret_tensor(
            primals_11, (256, 1), (1, 256), 0), alpha=1, beta=1, out=buf11)
        del primals_12
    return (buf11, primals_1, primals_3, primals_4, buf1, buf3, buf5, buf7,
        buf9, primals_11, primals_9, primals_7)


class GlobalDiscriminatorNew(nn.Module):

    def __init__(self, y_size, M_channels):
        super().__init__()
        self.c0 = nn.Conv2d(M_channels, 64, kernel_size=3)
        self.c1 = nn.Conv2d(64, 32, kernel_size=3)
        self.avgpool = nn.AdaptiveAvgPool2d(16)
        self.l0 = nn.Linear(32 * 16 * 16 + y_size, 256)
        self.l1 = nn.Linear(256, 256)
        self.l2 = nn.Linear(256, 1)

    def forward(self, input_0, input_1):
        primals_1 = self.c0.weight
        primals_2 = self.c0.bias
        primals_4 = self.c1.weight
        primals_5 = self.c1.bias
        primals_7 = self.l0.weight
        primals_8 = self.l0.bias
        primals_9 = self.l1.weight
        primals_10 = self.l1.bias
        primals_11 = self.l2.weight
        primals_12 = self.l2.bias
        primals_6 = input_0
        primals_3 = input_1
        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])
        return output[0]
