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

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


# kernel path: runs/run_shard_4/inductor_cache/nn/cnn2xob7rn3fx6qxfv2bhg4jsupl7tzhvinbqywlxmtzieg5auh3.py
# Topologically Sorted Source Nodes: [getitem], Original ATen: [aten.index]
# Source node to ATen node mapping:
#   getitem => index
# Graph fragment:
#   %index : [num_users=3] = call_function[target=torch.ops.aten.index.Tensor](args = (%primals_1, [None, %full_default]), kwargs = {})
triton_poi_fused_index_0 = async_compile.triton('triton_poi_fused_index_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], 
    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_index_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_index_0(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 16
    x1 = (xindex // 16)
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (64*x1)), xmask)
    tl.store(out_ptr0 + (x2), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/yt/cyt7p7f4dlczykxg27so55ce4rw5jnval5ey4qhjrhky64jgdpqr.py
# Topologically Sorted Source Nodes: [conv2d, output], Original ATen: [aten.convolution, aten.relu]
# Source node to ATen node mapping:
#   conv2d => convolution
#   output => relu
# Graph fragment:
#   %convolution : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%index, %primals_2, %primals_3, [2, 2], [2, 2], [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_1 = async_compile.triton('triton_poi_fused_convolution_relu_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=[256], 
    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_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_relu_1(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 160
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 4) % 10
    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_4/inductor_cache/7q/c7qfog52ki6nxnbdejvrpfr2osgoaqkeut4gkxjvfzlmqmymffht.py
# Topologically Sorted Source Nodes: [conv2d_1, output_1], Original ATen: [aten.convolution, aten.relu]
# Source node to ATen node mapping:
#   conv2d_1 => convolution_1
#   output_1 => relu_1
# Graph fragment:
#   %convolution_1 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%relu, %primals_4, %primals_5, [2, 2], [2, 2], [1, 1], False, [0, 0], 1), kwargs = {})
#   %relu_1 : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%convolution_1,), kwargs = {})
triton_poi_fused_convolution_relu_2 = async_compile.triton('triton_poi_fused_convolution_relu_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=[64], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_relu_2', '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_2(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 40
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 10
    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')


# kernel path: runs/run_shard_4/inductor_cache/to/cto7jphpwb3liixmweivn3bu3rayxtlm4rku76zhbas4zeh4shu3.py
# Topologically Sorted Source Nodes: [interpolate], Original ATen: [aten.arange, aten.add, aten.mul, aten._to_copy]
# Source node to ATen node mapping:
#   interpolate => add, add_1, convert_element_type, convert_element_type_1, iota, mul, mul_1
# Graph fragment:
#   %iota : [num_users=1] = call_function[target=torch.ops.prims.iota.default](args = (4,), kwargs = {start: 0, step: 1, dtype: torch.int64, device: cuda:0, requires_grad: False})
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%iota, 1), kwargs = {})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, 0), kwargs = {})
#   %convert_element_type : [num_users=1] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%add, torch.float32), kwargs = {})
#   %add_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%convert_element_type, 0.0), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%add_1, 0.25), kwargs = {})
#   %convert_element_type_1 : [num_users=4] = call_function[target=torch.ops.prims.convert_element_type.default](args = (%mul_1, torch.int64), kwargs = {})
triton_poi_fused__to_copy_add_arange_mul_3 = async_compile.triton('triton_poi_fused__to_copy_add_arange_mul_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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*i64', 1: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0,), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__to_copy_add_arange_mul_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 0, '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__to_copy_add_arange_mul_3(out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.25
    tmp3 = tmp1 * tmp2
    tmp4 = tmp3.to(tl.int32)
    tl.store(out_ptr0 + (x0), tmp4, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/6t/c6tl5uzryqoxj2kgigy3jdrfml3hupgqtrnoaykev2o5qoqkqnd2.py
# Topologically Sorted Source Nodes: [getitem_1], Original ATen: [aten.index]
# Source node to ATen node mapping:
#   getitem_1 => index_1
# Graph fragment:
#   %index_1 : [num_users=3] = call_function[target=torch.ops.aten.index.Tensor](args = (%primals_1, [None, %full_default_1]), kwargs = {})
triton_poi_fused_index_4 = async_compile.triton('triton_poi_fused_index_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=[64], 
    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_index_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_index_4(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 16
    x1 = (xindex // 16)
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (16 + x0 + (64*x1)), xmask)
    tl.store(out_ptr0 + (x2), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/c2/cc2ovgc24vv5pkrhdyfonwhyasfgzhcylaowud3yw6avucbayxm6.py
# Topologically Sorted Source Nodes: [output_3, interpolate, output1, output_7, interpolate_1, output2, output3, output4, mul, mul_1, mul_2], Original ATen: [aten.convolution, aten._unsafe_index, aten.sigmoid, aten.mul]
# Source node to ATen node mapping:
#   interpolate => _unsafe_index
#   interpolate_1 => _unsafe_index_1
#   mul => mul_8
#   mul_1 => mul_9
#   mul_2 => mul_10
#   output1 => sigmoid
#   output2 => sigmoid_1
#   output3 => sigmoid_2
#   output4 => sigmoid_3
#   output_3 => convolution_3
#   output_7 => convolution_7
# Graph fragment:
#   %convolution_3 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%relu_2, %primals_8, %primals_9, [1, 1], [2, 2], [1, 1], False, [0, 0], 1), kwargs = {})
#   %_unsafe_index : [num_users=2] = call_function[target=torch.ops.aten._unsafe_index.Tensor](args = (%convolution_3, [None, None, %unsqueeze, %convert_element_type_1]), kwargs = {})
#   %sigmoid : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%_unsafe_index,), kwargs = {})
#   %convolution_7 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%relu_5, %primals_16, %primals_17, [1, 1], [2, 2], [1, 1], False, [0, 0], 1), kwargs = {})
#   %_unsafe_index_1 : [num_users=2] = call_function[target=torch.ops.aten._unsafe_index.Tensor](args = (%convolution_7, [None, None, %unsqueeze, %convert_element_type_1]), kwargs = {})
#   %sigmoid_1 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%_unsafe_index_1,), kwargs = {})
#   %sigmoid_2 : [num_users=2] = call_function[target=torch.ops.aten.sigmoid.default](args = (%index,), kwargs = {})
#   %sigmoid_3 : [num_users=2] = call_function[target=torch.ops.aten.sigmoid.default](args = (%index_1,), kwargs = {})
#   %mul_8 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sigmoid, %sigmoid_1), kwargs = {})
#   %mul_9 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_8, %sigmoid_2), kwargs = {})
#   %mul_10 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_9, %sigmoid_3), kwargs = {})
triton_poi_fused__unsafe_index_convolution_mul_sigmoid_5 = async_compile.triton('triton_poi_fused__unsafe_index_convolution_mul_sigmoid_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*i64', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: '*fp32', 10: '*fp32', 11: '*fp32', 12: '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, 4, 5, 6, 7, 8, 9, 10, 11, 12), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__unsafe_index_convolution_mul_sigmoid_5', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 8, '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__unsafe_index_convolution_mul_sigmoid_5(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 4) % 4
    x0 = xindex % 4
    x2 = (xindex // 16)
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (x2), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + (0))
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK])
    tmp13 = tl.load(in_ptr3 + (x2), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + (0))
    tmp15 = tl.broadcast_to(tmp14, [XBLOCK])
    tmp17 = tl.load(in_ptr5 + (x3), xmask)
    tmp19 = tl.load(in_ptr6 + (x3), xmask)
    tmp1 = tl.full([XBLOCK], 1, tl.int32)
    tmp2 = tmp0 + tmp1
    tmp3 = tmp0 < 0
    tmp4 = tl.where(tmp3, tmp2, tmp0)
    tmp6 = tmp5 + tmp1
    tmp7 = tmp5 < 0
    tmp8 = tl.where(tmp7, tmp6, tmp5)
    tmp12 = tmp9 + tmp11
    tmp16 = tmp13 + tmp15
    tmp18 = tl.sigmoid(tmp17)
    tmp20 = tl.sigmoid(tmp19)
    tmp21 = tl.sigmoid(tmp12)
    tmp22 = tl.sigmoid(tmp16)
    tmp23 = tmp21 * tmp22
    tmp24 = tmp23 * tmp18
    tmp25 = tmp24 * tmp20
    tl.store(out_ptr0 + (x3), tmp12, xmask)
    tl.store(out_ptr1 + (x3), tmp16, xmask)
    tl.store(out_ptr2 + (x3), tmp18, xmask)
    tl.store(out_ptr3 + (x3), tmp20, xmask)
    tl.store(out_ptr4 + (x3), tmp25, 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, primals_13, primals_14, primals_15, primals_16, primals_17 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(primals_2, (10, 1, 5, 5), (25, 25, 5, 1))
    assert_size_stride(primals_3, (10, ), (1, ))
    assert_size_stride(primals_4, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_5, (10, ), (1, ))
    assert_size_stride(primals_6, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_7, (10, ), (1, ))
    assert_size_stride(primals_8, (1, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_9, (1, ), (1, ))
    assert_size_stride(primals_10, (10, 1, 5, 5), (25, 25, 5, 1))
    assert_size_stride(primals_11, (10, ), (1, ))
    assert_size_stride(primals_12, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_13, (10, ), (1, ))
    assert_size_stride(primals_14, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_15, (10, ), (1, ))
    assert_size_stride(primals_16, (1, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_17, (1, ), (1, ))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [getitem], Original ATen: [aten.index]
        stream0 = get_raw_stream(0)
        triton_poi_fused_index_0.run(primals_1, buf0, 64, grid=grid(64), stream=stream0)
        # Topologically Sorted Source Nodes: [conv2d], Original ATen: [aten.convolution]
        buf1 = extern_kernels.convolution(buf0, primals_2, stride=(2, 2), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf1, (4, 10, 2, 2), (40, 4, 2, 1))
        buf2 = buf1; del buf1  # reuse
        # Topologically Sorted Source Nodes: [conv2d, output], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_1.run(buf2, primals_3, 160, grid=grid(160), stream=stream0)
        del primals_3
        # Topologically Sorted Source Nodes: [conv2d_1], Original ATen: [aten.convolution]
        buf3 = extern_kernels.convolution(buf2, primals_4, stride=(2, 2), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 10, 1, 1), (10, 1, 1, 1))
        buf4 = buf3; del buf3  # reuse
        # Topologically Sorted Source Nodes: [conv2d_1, output_1], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_2.run(buf4, primals_5, 40, grid=grid(40), stream=stream0)
        del primals_5
        # Topologically Sorted Source Nodes: [conv2d_2], Original ATen: [aten.convolution]
        buf5 = extern_kernels.convolution(buf4, primals_6, stride=(2, 2), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf5, (4, 10, 1, 1), (10, 1, 1, 1))
        buf6 = buf5; del buf5  # reuse
        # Topologically Sorted Source Nodes: [conv2d_2, output_2], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_2.run(buf6, primals_7, 40, grid=grid(40), stream=stream0)
        del primals_7
        # Topologically Sorted Source Nodes: [output_3], Original ATen: [aten.convolution]
        buf7 = extern_kernels.convolution(buf6, primals_8, stride=(1, 1), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf7, (4, 1, 1, 1), (1, 1, 1, 1))
        buf8 = empty_strided_cuda((4, ), (1, ), torch.int64)
        # Topologically Sorted Source Nodes: [interpolate], Original ATen: [aten.arange, aten.add, aten.mul, aten._to_copy]
        triton_poi_fused__to_copy_add_arange_mul_3.run(buf8, 4, grid=grid(4), stream=stream0)
        buf10 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [getitem_1], Original ATen: [aten.index]
        triton_poi_fused_index_4.run(primals_1, buf10, 64, grid=grid(64), stream=stream0)
        del primals_1
        # Topologically Sorted Source Nodes: [conv2d_4], Original ATen: [aten.convolution]
        buf11 = extern_kernels.convolution(buf10, primals_10, stride=(2, 2), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf11, (4, 10, 2, 2), (40, 4, 2, 1))
        buf12 = buf11; del buf11  # reuse
        # Topologically Sorted Source Nodes: [conv2d_4, output_4], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_1.run(buf12, primals_11, 160, grid=grid(160), stream=stream0)
        del primals_11
        # Topologically Sorted Source Nodes: [conv2d_5], Original ATen: [aten.convolution]
        buf13 = extern_kernels.convolution(buf12, primals_12, stride=(2, 2), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf13, (4, 10, 1, 1), (10, 1, 1, 1))
        buf14 = buf13; del buf13  # reuse
        # Topologically Sorted Source Nodes: [conv2d_5, output_5], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_2.run(buf14, primals_13, 40, grid=grid(40), stream=stream0)
        del primals_13
        # Topologically Sorted Source Nodes: [conv2d_6], Original ATen: [aten.convolution]
        buf15 = extern_kernels.convolution(buf14, primals_14, stride=(2, 2), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf15, (4, 10, 1, 1), (10, 1, 1, 1))
        buf16 = buf15; del buf15  # reuse
        # Topologically Sorted Source Nodes: [conv2d_6, output_6], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_2.run(buf16, primals_15, 40, grid=grid(40), stream=stream0)
        del primals_15
        # Topologically Sorted Source Nodes: [output_7], Original ATen: [aten.convolution]
        buf17 = extern_kernels.convolution(buf16, primals_16, stride=(1, 1), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 1, 1, 1), (1, 1, 1, 1))
        buf9 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf18 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf19 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf20 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf21 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [output_3, interpolate, output1, output_7, interpolate_1, output2, output3, output4, mul, mul_1, mul_2], Original ATen: [aten.convolution, aten._unsafe_index, aten.sigmoid, aten.mul]
        triton_poi_fused__unsafe_index_convolution_mul_sigmoid_5.run(buf8, buf7, primals_9, buf17, primals_17, buf0, buf10, buf9, buf18, buf19, buf20, buf21, 64, grid=grid(64), stream=stream0)
        del buf17
        del buf7
        del primals_17
        del primals_9
    return (buf21, primals_2, primals_4, primals_6, primals_8, primals_10, primals_12, primals_14, primals_16, buf0, buf2, buf4, buf6, buf8, buf9, buf10, buf12, buf14, buf16, buf18, buf19, buf20, )


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((4, 4, 4, 4), (64, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((10, 1, 5, 5), (25, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((10, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((10, 10, 5, 5), (250, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((10, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((10, 10, 5, 5), (250, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((10, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((1, 10, 5, 5), (250, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((1, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((10, 1, 5, 5), (25, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((10, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((10, 10, 5, 5), (250, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((10, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((10, 10, 5, 5), (250, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((10, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_16 = rand_strided((1, 10, 5, 5), (250, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_17 = 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, 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.utils.data
import torch.nn.functional as F


class FociDetector(nn.Module):

    def __init__(self, input_channels=3, input_size=17, ksize=5,
        hidden_channels=10):
        super(FociDetector, self).__init__()
        self.conv1 = nn.Conv2d(input_channels, hidden_channels, ksize,
            stride=2, padding=int((ksize - 1) / 2))
        self.conv2 = nn.Conv2d(hidden_channels, hidden_channels, ksize,
            stride=2, padding=int((ksize - 1) / 2))
        self.conv3 = nn.Conv2d(hidden_channels, hidden_channels, ksize,
            stride=2, padding=int((ksize - 1) / 2))
        self.finalmapsize = ksize
        self.convf = nn.Conv2d(hidden_channels, 1, self.finalmapsize,
            padding=int((ksize - 1) / 2))
        self.relu = nn.ReLU()

    def forward(self, x):
        output = self.relu(self.conv1(x))
        output = self.relu(self.conv2(output))
        output = self.relu(self.conv3(output))
        output = self.convf(output)
        return output


class MultiChannelCombinedScorer(nn.Module):

    def __init__(self, input_size=17, ksize=5, hidden_channels=10):
        super(MultiChannelCombinedScorer, self).__init__()
        self.channel1 = FociDetector(input_channels=1, input_size=
            input_size, ksize=ksize, hidden_channels=hidden_channels)
        self.channel2 = FociDetector(input_channels=1, input_size=
            input_size, ksize=ksize, hidden_channels=hidden_channels)

    def forward(self, x):
        output1 = torch.sigmoid(F.interpolate(self.channel1(x[:, [0], :, :]
            ), size=(x.shape[2], x.shape[3])))
        output2 = torch.sigmoid(F.interpolate(self.channel2(x[:, [1], :, :]
            ), size=(x.shape[2], x.shape[3])))
        output3 = torch.sigmoid(x[:, [0], :, :])
        output4 = torch.sigmoid(x[:, [1], :, :])
        return output1 * output2 * output3 * output4

    def forward_vis(self, x):
        output1 = torch.sigmoid(F.interpolate(self.channel1(x[:, [0], :, :]
            ), size=(x.shape[2], x.shape[3])))
        output2 = torch.sigmoid(F.interpolate(self.channel2(x[:, [1], :, :]
            ), size=(x.shape[2], x.shape[3])))
        output3 = torch.sigmoid(x[:, [0], :, :])
        output4 = torch.sigmoid(x[:, [1], :, :])
        return output1, output2, output3, output4


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


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

import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.utils.data
import torch.nn.functional as F
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_index_0(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 16
    x1 = xindex // 16
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 64 * x1), xmask)
    tl.store(out_ptr0 + x2, tmp0, xmask)


@triton.jit
def triton_poi_fused_convolution_relu_1(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 160
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = xindex // 4 % 10
    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_relu_2(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 40
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 10
    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)


@triton.jit
def triton_poi_fused__to_copy_add_arange_mul_3(out_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.25
    tmp3 = tmp1 * tmp2
    tmp4 = tmp3.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_poi_fused_index_4(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 16
    x1 = xindex // 16
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (16 + x0 + 64 * x1), xmask)
    tl.store(out_ptr0 + x2, tmp0, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_convolution_mul_sigmoid_5(in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, out_ptr0,
    out_ptr1, out_ptr2, out_ptr3, out_ptr4, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 4
    x0 = xindex % 4
    x2 = xindex // 16
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x2, xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + 0)
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK])
    tmp13 = tl.load(in_ptr3 + x2, xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + 0)
    tmp15 = tl.broadcast_to(tmp14, [XBLOCK])
    tmp17 = tl.load(in_ptr5 + x3, xmask)
    tmp19 = tl.load(in_ptr6 + x3, xmask)
    tmp1 = tl.full([XBLOCK], 1, tl.int32)
    tmp2 = tmp0 + tmp1
    tmp3 = tmp0 < 0
    tl.where(tmp3, tmp2, tmp0)
    tmp6 = tmp5 + tmp1
    tmp7 = tmp5 < 0
    tl.where(tmp7, tmp6, tmp5)
    tmp12 = tmp9 + tmp11
    tmp16 = tmp13 + tmp15
    tmp18 = tl.sigmoid(tmp17)
    tmp20 = tl.sigmoid(tmp19)
    tmp21 = tl.sigmoid(tmp12)
    tmp22 = tl.sigmoid(tmp16)
    tmp23 = tmp21 * tmp22
    tmp24 = tmp23 * tmp18
    tmp25 = tmp24 * tmp20
    tl.store(out_ptr0 + x3, tmp12, xmask)
    tl.store(out_ptr1 + x3, tmp16, xmask)
    tl.store(out_ptr2 + x3, tmp18, xmask)
    tl.store(out_ptr3 + x3, tmp20, xmask)
    tl.store(out_ptr4 + x3, tmp25, 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,
        primals_13, primals_14, primals_15, primals_16, primals_17) = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(primals_2, (10, 1, 5, 5), (25, 25, 5, 1))
    assert_size_stride(primals_3, (10,), (1,))
    assert_size_stride(primals_4, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_5, (10,), (1,))
    assert_size_stride(primals_6, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_7, (10,), (1,))
    assert_size_stride(primals_8, (1, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_9, (1,), (1,))
    assert_size_stride(primals_10, (10, 1, 5, 5), (25, 25, 5, 1))
    assert_size_stride(primals_11, (10,), (1,))
    assert_size_stride(primals_12, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_13, (10,), (1,))
    assert_size_stride(primals_14, (10, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_15, (10,), (1,))
    assert_size_stride(primals_16, (1, 10, 5, 5), (250, 25, 5, 1))
    assert_size_stride(primals_17, (1,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_index_0[grid(64)](primals_1, buf0, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf1 = extern_kernels.convolution(buf0, primals_2, stride=(2, 2),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf1, (4, 10, 2, 2), (40, 4, 2, 1))
        buf2 = buf1
        del buf1
        triton_poi_fused_convolution_relu_1[grid(160)](buf2, primals_3, 160,
            XBLOCK=128, num_warps=4, num_stages=1)
        del primals_3
        buf3 = extern_kernels.convolution(buf2, primals_4, stride=(2, 2),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 10, 1, 1), (10, 1, 1, 1))
        buf4 = buf3
        del buf3
        triton_poi_fused_convolution_relu_2[grid(40)](buf4, primals_5, 40,
            XBLOCK=64, num_warps=1, num_stages=1)
        del primals_5
        buf5 = extern_kernels.convolution(buf4, primals_6, stride=(2, 2),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf5, (4, 10, 1, 1), (10, 1, 1, 1))
        buf6 = buf5
        del buf5
        triton_poi_fused_convolution_relu_2[grid(40)](buf6, primals_7, 40,
            XBLOCK=64, num_warps=1, num_stages=1)
        del primals_7
        buf7 = extern_kernels.convolution(buf6, primals_8, stride=(1, 1),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf7, (4, 1, 1, 1), (1, 1, 1, 1))
        buf8 = empty_strided_cuda((4,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_3[grid(4)](buf8, 4, XBLOCK
            =4, num_warps=1, num_stages=1)
        buf10 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        triton_poi_fused_index_4[grid(64)](primals_1, buf10, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        del primals_1
        buf11 = extern_kernels.convolution(buf10, primals_10, stride=(2, 2),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf11, (4, 10, 2, 2), (40, 4, 2, 1))
        buf12 = buf11
        del buf11
        triton_poi_fused_convolution_relu_1[grid(160)](buf12, primals_11, 
            160, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_11
        buf13 = extern_kernels.convolution(buf12, primals_12, stride=(2, 2),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf13, (4, 10, 1, 1), (10, 1, 1, 1))
        buf14 = buf13
        del buf13
        triton_poi_fused_convolution_relu_2[grid(40)](buf14, primals_13, 40,
            XBLOCK=64, num_warps=1, num_stages=1)
        del primals_13
        buf15 = extern_kernels.convolution(buf14, primals_14, stride=(2, 2),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf15, (4, 10, 1, 1), (10, 1, 1, 1))
        buf16 = buf15
        del buf15
        triton_poi_fused_convolution_relu_2[grid(40)](buf16, primals_15, 40,
            XBLOCK=64, num_warps=1, num_stages=1)
        del primals_15
        buf17 = extern_kernels.convolution(buf16, primals_16, stride=(1, 1),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 1, 1, 1), (1, 1, 1, 1))
        buf9 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf18 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf19 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf20 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        buf21 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        triton_poi_fused__unsafe_index_convolution_mul_sigmoid_5[grid(64)](buf8
            , buf7, primals_9, buf17, primals_17, buf0, buf10, buf9, buf18,
            buf19, buf20, buf21, 64, XBLOCK=64, num_warps=1, num_stages=1)
        del buf17
        del buf7
        del primals_17
        del primals_9
    return (buf21, primals_2, primals_4, primals_6, primals_8, primals_10,
        primals_12, primals_14, primals_16, buf0, buf2, buf4, buf6, buf8,
        buf9, buf10, buf12, buf14, buf16, buf18, buf19, buf20)


class FociDetector(nn.Module):

    def __init__(self, input_channels=3, input_size=17, ksize=5,
        hidden_channels=10):
        super(FociDetector, self).__init__()
        self.conv1 = nn.Conv2d(input_channels, hidden_channels, ksize,
            stride=2, padding=int((ksize - 1) / 2))
        self.conv2 = nn.Conv2d(hidden_channels, hidden_channels, ksize,
            stride=2, padding=int((ksize - 1) / 2))
        self.conv3 = nn.Conv2d(hidden_channels, hidden_channels, ksize,
            stride=2, padding=int((ksize - 1) / 2))
        self.finalmapsize = ksize
        self.convf = nn.Conv2d(hidden_channels, 1, self.finalmapsize,
            padding=int((ksize - 1) / 2))
        self.relu = nn.ReLU()

    def forward(self, x):
        output = self.relu(self.conv1(x))
        output = self.relu(self.conv2(output))
        output = self.relu(self.conv3(output))
        output = self.convf(output)
        return output


class MultiChannelCombinedScorerNew(nn.Module):

    def __init__(self, input_size=17, ksize=5, hidden_channels=10):
        super(MultiChannelCombinedScorerNew, self).__init__()
        self.channel1 = FociDetector(input_channels=1, input_size=
            input_size, ksize=ksize, hidden_channels=hidden_channels)
        self.channel2 = FociDetector(input_channels=1, input_size=
            input_size, ksize=ksize, hidden_channels=hidden_channels)

    def forward_vis(self, x):
        output1 = torch.sigmoid(F.interpolate(self.channel1(x[:, [0], :, :]
            ), size=(x.shape[2], x.shape[3])))
        output2 = torch.sigmoid(F.interpolate(self.channel2(x[:, [1], :, :]
            ), size=(x.shape[2], x.shape[3])))
        output3 = torch.sigmoid(x[:, [0], :, :])
        output4 = torch.sigmoid(x[:, [1], :, :])
        return output1, output2, output3, output4

    def forward(self, input_0):
        primals_2 = self.channel1.conv1.weight
        primals_3 = self.channel1.conv1.bias
        primals_4 = self.channel1.conv2.weight
        primals_5 = self.channel1.conv2.bias
        primals_6 = self.channel1.conv3.weight
        primals_7 = self.channel1.conv3.bias
        primals_8 = self.channel1.convf.weight
        primals_9 = self.channel1.convf.bias
        primals_10 = self.channel2.conv1.weight
        primals_11 = self.channel2.conv1.bias
        primals_12 = self.channel2.conv2.weight
        primals_13 = self.channel2.conv2.bias
        primals_14 = self.channel2.conv3.weight
        primals_15 = self.channel2.conv3.bias
        primals_16 = self.channel2.convf.weight
        primals_17 = self.channel2.convf.bias
        primals_1 = 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]
