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 math as tl_math
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_reflection_pad2d_0(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex % 6
    x1 = xindex // 6 % 6
    x2 = xindex // 36
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (15 + -1 * tl_math.abs(-3 + tl_math.abs(-1 +
        x0)) + -4 * tl_math.abs(-3 + tl_math.abs(-1 + x1)) + 16 * x2), None,
        eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, None)


@triton.jit
def triton_poi_fused__to_copy_add_arange_mul_1(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.5
    tmp3 = tmp1 * tmp2
    tmp4 = tmp3.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_2(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 // 10 % 10
    x0 = xindex % 10
    x4 = xindex // 100
    x2 = xindex // 100 % 256
    x7 = xindex
    tmp0 = tl.load(in_ptr0 + (7 + -1 * tl_math.abs(-7 + tl_math.abs(-1 + x1
        ))), None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (7 + -1 * tl_math.abs(-7 + tl_math.abs(-1 + x0
        ))), None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + x2, 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_ptr1 + (tmp8 + 4 * tmp4 + 16 * x4), None,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 0, tl.int32)
    tmp13 = triton_helpers.maximum(tmp12, tmp11)
    tl.store(out_ptr0 + x7, tmp13, None)


@triton.jit
def triton_poi_fused_convolution_reflection_pad2d_relu_3(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)
    x0 = xindex % 10
    x1 = xindex // 10 % 10
    x4 = xindex // 100
    x2 = xindex // 100 % 256
    x5 = xindex
    tmp0 = tl.load(in_ptr0 + (63 + -1 * tl_math.abs(-7 + tl_math.abs(-1 +
        x0)) + -8 * tl_math.abs(-7 + tl_math.abs(-1 + x1)) + 64 * x4), None,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(out_ptr0 + x5, tmp4, None)


@triton.jit
def triton_poi_fused__to_copy_add_arange_mul_4(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.5
    tmp3 = tmp1 * tmp2
    tmp4 = tmp3.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_5(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 // 18 % 18
    x0 = xindex % 18
    x4 = xindex // 324
    x2 = xindex // 324 % 128
    x7 = xindex
    tmp0 = tl.load(in_ptr0 + (15 + -1 * tl_math.abs(-15 + tl_math.abs(-1 +
        x1))), None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (15 + -1 * tl_math.abs(-15 + tl_math.abs(-1 +
        x0))), None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + x2, 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_ptr1 + (tmp8 + 8 * tmp4 + 64 * x4), None,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 0, tl.int32)
    tmp13 = triton_helpers.maximum(tmp12, tmp11)
    tl.store(out_ptr0 + x7, tmp13, None)


@triton.jit
def triton_poi_fused_convolution_reflection_pad2d_relu_6(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)
    x0 = xindex % 18
    x1 = xindex // 18 % 18
    x4 = xindex // 324
    x2 = xindex // 324 % 128
    x5 = xindex
    tmp0 = tl.load(in_ptr0 + (255 + -1 * tl_math.abs(-15 + tl_math.abs(-1 +
        x0)) + -16 * tl_math.abs(-15 + tl_math.abs(-1 + x1)) + 256 * x4),
        None, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(out_ptr0 + x5, tmp4, None)


@triton.jit
def triton_poi_fused__to_copy_add_arange_mul_7(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.5
    tmp3 = tmp1 * tmp2
    tmp4 = tmp3.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_8(in_ptr0,
    in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 295936
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 34 % 34
    x0 = xindex % 34
    x4 = xindex // 1156
    x2 = xindex // 1156 % 64
    x7 = xindex
    tmp0 = tl.load(in_ptr0 + (31 + -1 * tl_math.abs(-31 + tl_math.abs(-1 +
        x1))), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (31 + -1 * tl_math.abs(-31 + tl_math.abs(-1 +
        x0))), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + x2, xmask, 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_ptr1 + (tmp8 + 16 * tmp4 + 256 * x4), xmask,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 0, tl.int32)
    tmp13 = triton_helpers.maximum(tmp12, tmp11)
    tl.store(out_ptr0 + x7, tmp13, xmask)


@triton.jit
def triton_poi_fused_convolution_reflection_pad2d_relu_9(in_ptr0, in_ptr1,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 295936
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 34
    x1 = xindex // 34 % 34
    x4 = xindex // 1156
    x2 = xindex // 1156 % 64
    x5 = xindex
    tmp0 = tl.load(in_ptr0 + (1023 + -1 * tl_math.abs(-31 + tl_math.abs(-1 +
        x0)) + -32 * tl_math.abs(-31 + tl_math.abs(-1 + x1)) + 1024 * x4),
        xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(out_ptr0 + x5, tmp4, xmask)


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


@triton.jit
def triton_poi_fused_convolution_relu_threshold_backward_11(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 % 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_12(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_13(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 % 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_14(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_15(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 % 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)


@triton.jit
def triton_poi_fused_convolution_relu_threshold_backward_16(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) = args
    args.clear()
    assert_size_stride(primals_1, (4, 512, 4, 4), (8192, 16, 4, 1))
    assert_size_stride(primals_2, (256, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_3, (256,), (1,))
    assert_size_stride(primals_4, (256, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_5, (256,), (1,))
    assert_size_stride(primals_6, (256, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_7, (256,), (1,))
    assert_size_stride(primals_8, (256, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_9, (256,), (1,))
    assert_size_stride(primals_10, (128, 256, 3, 3), (2304, 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, (64, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_15, (64,), (1,))
    assert_size_stride(primals_16, (64, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_17, (64,), (1,))
    assert_size_stride(primals_18, (3, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_19, (3,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 512, 6, 6), (18432, 36, 6, 1), torch.
            float32)
        get_raw_stream(0)
        triton_poi_fused_reflection_pad2d_0[grid(73728)](primals_1, buf0, 
            73728, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_1
        buf1 = extern_kernels.convolution(buf0, primals_2, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf1, (4, 256, 4, 4), (4096, 16, 4, 1))
        buf2 = empty_strided_cuda((8,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_1[grid(8)](buf2, 8, XBLOCK
            =8, num_warps=1, num_stages=1)
        buf3 = empty_strided_cuda((4, 256, 10, 10), (25600, 100, 10, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_2[grid
            (102400)](buf2, buf1, primals_3, buf3, 102400, XBLOCK=512,
            num_warps=8, num_stages=1)
        buf4 = extern_kernels.convolution(buf3, primals_4, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf4, (4, 256, 8, 8), (16384, 64, 8, 1))
        buf5 = empty_strided_cuda((4, 256, 10, 10), (25600, 100, 10, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_3[grid(102400)](buf4
            , primals_5, buf5, 102400, XBLOCK=512, num_warps=8, num_stages=1)
        buf6 = extern_kernels.convolution(buf5, primals_6, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf6, (4, 256, 8, 8), (16384, 64, 8, 1))
        buf7 = empty_strided_cuda((4, 256, 10, 10), (25600, 100, 10, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_3[grid(102400)](buf6
            , primals_7, buf7, 102400, XBLOCK=512, num_warps=8, num_stages=1)
        buf8 = extern_kernels.convolution(buf7, primals_8, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf8, (4, 256, 8, 8), (16384, 64, 8, 1))
        buf9 = empty_strided_cuda((4, 256, 10, 10), (25600, 100, 10, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_3[grid(102400)](buf8
            , primals_9, buf9, 102400, XBLOCK=512, num_warps=8, num_stages=1)
        buf10 = extern_kernels.convolution(buf9, primals_10, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf10, (4, 128, 8, 8), (8192, 64, 8, 1))
        buf11 = empty_strided_cuda((16,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_4[grid(16)](buf11, 16,
            XBLOCK=16, num_warps=1, num_stages=1)
        buf12 = empty_strided_cuda((4, 128, 18, 18), (41472, 324, 18, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_5[grid
            (165888)](buf11, buf10, primals_11, buf12, 165888, XBLOCK=1024,
            num_warps=4, num_stages=1)
        buf13 = extern_kernels.convolution(buf12, primals_12, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf13, (4, 128, 16, 16), (32768, 256, 16, 1))
        buf14 = empty_strided_cuda((4, 128, 18, 18), (41472, 324, 18, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_6[grid(165888)](
            buf13, primals_13, buf14, 165888, XBLOCK=512, num_warps=8,
            num_stages=1)
        buf15 = extern_kernels.convolution(buf14, primals_14, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf15, (4, 64, 16, 16), (16384, 256, 16, 1))
        buf16 = empty_strided_cuda((32,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_7[grid(32)](buf16, 32,
            XBLOCK=32, num_warps=1, num_stages=1)
        buf17 = empty_strided_cuda((4, 64, 34, 34), (73984, 1156, 34, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_8[grid
            (295936)](buf16, buf15, primals_15, buf17, 295936, XBLOCK=1024,
            num_warps=4, num_stages=1)
        buf18 = extern_kernels.convolution(buf17, primals_16, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf18, (4, 64, 32, 32), (65536, 1024, 32, 1))
        buf19 = empty_strided_cuda((4, 64, 34, 34), (73984, 1156, 34, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_9[grid(295936)](
            buf18, primals_17, buf19, 295936, XBLOCK=512, num_warps=8,
            num_stages=1)
        buf20 = extern_kernels.convolution(buf19, primals_18, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf20, (4, 3, 32, 32), (3072, 1024, 32, 1))
        buf21 = buf20
        del buf20
        triton_poi_fused_convolution_10[grid(12288)](buf21, primals_19, 
            12288, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_19
        buf22 = empty_strided_cuda((4, 64, 32, 32), (65536, 1024, 32, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_11[grid(262144)](
            buf18, primals_17, buf22, 262144, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf18
        del primals_17
        buf23 = empty_strided_cuda((4, 64, 16, 16), (16384, 256, 16, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_12[grid(65536)](
            buf15, primals_15, buf23, 65536, XBLOCK=256, num_warps=4,
            num_stages=1)
        del buf15
        del primals_15
        buf24 = empty_strided_cuda((4, 128, 16, 16), (32768, 256, 16, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_13[grid(131072)](
            buf13, primals_13, buf24, 131072, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf13
        del primals_13
        buf25 = empty_strided_cuda((4, 128, 8, 8), (8192, 64, 8, 1), torch.bool
            )
        triton_poi_fused_convolution_relu_threshold_backward_14[grid(32768)](
            buf10, primals_11, buf25, 32768, XBLOCK=256, num_warps=4,
            num_stages=1)
        del buf10
        del primals_11
        buf26 = empty_strided_cuda((4, 256, 8, 8), (16384, 64, 8, 1), torch
            .bool)
        triton_poi_fused_convolution_relu_threshold_backward_15[grid(65536)](
            buf8, primals_9, buf26, 65536, XBLOCK=512, num_warps=4,
            num_stages=1)
        del buf8
        del primals_9
        buf27 = empty_strided_cuda((4, 256, 8, 8), (16384, 64, 8, 1), torch
            .bool)
        triton_poi_fused_convolution_relu_threshold_backward_15[grid(65536)](
            buf6, primals_7, buf27, 65536, XBLOCK=512, num_warps=4,
            num_stages=1)
        del buf6
        del primals_7
        buf28 = empty_strided_cuda((4, 256, 8, 8), (16384, 64, 8, 1), torch
            .bool)
        triton_poi_fused_convolution_relu_threshold_backward_15[grid(65536)](
            buf4, primals_5, buf28, 65536, XBLOCK=512, num_warps=4,
            num_stages=1)
        del buf4
        del primals_5
        buf29 = empty_strided_cuda((4, 256, 4, 4), (4096, 16, 4, 1), torch.bool
            )
        triton_poi_fused_convolution_relu_threshold_backward_16[grid(16384)](
            buf1, primals_3, buf29, 16384, XBLOCK=128, num_warps=4,
            num_stages=1)
        del buf1
        del primals_3
    return (buf21, primals_2, primals_4, primals_6, primals_8, primals_10,
        primals_12, primals_14, primals_16, primals_18, buf0, buf2, buf3,
        buf5, buf7, buf9, buf11, buf12, buf14, buf16, buf17, buf19, buf22,
        buf23, buf24, buf25, buf26, buf27, buf28, buf29)


class RC(nn.Module):
    """
    A wrapper class for ReflectionPad2d, Conv2d and an optional relu
    """

    def __init__(self, in_dim, out_dim, kernel_size=3, padding=1,
        activation_function=True):
        super().__init__()
        self.pad = nn.ReflectionPad2d((padding, padding, padding, padding))
        self.conv = nn.Conv2d(in_dim, out_dim, kernel_size)
        self.activation_function = activation_function

    def forward(self, x):
        x = self.pad(x)
        x = self.conv(x)
        return F.relu(x) if self.activation_function else x


class DecoderNew(nn.Module):

    def __init__(self):
        super(DecoderNew, self).__init__()
        self.rc1 = RC(512, 256, 3, 1)
        self.upsample1 = nn.Upsample(scale_factor=2, mode='nearest')
        self.rc2 = RC(256, 256, 3, 1)
        self.rc3 = RC(256, 256, 3, 1)
        self.rc4 = RC(256, 256, 3, 1)
        self.rc5 = RC(256, 128, 3, 1)
        self.upsample2 = nn.Upsample(scale_factor=2, mode='nearest')
        self.rc6 = RC(128, 128, 3, 1)
        self.rc7 = RC(128, 64, 3, 1)
        self.upsample3 = nn.Upsample(scale_factor=2, mode='nearest')
        self.rc8 = RC(64, 64, 3, 1)
        self.rc9 = RC(64, 3, 3, 1, False)

    def forward(self, input_0):
        primals_2 = self.rc1.conv.weight
        primals_3 = self.rc1.conv.bias
        primals_4 = self.rc2.conv.weight
        primals_5 = self.rc2.conv.bias
        primals_6 = self.rc3.conv.weight
        primals_7 = self.rc3.conv.bias
        primals_8 = self.rc4.conv.weight
        primals_9 = self.rc4.conv.bias
        primals_10 = self.rc5.conv.weight
        primals_11 = self.rc5.conv.bias
        primals_12 = self.rc6.conv.weight
        primals_13 = self.rc6.conv.bias
        primals_14 = self.rc7.conv.weight
        primals_15 = self.rc7.conv.bias
        primals_16 = self.rc8.conv.weight
        primals_17 = self.rc8.conv.bias
        primals_18 = self.rc9.conv.weight
        primals_19 = self.rc9.conv.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, primals_18, primals_19])
        return output[0]


Measured latency_ms: 0.03548