import torch
import torch.utils.data
import torch
import torch.nn as nn
import torch.nn.functional as F


class conv_bn_relu(nn.Module):

    def __init__(self, in_channel, out_channel, stride=1, has_relu=True):
        super(conv_bn_relu, self).__init__()
        self.conv = nn.Conv2d(in_channel, out_channel, 3, stride=stride,
            padding=1, bias=True)
        if has_relu:
            self.relu = nn.ReLU(inplace=True)
        else:
            self.relu = None

    def forward(self, x):
        x = self.conv(x)
        if self.relu:
            x = self.relu(x)
        return x


class BlockIn(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(BlockIn, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel)
        self.conv2 = conv_bn_relu(out_channel, out_channel)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        return x


class Projector(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(Projector, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel, has_relu=False)

    def forward(self, x):
        x = self.conv1(x)
        return x


class Blockdown(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(Blockdown, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel, stride=2)
        self.conv2 = conv_bn_relu(out_channel, out_channel)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        return x


class BlockUp(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(BlockUp, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel)
        self.conv_adjust = conv_bn_relu(out_channel * 2, out_channel)

    def forward(self, feature_small, feature_big):
        feature_small = self.conv1(feature_small)
        f_resize = F.interpolate(feature_small, scale_factor=2, mode=
            'bilinear', align_corners=True)
        f_cat = torch.cat([f_resize, feature_big], 1)
        f_adjust = self.conv_adjust(f_cat)
        return f_adjust


class Unet(nn.Module):

    def __init__(self):
        super(Unet, self).__init__()
        self.unet_in = BlockIn(3, 32)
        self.unet_d1 = Blockdown(32, 64)
        self.unet_d2 = Blockdown(64, 128)
        self.unet_d3 = Blockdown(128, 256)
        self.unet_d4 = Blockdown(256, 512)
        self.unet_u0 = BlockUp(512, 256)
        self.unet_u1 = BlockUp(256, 128)
        self.unet_u2 = BlockUp(128, 64)
        self.unet_u3 = BlockUp(64, 32)
        self.unet_u4 = Projector(32, 3)
        self.Tanh = nn.Tanh()

    def forward(self, x):
        f_d_64 = self.unet_in(x)
        f_d_32 = self.unet_d1(f_d_64)
        f_d_16 = self.unet_d2(f_d_32)
        f_d_8 = self.unet_d3(f_d_16)
        f_d_4 = self.unet_d4(f_d_8)
        f_u_8 = self.unet_u0(f_d_4, f_d_8)
        f_u_16 = self.unet_u1(f_u_8, f_d_16)
        f_u_32 = self.unet_u2(f_u_16, f_d_32)
        f_u_64 = self.unet_u3(f_u_32, f_d_64)
        p = self.Tanh(self.unet_u4(f_u_64))
        return p


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


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

import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.utils.data
import torch
import torch.nn as nn
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_convolution_relu_0(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 // 4096 % 32
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, 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, None)


@triton.jit
def triton_poi_fused_convolution_relu_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 // 1024 % 64
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, 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, None)


@triton.jit
def triton_poi_fused_convolution_relu_2(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 // 256 % 128
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, 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, None)


@triton.jit
def triton_poi_fused_convolution_relu_3(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 // 64 % 256
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, 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, None)


@triton.jit
def triton_poi_fused_convolution_relu_4(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 // 16 % 512
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, 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, None)


@triton.jit
def triton_poi_fused__to_copy_5(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 8
    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.42857142857142855
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_add_clamp_6(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 8
    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.42857142857142855
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tl.full([1], 1, tl.int64)
    tmp8 = tmp6 + tmp7
    tmp9 = tl.full([1], 3, tl.int64)
    tmp10 = triton_helpers.minimum(tmp8, tmp9)
    tl.store(out_ptr0 + x0, tmp10, xmask)


@triton.jit
def triton_poi_fused__to_copy_arange_clamp_mul_sub_7(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 8
    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.42857142857142855
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tmp6.to(tl.float32)
    tmp8 = tmp5 - tmp7
    tmp9 = triton_helpers.maximum(tmp8, tmp4)
    tmp10 = 1.0
    tmp11 = triton_helpers.minimum(tmp9, tmp10)
    tl.store(out_ptr0 + x0, tmp11, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_8(in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 8 % 8
    x0 = xindex % 8
    x5 = xindex // 64
    x2 = xindex // 64 % 256
    x6 = xindex
    tmp0 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + x0, None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr3 + x2, None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr5 + x0, None, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr6 + x1, None, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr7 + x1, None, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK], 4, 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)
    tmp9 = tl.load(in_ptr2 + (tmp8 + 4 * tmp4 + 16 * x5), None,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 0, tl.int32)
    tmp13 = triton_helpers.maximum(tmp12, tmp11)
    tmp15 = tmp14 + tmp1
    tmp16 = tmp14 < 0
    tmp17 = tl.where(tmp16, tmp15, tmp14)
    tmp18 = tl.load(in_ptr2 + (tmp17 + 4 * tmp4 + 16 * x5), None,
        eviction_policy='evict_last')
    tmp19 = tmp18 + tmp10
    tmp20 = triton_helpers.maximum(tmp12, tmp19)
    tmp21 = tmp20 - tmp13
    tmp23 = tmp21 * tmp22
    tmp24 = tmp13 + tmp23
    tmp26 = tmp25 + tmp1
    tmp27 = tmp25 < 0
    tmp28 = tl.where(tmp27, tmp26, tmp25)
    tmp29 = tl.load(in_ptr2 + (tmp8 + 4 * tmp28 + 16 * x5), None,
        eviction_policy='evict_last')
    tmp30 = tmp29 + tmp10
    tmp31 = triton_helpers.maximum(tmp12, tmp30)
    tmp32 = tl.load(in_ptr2 + (tmp17 + 4 * tmp28 + 16 * x5), None,
        eviction_policy='evict_last')
    tmp33 = tmp32 + tmp10
    tmp34 = triton_helpers.maximum(tmp12, tmp33)
    tmp35 = tmp34 - tmp31
    tmp36 = tmp35 * tmp22
    tmp37 = tmp31 + tmp36
    tmp38 = tmp37 - tmp24
    tmp40 = tmp38 * tmp39
    tl.store(out_ptr0 + x6, tmp24, None)
    tl.store(out_ptr1 + x6, tmp40, None)


@triton.jit
def triton_poi_fused_cat_9(in_ptr0, in_ptr1, in_ptr2, 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 // 64 % 512
    x0 = xindex % 64
    x2 = xindex // 32768
    x3 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 256, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 64 * x1 + 16384 * x2), tmp4, other=0.0)
    tmp6 = tl.load(in_ptr1 + (x0 + 64 * x1 + 16384 * x2), tmp4, other=0.0)
    tmp7 = tmp5 + tmp6
    tmp8 = tl.full(tmp7.shape, 0.0, tmp7.dtype)
    tmp9 = tl.where(tmp4, tmp7, tmp8)
    tmp10 = tmp0 >= tmp3
    tl.full([1], 512, tl.int64)
    tmp13 = tl.load(in_ptr2 + (x0 + 64 * (-256 + x1) + 16384 * x2), tmp10,
        other=0.0)
    tmp14 = tl.where(tmp4, tmp9, tmp13)
    tl.store(out_ptr0 + x3, tmp14, None)


@triton.jit
def triton_poi_fused__to_copy_10(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    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.4666666666666667
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_add_clamp_11(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    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.4666666666666667
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tl.full([1], 1, tl.int64)
    tmp8 = tmp6 + tmp7
    tmp9 = tl.full([1], 7, tl.int64)
    tmp10 = triton_helpers.minimum(tmp8, tmp9)
    tl.store(out_ptr0 + x0, tmp10, xmask)


@triton.jit
def triton_poi_fused__to_copy_arange_clamp_mul_sub_12(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 16
    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.4666666666666667
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tmp6.to(tl.float32)
    tmp8 = tmp5 - tmp7
    tmp9 = triton_helpers.maximum(tmp8, tmp4)
    tmp10 = 1.0
    tmp11 = triton_helpers.minimum(tmp9, tmp10)
    tl.store(out_ptr0 + x0, tmp11, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_13(in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, out_ptr0,
    out_ptr1, 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
    x5 = xindex // 256
    x2 = xindex // 256 % 128
    x6 = xindex
    tmp0 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + x0, None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr3 + x2, None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr5 + x0, None, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr6 + x1, None, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr7 + x1, None, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK], 8, 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)
    tmp9 = tl.load(in_ptr2 + (tmp8 + 8 * tmp4 + 64 * x5), None,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 0, tl.int32)
    tmp13 = triton_helpers.maximum(tmp12, tmp11)
    tmp15 = tmp14 + tmp1
    tmp16 = tmp14 < 0
    tmp17 = tl.where(tmp16, tmp15, tmp14)
    tmp18 = tl.load(in_ptr2 + (tmp17 + 8 * tmp4 + 64 * x5), None,
        eviction_policy='evict_last')
    tmp19 = tmp18 + tmp10
    tmp20 = triton_helpers.maximum(tmp12, tmp19)
    tmp21 = tmp20 - tmp13
    tmp23 = tmp21 * tmp22
    tmp24 = tmp13 + tmp23
    tmp26 = tmp25 + tmp1
    tmp27 = tmp25 < 0
    tmp28 = tl.where(tmp27, tmp26, tmp25)
    tmp29 = tl.load(in_ptr2 + (tmp8 + 8 * tmp28 + 64 * x5), None,
        eviction_policy='evict_last')
    tmp30 = tmp29 + tmp10
    tmp31 = triton_helpers.maximum(tmp12, tmp30)
    tmp32 = tl.load(in_ptr2 + (tmp17 + 8 * tmp28 + 64 * x5), None,
        eviction_policy='evict_last')
    tmp33 = tmp32 + tmp10
    tmp34 = triton_helpers.maximum(tmp12, tmp33)
    tmp35 = tmp34 - tmp31
    tmp36 = tmp35 * tmp22
    tmp37 = tmp31 + tmp36
    tmp38 = tmp37 - tmp24
    tmp40 = tmp38 * tmp39
    tl.store(out_ptr0 + x6, tmp24, None)
    tl.store(out_ptr1 + x6, tmp40, None)


@triton.jit
def triton_poi_fused_cat_14(in_ptr0, in_ptr1, in_ptr2, 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 // 256 % 256
    x0 = xindex % 256
    x2 = xindex // 65536
    x3 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 128, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 256 * x1 + 32768 * x2), tmp4, other=0.0)
    tmp6 = tl.load(in_ptr1 + (x0 + 256 * x1 + 32768 * x2), tmp4, other=0.0)
    tmp7 = tmp5 + tmp6
    tmp8 = tl.full(tmp7.shape, 0.0, tmp7.dtype)
    tmp9 = tl.where(tmp4, tmp7, tmp8)
    tmp10 = tmp0 >= tmp3
    tl.full([1], 256, tl.int64)
    tmp13 = tl.load(in_ptr2 + (x0 + 256 * (-128 + x1) + 32768 * x2), tmp10,
        other=0.0)
    tmp14 = tl.where(tmp4, tmp9, tmp13)
    tl.store(out_ptr0 + x3, tmp14, None)


@triton.jit
def triton_poi_fused__to_copy_15(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 32
    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.4838709677419355
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_add_clamp_16(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 32
    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.4838709677419355
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tl.full([1], 1, tl.int64)
    tmp8 = tmp6 + tmp7
    tmp9 = tl.full([1], 15, tl.int64)
    tmp10 = triton_helpers.minimum(tmp8, tmp9)
    tl.store(out_ptr0 + x0, tmp10, xmask)


@triton.jit
def triton_poi_fused__to_copy_arange_clamp_mul_sub_17(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 32
    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.4838709677419355
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tmp6.to(tl.float32)
    tmp8 = tmp5 - tmp7
    tmp9 = triton_helpers.maximum(tmp8, tmp4)
    tmp10 = 1.0
    tmp11 = triton_helpers.minimum(tmp9, tmp10)
    tl.store(out_ptr0 + x0, tmp11, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_18(in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 32 % 32
    x0 = xindex % 32
    x5 = xindex // 1024
    x2 = xindex // 1024 % 64
    x6 = xindex
    tmp0 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + x0, None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr3 + x2, None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr5 + x0, None, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr6 + x1, None, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr7 + x1, None, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK], 16, 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)
    tmp9 = tl.load(in_ptr2 + (tmp8 + 16 * tmp4 + 256 * x5), None,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 0, tl.int32)
    tmp13 = triton_helpers.maximum(tmp12, tmp11)
    tmp15 = tmp14 + tmp1
    tmp16 = tmp14 < 0
    tmp17 = tl.where(tmp16, tmp15, tmp14)
    tmp18 = tl.load(in_ptr2 + (tmp17 + 16 * tmp4 + 256 * x5), None,
        eviction_policy='evict_last')
    tmp19 = tmp18 + tmp10
    tmp20 = triton_helpers.maximum(tmp12, tmp19)
    tmp21 = tmp20 - tmp13
    tmp23 = tmp21 * tmp22
    tmp24 = tmp13 + tmp23
    tmp26 = tmp25 + tmp1
    tmp27 = tmp25 < 0
    tmp28 = tl.where(tmp27, tmp26, tmp25)
    tmp29 = tl.load(in_ptr2 + (tmp8 + 16 * tmp28 + 256 * x5), None,
        eviction_policy='evict_last')
    tmp30 = tmp29 + tmp10
    tmp31 = triton_helpers.maximum(tmp12, tmp30)
    tmp32 = tl.load(in_ptr2 + (tmp17 + 16 * tmp28 + 256 * x5), None,
        eviction_policy='evict_last')
    tmp33 = tmp32 + tmp10
    tmp34 = triton_helpers.maximum(tmp12, tmp33)
    tmp35 = tmp34 - tmp31
    tmp36 = tmp35 * tmp22
    tmp37 = tmp31 + tmp36
    tmp38 = tmp37 - tmp24
    tmp40 = tmp38 * tmp39
    tl.store(out_ptr0 + x6, tmp24, None)
    tl.store(out_ptr1 + x6, tmp40, None)


@triton.jit
def triton_poi_fused_cat_19(in_ptr0, in_ptr1, in_ptr2, 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 // 1024 % 128
    x0 = xindex % 1024
    x2 = xindex // 131072
    x3 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 64, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 1024 * x1 + 65536 * x2), tmp4, other=0.0)
    tmp6 = tl.load(in_ptr1 + (x0 + 1024 * x1 + 65536 * x2), tmp4, other=0.0)
    tmp7 = tmp5 + tmp6
    tmp8 = tl.full(tmp7.shape, 0.0, tmp7.dtype)
    tmp9 = tl.where(tmp4, tmp7, tmp8)
    tmp10 = tmp0 >= tmp3
    tl.full([1], 128, tl.int64)
    tmp13 = tl.load(in_ptr2 + (x0 + 1024 * (-64 + x1) + 65536 * x2), tmp10,
        other=0.0)
    tmp14 = tl.where(tmp4, tmp9, tmp13)
    tl.store(out_ptr0 + x3, tmp14, None)


@triton.jit
def triton_poi_fused__to_copy_20(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
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.49206349206349204
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_add_clamp_21(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
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.49206349206349204
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tl.full([1], 1, tl.int64)
    tmp8 = tmp6 + tmp7
    tmp9 = tl.full([1], 31, tl.int64)
    tmp10 = triton_helpers.minimum(tmp8, tmp9)
    tl.store(out_ptr0 + x0, tmp10, xmask)


@triton.jit
def triton_poi_fused__to_copy_arange_clamp_mul_sub_22(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
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.49206349206349204
    tmp3 = tmp1 * tmp2
    tmp4 = 0.0
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp6 = tmp5.to(tl.int32)
    tmp7 = tmp6.to(tl.float32)
    tmp8 = tmp5 - tmp7
    tmp9 = triton_helpers.maximum(tmp8, tmp4)
    tmp10 = 1.0
    tmp11 = triton_helpers.minimum(tmp9, tmp10)
    tl.store(out_ptr0 + x0, tmp11, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_23(in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 64 % 64
    x0 = xindex % 64
    x5 = xindex // 4096
    x2 = xindex // 4096 % 32
    x6 = xindex
    tmp0 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + x0, None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr3 + x2, None, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr5 + x0, None, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr6 + x1, None, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr7 + x1, None, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK], 32, 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)
    tmp9 = tl.load(in_ptr2 + (tmp8 + 32 * tmp4 + 1024 * x5), None,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 0, tl.int32)
    tmp13 = triton_helpers.maximum(tmp12, tmp11)
    tmp15 = tmp14 + tmp1
    tmp16 = tmp14 < 0
    tmp17 = tl.where(tmp16, tmp15, tmp14)
    tmp18 = tl.load(in_ptr2 + (tmp17 + 32 * tmp4 + 1024 * x5), None,
        eviction_policy='evict_last')
    tmp19 = tmp18 + tmp10
    tmp20 = triton_helpers.maximum(tmp12, tmp19)
    tmp21 = tmp20 - tmp13
    tmp23 = tmp21 * tmp22
    tmp24 = tmp13 + tmp23
    tmp26 = tmp25 + tmp1
    tmp27 = tmp25 < 0
    tmp28 = tl.where(tmp27, tmp26, tmp25)
    tmp29 = tl.load(in_ptr2 + (tmp8 + 32 * tmp28 + 1024 * x5), None,
        eviction_policy='evict_last')
    tmp30 = tmp29 + tmp10
    tmp31 = triton_helpers.maximum(tmp12, tmp30)
    tmp32 = tl.load(in_ptr2 + (tmp17 + 32 * tmp28 + 1024 * x5), None,
        eviction_policy='evict_last')
    tmp33 = tmp32 + tmp10
    tmp34 = triton_helpers.maximum(tmp12, tmp33)
    tmp35 = tmp34 - tmp31
    tmp36 = tmp35 * tmp22
    tmp37 = tmp31 + tmp36
    tmp38 = tmp37 - tmp24
    tmp40 = tmp38 * tmp39
    tl.store(out_ptr0 + x6, tmp24, None)
    tl.store(out_ptr1 + x6, tmp40, None)


@triton.jit
def triton_poi_fused_cat_24(in_ptr0, in_ptr1, in_ptr2, 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 // 4096 % 64
    x0 = xindex % 4096
    x2 = xindex // 262144
    x3 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 32, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 4096 * x1 + 131072 * x2), tmp4, other=0.0)
    tmp6 = tl.load(in_ptr1 + (x0 + 4096 * x1 + 131072 * x2), tmp4, other=0.0)
    tmp7 = tmp5 + tmp6
    tmp8 = tl.full(tmp7.shape, 0.0, tmp7.dtype)
    tmp9 = tl.where(tmp4, tmp7, tmp8)
    tmp10 = tmp0 >= tmp3
    tl.full([1], 64, tl.int64)
    tmp13 = tl.load(in_ptr2 + (x0 + 4096 * (-32 + x1) + 131072 * x2), tmp10,
        other=0.0)
    tmp14 = tl.where(tmp4, tmp9, tmp13)
    tl.store(out_ptr0 + x3, tmp14, None)


@triton.jit
def triton_poi_fused_convolution_tanh_25(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 // 4096 % 3
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = libdevice.tanh(tmp2)
    tl.store(in_out_ptr0 + x3, tmp3, None)


@triton.jit
def triton_poi_fused_convolution_relu_threshold_backward_26(in_ptr0,
    in_ptr1, out_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 // 1024 % 32
    tmp0 = tl.load(in_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr1 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(out_ptr0 + x3, tmp6, None)


@triton.jit
def triton_poi_fused_convolution_relu_threshold_backward_27(in_ptr0,
    in_ptr1, out_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 // 256 % 64
    tmp0 = tl.load(in_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr1 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(out_ptr0 + x3, tmp6, None)


@triton.jit
def triton_poi_fused_convolution_relu_threshold_backward_28(in_ptr0,
    in_ptr1, out_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 // 64 % 128
    tmp0 = tl.load(in_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr1 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(out_ptr0 + x3, tmp6, None)


@triton.jit
def triton_poi_fused_convolution_relu_threshold_backward_29(in_ptr0,
    in_ptr1, out_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 // 16 % 256
    tmp0 = tl.load(in_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr1 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(out_ptr0 + x3, tmp6, None)


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15, primals_16, primals_17,
        primals_18, primals_19, primals_20, primals_21, primals_22,
        primals_23, primals_24, primals_25, primals_26, primals_27,
        primals_28, primals_29, primals_30, primals_31, primals_32,
        primals_33, primals_34, primals_35, primals_36, primals_37,
        primals_38, primals_39) = args
    args.clear()
    assert_size_stride(primals_1, (32, 3, 3, 3), (27, 9, 3, 1))
    assert_size_stride(primals_2, (32,), (1,))
    assert_size_stride(primals_3, (4, 3, 64, 64), (12288, 4096, 64, 1))
    assert_size_stride(primals_4, (32, 32, 3, 3), (288, 9, 3, 1))
    assert_size_stride(primals_5, (32,), (1,))
    assert_size_stride(primals_6, (64, 32, 3, 3), (288, 9, 3, 1))
    assert_size_stride(primals_7, (64,), (1,))
    assert_size_stride(primals_8, (64, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_9, (64,), (1,))
    assert_size_stride(primals_10, (128, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_11, (128,), (1,))
    assert_size_stride(primals_12, (128, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_13, (128,), (1,))
    assert_size_stride(primals_14, (256, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_15, (256,), (1,))
    assert_size_stride(primals_16, (256, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_17, (256,), (1,))
    assert_size_stride(primals_18, (512, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_19, (512,), (1,))
    assert_size_stride(primals_20, (512, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_21, (512,), (1,))
    assert_size_stride(primals_22, (256, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_23, (256,), (1,))
    assert_size_stride(primals_24, (256, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_25, (256,), (1,))
    assert_size_stride(primals_26, (128, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_27, (128,), (1,))
    assert_size_stride(primals_28, (128, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_29, (128,), (1,))
    assert_size_stride(primals_30, (64, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_31, (64,), (1,))
    assert_size_stride(primals_32, (64, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_33, (64,), (1,))
    assert_size_stride(primals_34, (32, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_35, (32,), (1,))
    assert_size_stride(primals_36, (32, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_37, (32,), (1,))
    assert_size_stride(primals_38, (3, 32, 3, 3), (288, 9, 3, 1))
    assert_size_stride(primals_39, (3,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_3, primals_1, stride=(1, 
            1), padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 32, 64, 64), (131072, 4096, 64, 1))
        buf1 = buf0
        del buf0
        get_raw_stream(0)
        triton_poi_fused_convolution_relu_0[grid(524288)](buf1, primals_2, 
            524288, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_2
        buf2 = extern_kernels.convolution(buf1, primals_4, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf2, (4, 32, 64, 64), (131072, 4096, 64, 1))
        buf3 = buf2
        del buf2
        triton_poi_fused_convolution_relu_0[grid(524288)](buf3, primals_5, 
            524288, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_5
        buf4 = extern_kernels.convolution(buf3, primals_6, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf4, (4, 64, 32, 32), (65536, 1024, 32, 1))
        buf5 = buf4
        del buf4
        triton_poi_fused_convolution_relu_1[grid(262144)](buf5, primals_7, 
            262144, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_7
        buf6 = extern_kernels.convolution(buf5, primals_8, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf6, (4, 64, 32, 32), (65536, 1024, 32, 1))
        buf7 = buf6
        del buf6
        triton_poi_fused_convolution_relu_1[grid(262144)](buf7, primals_9, 
            262144, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_9
        buf8 = extern_kernels.convolution(buf7, primals_10, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf8, (4, 128, 16, 16), (32768, 256, 16, 1))
        buf9 = buf8
        del buf8
        triton_poi_fused_convolution_relu_2[grid(131072)](buf9, primals_11,
            131072, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_11
        buf10 = extern_kernels.convolution(buf9, primals_12, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf10, (4, 128, 16, 16), (32768, 256, 16, 1))
        buf11 = buf10
        del buf10
        triton_poi_fused_convolution_relu_2[grid(131072)](buf11, primals_13,
            131072, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_13
        buf12 = extern_kernels.convolution(buf11, primals_14, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf12, (4, 256, 8, 8), (16384, 64, 8, 1))
        buf13 = buf12
        del buf12
        triton_poi_fused_convolution_relu_3[grid(65536)](buf13, primals_15,
            65536, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_15
        buf14 = extern_kernels.convolution(buf13, primals_16, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 256, 8, 8), (16384, 64, 8, 1))
        buf15 = buf14
        del buf14
        triton_poi_fused_convolution_relu_3[grid(65536)](buf15, primals_17,
            65536, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_17
        buf16 = extern_kernels.convolution(buf15, primals_18, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf16, (4, 512, 4, 4), (8192, 16, 4, 1))
        buf17 = buf16
        del buf16
        triton_poi_fused_convolution_relu_4[grid(32768)](buf17, primals_19,
            32768, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_19
        buf18 = extern_kernels.convolution(buf17, primals_20, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf18, (4, 512, 4, 4), (8192, 16, 4, 1))
        buf19 = buf18
        del buf18
        triton_poi_fused_convolution_relu_4[grid(32768)](buf19, primals_21,
            32768, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_21
        buf20 = extern_kernels.convolution(buf19, primals_22, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf20, (4, 256, 4, 4), (4096, 16, 4, 1))
        buf21 = empty_strided_cuda((8, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_5[grid(8)](buf21, 8, XBLOCK=8, num_warps=
            1, num_stages=1)
        buf22 = empty_strided_cuda((8, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_6[grid(8)](buf22, 8, XBLOCK=8, num_warps
            =1, num_stages=1)
        buf23 = empty_strided_cuda((8,), (1,), torch.int64)
        triton_poi_fused__to_copy_5[grid(8)](buf23, 8, XBLOCK=8, num_warps=
            1, num_stages=1)
        buf24 = empty_strided_cuda((8,), (1,), torch.int64)
        triton_poi_fused_add_clamp_6[grid(8)](buf24, 8, XBLOCK=8, num_warps
            =1, num_stages=1)
        buf25 = empty_strided_cuda((8,), (1,), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_7[grid(8)](buf25, 8,
            XBLOCK=8, num_warps=1, num_stages=1)
        buf27 = empty_strided_cuda((8, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_7[grid(8)](buf27, 8,
            XBLOCK=8, num_warps=1, num_stages=1)
        buf26 = empty_strided_cuda((4, 256, 8, 8), (16384, 64, 8, 1), torch
            .float32)
        buf28 = empty_strided_cuda((4, 256, 8, 8), (16384, 64, 8, 1), torch
            .float32)
        triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_8[grid(
            65536)](buf21, buf23, buf20, primals_23, buf24, buf25, buf22,
            buf27, buf26, buf28, 65536, XBLOCK=256, num_warps=4, num_stages=1)
        buf29 = empty_strided_cuda((4, 512, 8, 8), (32768, 64, 8, 1), torch
            .float32)
        triton_poi_fused_cat_9[grid(131072)](buf26, buf28, buf15, buf29, 
            131072, XBLOCK=512, num_warps=8, num_stages=1)
        del buf26
        del buf28
        buf30 = extern_kernels.convolution(buf29, primals_24, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf30, (4, 256, 8, 8), (16384, 64, 8, 1))
        buf31 = buf30
        del buf30
        triton_poi_fused_convolution_relu_3[grid(65536)](buf31, primals_25,
            65536, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_25
        buf32 = extern_kernels.convolution(buf31, primals_26, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf32, (4, 128, 8, 8), (8192, 64, 8, 1))
        buf33 = empty_strided_cuda((16, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_10[grid(16)](buf33, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        buf34 = empty_strided_cuda((16, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_11[grid(16)](buf34, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        buf35 = empty_strided_cuda((16,), (1,), torch.int64)
        triton_poi_fused__to_copy_10[grid(16)](buf35, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        buf36 = empty_strided_cuda((16,), (1,), torch.int64)
        triton_poi_fused_add_clamp_11[grid(16)](buf36, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        buf37 = empty_strided_cuda((16,), (1,), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_12[grid(16)](buf37, 
            16, XBLOCK=16, num_warps=1, num_stages=1)
        buf39 = empty_strided_cuda((16, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_12[grid(16)](buf39, 
            16, XBLOCK=16, num_warps=1, num_stages=1)
        buf38 = empty_strided_cuda((4, 128, 16, 16), (32768, 256, 16, 1),
            torch.float32)
        buf40 = empty_strided_cuda((4, 128, 16, 16), (32768, 256, 16, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_13[grid
            (131072)](buf33, buf35, buf32, primals_27, buf36, buf37, buf34,
            buf39, buf38, buf40, 131072, XBLOCK=512, num_warps=8, num_stages=1)
        buf41 = empty_strided_cuda((4, 256, 16, 16), (65536, 256, 16, 1),
            torch.float32)
        triton_poi_fused_cat_14[grid(262144)](buf38, buf40, buf11, buf41, 
            262144, XBLOCK=1024, num_warps=4, num_stages=1)
        del buf38
        del buf40
        buf42 = extern_kernels.convolution(buf41, primals_28, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf42, (4, 128, 16, 16), (32768, 256, 16, 1))
        buf43 = buf42
        del buf42
        triton_poi_fused_convolution_relu_2[grid(131072)](buf43, primals_29,
            131072, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_29
        buf44 = extern_kernels.convolution(buf43, primals_30, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf44, (4, 64, 16, 16), (16384, 256, 16, 1))
        buf45 = empty_strided_cuda((32, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_15[grid(32)](buf45, 32, XBLOCK=32,
            num_warps=1, num_stages=1)
        buf46 = empty_strided_cuda((32, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_16[grid(32)](buf46, 32, XBLOCK=32,
            num_warps=1, num_stages=1)
        buf47 = empty_strided_cuda((32,), (1,), torch.int64)
        triton_poi_fused__to_copy_15[grid(32)](buf47, 32, XBLOCK=32,
            num_warps=1, num_stages=1)
        buf48 = empty_strided_cuda((32,), (1,), torch.int64)
        triton_poi_fused_add_clamp_16[grid(32)](buf48, 32, XBLOCK=32,
            num_warps=1, num_stages=1)
        buf49 = empty_strided_cuda((32,), (1,), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_17[grid(32)](buf49, 
            32, XBLOCK=32, num_warps=1, num_stages=1)
        buf51 = empty_strided_cuda((32, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_17[grid(32)](buf51, 
            32, XBLOCK=32, num_warps=1, num_stages=1)
        buf50 = empty_strided_cuda((4, 64, 32, 32), (65536, 1024, 32, 1),
            torch.float32)
        buf52 = empty_strided_cuda((4, 64, 32, 32), (65536, 1024, 32, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_18[grid
            (262144)](buf45, buf47, buf44, primals_31, buf48, buf49, buf46,
            buf51, buf50, buf52, 262144, XBLOCK=512, num_warps=8, num_stages=1)
        buf53 = empty_strided_cuda((4, 128, 32, 32), (131072, 1024, 32, 1),
            torch.float32)
        triton_poi_fused_cat_19[grid(524288)](buf50, buf52, buf7, buf53, 
            524288, XBLOCK=1024, num_warps=4, num_stages=1)
        del buf50
        del buf52
        buf54 = extern_kernels.convolution(buf53, primals_32, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf54, (4, 64, 32, 32), (65536, 1024, 32, 1))
        buf55 = buf54
        del buf54
        triton_poi_fused_convolution_relu_1[grid(262144)](buf55, primals_33,
            262144, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_33
        buf56 = extern_kernels.convolution(buf55, primals_34, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf56, (4, 32, 32, 32), (32768, 1024, 32, 1))
        buf57 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_20[grid(64)](buf57, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf58 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_21[grid(64)](buf58, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf59 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused__to_copy_20[grid(64)](buf59, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf60 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused_add_clamp_21[grid(64)](buf60, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf61 = empty_strided_cuda((64,), (1,), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_22[grid(64)](buf61, 
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf63 = empty_strided_cuda((64, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_arange_clamp_mul_sub_22[grid(64)](buf63, 
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf62 = empty_strided_cuda((4, 32, 64, 64), (131072, 4096, 64, 1),
            torch.float32)
        buf64 = empty_strided_cuda((4, 32, 64, 64), (131072, 4096, 64, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_add_convolution_mul_relu_sub_23[grid
            (524288)](buf57, buf59, buf56, primals_35, buf60, buf61, buf58,
            buf63, buf62, buf64, 524288, XBLOCK=1024, num_warps=4, num_stages=1
            )
        buf65 = empty_strided_cuda((4, 64, 64, 64), (262144, 4096, 64, 1),
            torch.float32)
        triton_poi_fused_cat_24[grid(1048576)](buf62, buf64, buf3, buf65, 
            1048576, XBLOCK=1024, num_warps=4, num_stages=1)
        del buf62
        del buf64
        buf66 = extern_kernels.convolution(buf65, primals_36, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf66, (4, 32, 64, 64), (131072, 4096, 64, 1))
        buf67 = buf66
        del buf66
        triton_poi_fused_convolution_relu_0[grid(524288)](buf67, primals_37,
            524288, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_37
        buf68 = extern_kernels.convolution(buf67, primals_38, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf68, (4, 3, 64, 64), (12288, 4096, 64, 1))
        buf69 = buf68
        del buf68
        triton_poi_fused_convolution_tanh_25[grid(49152)](buf69, primals_39,
            49152, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_39
        buf70 = empty_strided_cuda((4, 32, 32, 32), (32768, 1024, 32, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_26[grid(131072)](
            buf56, primals_35, buf70, 131072, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf56
        del primals_35
        buf71 = empty_strided_cuda((4, 64, 16, 16), (16384, 256, 16, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_27[grid(65536)](
            buf44, primals_31, buf71, 65536, XBLOCK=512, num_warps=4,
            num_stages=1)
        del buf44
        del primals_31
        buf72 = empty_strided_cuda((4, 128, 8, 8), (8192, 64, 8, 1), torch.bool
            )
        triton_poi_fused_convolution_relu_threshold_backward_28[grid(32768)](
            buf32, primals_27, buf72, 32768, XBLOCK=128, num_warps=4,
            num_stages=1)
        del buf32
        del primals_27
        buf73 = empty_strided_cuda((4, 256, 4, 4), (4096, 16, 4, 1), torch.bool
            )
        triton_poi_fused_convolution_relu_threshold_backward_29[grid(16384)](
            buf20, primals_23, buf73, 16384, XBLOCK=256, num_warps=4,
            num_stages=1)
        del buf20
        del primals_23
    return (buf69, primals_1, primals_3, primals_4, primals_6, primals_8,
        primals_10, primals_12, primals_14, primals_16, primals_18,
        primals_20, primals_22, primals_24, primals_26, primals_28,
        primals_30, primals_32, primals_34, primals_36, primals_38, buf1,
        buf3, buf5, buf7, buf9, buf11, buf13, buf15, buf17, buf19, buf21,
        buf22, buf23, buf24, buf25, buf27, buf29, buf31, buf33, buf34,
        buf35, buf36, buf37, buf39, buf41, buf43, buf45, buf46, buf47,
        buf48, buf49, buf51, buf53, buf55, buf57, buf58, buf59, buf60,
        buf61, buf63, buf65, buf67, buf69, buf70, buf71, buf72, buf73)


class conv_bn_relu(nn.Module):

    def __init__(self, in_channel, out_channel, stride=1, has_relu=True):
        super(conv_bn_relu, self).__init__()
        self.conv = nn.Conv2d(in_channel, out_channel, 3, stride=stride,
            padding=1, bias=True)
        if has_relu:
            self.relu = nn.ReLU(inplace=True)
        else:
            self.relu = None

    def forward(self, x):
        x = self.conv(x)
        if self.relu:
            x = self.relu(x)
        return x


class BlockIn(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(BlockIn, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel)
        self.conv2 = conv_bn_relu(out_channel, out_channel)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        return x


class Projector(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(Projector, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel, has_relu=False)

    def forward(self, x):
        x = self.conv1(x)
        return x


class Blockdown(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(Blockdown, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel, stride=2)
        self.conv2 = conv_bn_relu(out_channel, out_channel)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        return x


class BlockUp(nn.Module):

    def __init__(self, in_channel, out_channel):
        super(BlockUp, self).__init__()
        self.conv1 = conv_bn_relu(in_channel, out_channel)
        self.conv_adjust = conv_bn_relu(out_channel * 2, out_channel)

    def forward(self, feature_small, feature_big):
        feature_small = self.conv1(feature_small)
        f_resize = F.interpolate(feature_small, scale_factor=2, mode=
            'bilinear', align_corners=True)
        f_cat = torch.cat([f_resize, feature_big], 1)
        f_adjust = self.conv_adjust(f_cat)
        return f_adjust


class UnetNew(nn.Module):

    def __init__(self):
        super(UnetNew, self).__init__()
        self.unet_in = BlockIn(3, 32)
        self.unet_d1 = Blockdown(32, 64)
        self.unet_d2 = Blockdown(64, 128)
        self.unet_d3 = Blockdown(128, 256)
        self.unet_d4 = Blockdown(256, 512)
        self.unet_u0 = BlockUp(512, 256)
        self.unet_u1 = BlockUp(256, 128)
        self.unet_u2 = BlockUp(128, 64)
        self.unet_u3 = BlockUp(64, 32)
        self.unet_u4 = Projector(32, 3)
        self.Tanh = nn.Tanh()

    def forward(self, input_0):
        primals_1 = self.unet_in.conv1.conv.weight
        primals_2 = self.unet_in.conv1.conv.bias
        primals_4 = self.unet_in.conv2.conv.weight
        primals_5 = self.unet_in.conv2.conv.bias
        primals_6 = self.unet_d1.conv1.conv.weight
        primals_7 = self.unet_d1.conv1.conv.bias
        primals_8 = self.unet_d1.conv2.conv.weight
        primals_9 = self.unet_d1.conv2.conv.bias
        primals_10 = self.unet_d2.conv1.conv.weight
        primals_11 = self.unet_d2.conv1.conv.bias
        primals_12 = self.unet_d2.conv2.conv.weight
        primals_13 = self.unet_d2.conv2.conv.bias
        primals_14 = self.unet_d3.conv1.conv.weight
        primals_15 = self.unet_d3.conv1.conv.bias
        primals_16 = self.unet_d3.conv2.conv.weight
        primals_17 = self.unet_d3.conv2.conv.bias
        primals_18 = self.unet_d4.conv1.conv.weight
        primals_19 = self.unet_d4.conv1.conv.bias
        primals_20 = self.unet_d4.conv2.conv.weight
        primals_21 = self.unet_d4.conv2.conv.bias
        primals_22 = self.unet_u0.conv1.conv.weight
        primals_23 = self.unet_u0.conv1.conv.bias
        primals_24 = self.unet_u0.conv_adjust.conv.weight
        primals_25 = self.unet_u0.conv_adjust.conv.bias
        primals_26 = self.unet_u1.conv1.conv.weight
        primals_27 = self.unet_u1.conv1.conv.bias
        primals_28 = self.unet_u1.conv_adjust.conv.weight
        primals_29 = self.unet_u1.conv_adjust.conv.bias
        primals_30 = self.unet_u2.conv1.conv.weight
        primals_31 = self.unet_u2.conv1.conv.bias
        primals_32 = self.unet_u2.conv_adjust.conv.weight
        primals_33 = self.unet_u2.conv_adjust.conv.bias
        primals_34 = self.unet_u3.conv1.conv.weight
        primals_35 = self.unet_u3.conv1.conv.bias
        primals_36 = self.unet_u3.conv_adjust.conv.weight
        primals_37 = self.unet_u3.conv_adjust.conv.bias
        primals_38 = self.unet_u4.conv1.conv.weight
        primals_39 = self.unet_u4.conv1.conv.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, primals_18, primals_19,
            primals_20, primals_21, primals_22, primals_23, primals_24,
            primals_25, primals_26, primals_27, primals_28, primals_29,
            primals_30, primals_31, primals_32, primals_33, primals_34,
            primals_35, primals_36, primals_37, primals_38, primals_39])
        return output[0]
