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
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 % 512
    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 % 512
    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 % 256
    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 % 256
    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):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 34 % 34
    x0 = xindex % 34
    x4 = xindex // 1156
    x2 = xindex // 1156 % 128
    x7 = xindex
    tmp0 = tl.load(in_ptr0 + (31 + -1 * tl_math.abs(-31 + tl_math.abs(-1 +
        x1))), None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (31 + -1 * tl_math.abs(-31 + 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], 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), 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_9(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 % 34
    x1 = xindex // 34 % 34
    x4 = xindex // 1156
    x2 = xindex // 1156 % 128
    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),
        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_arange_10(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
    tl.store(out_ptr0 + x0, tmp0, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_mul_11(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.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_12(in_ptr0
    , in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1115136
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 66 % 66
    x0 = xindex % 66
    x4 = xindex // 4356
    x2 = xindex // 4356 % 64
    x7 = xindex
    tmp0 = tl.load(in_ptr0 + (63 + -1 * tl_math.abs(-63 + tl_math.abs(-1 +
        x1))), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (63 + -1 * tl_math.abs(-63 + 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], 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_ptr1 + (tmp8 + 32 * tmp4 + 1024 * 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_13(in_ptr0, in_ptr1,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1115136
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 66
    x1 = xindex // 66 % 66
    x4 = xindex // 4356
    x2 = xindex // 4356 % 64
    x5 = xindex
    tmp0 = tl.load(in_ptr0 + (4095 + -1 * tl_math.abs(-63 + tl_math.abs(-1 +
        x0)) + -64 * tl_math.abs(-63 + tl_math.abs(-1 + x1)) + 4096 * 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_relu_threshold_backward_14(in_out_ptr0,
    in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    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 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(in_out_ptr0 + x3, tmp4, None)
    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 // 4096 % 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_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 // 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_17(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 % 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_18(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_19(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 % 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_20(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_21(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 % 512
    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_22(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 % 512
    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) = args
    args.clear()
    assert_size_stride(primals_1, (4, 512, 4, 4), (8192, 16, 4, 1))
    assert_size_stride(primals_2, (512, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_3, (512,), (1,))
    assert_size_stride(primals_4, (512, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_5, (512,), (1,))
    assert_size_stride(primals_6, (512, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_7, (512,), (1,))
    assert_size_stride(primals_8, (512, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_9, (512,), (1,))
    assert_size_stride(primals_10, (256, 512, 3, 3), (4608, 9, 3, 1))
    assert_size_stride(primals_11, (256,), (1,))
    assert_size_stride(primals_12, (256, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_13, (256,), (1,))
    assert_size_stride(primals_14, (256, 256, 3, 3), (2304, 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, (128, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_19, (128,), (1,))
    assert_size_stride(primals_20, (128, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_21, (128,), (1,))
    assert_size_stride(primals_22, (64, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_23, (64,), (1,))
    assert_size_stride(primals_24, (64, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_25, (64,), (1,))
    assert_size_stride(primals_26, (3, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_27, (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, 512, 4, 4), (8192, 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, 512, 10, 10), (51200, 100, 10, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_2[grid
            (204800)](buf2, buf1, primals_3, buf3, 204800, 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, 512, 8, 8), (32768, 64, 8, 1))
        buf5 = empty_strided_cuda((4, 512, 10, 10), (51200, 100, 10, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_3[grid(204800)](buf4
            , primals_5, buf5, 204800, XBLOCK=1024, num_warps=4, 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, 512, 8, 8), (32768, 64, 8, 1))
        buf7 = empty_strided_cuda((4, 512, 10, 10), (51200, 100, 10, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_3[grid(204800)](buf6
            , primals_7, buf7, 204800, XBLOCK=1024, num_warps=4, 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, 512, 8, 8), (32768, 64, 8, 1))
        buf9 = empty_strided_cuda((4, 512, 10, 10), (51200, 100, 10, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_3[grid(204800)](buf8
            , primals_9, buf9, 204800, XBLOCK=1024, num_warps=4, 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, 256, 8, 8), (16384, 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, 256, 18, 18), (82944, 324, 18, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_5[grid
            (331776)](buf11, buf10, primals_11, buf12, 331776, XBLOCK=512,
            num_warps=8, 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, 256, 16, 16), (65536, 256, 16, 1))
        buf14 = empty_strided_cuda((4, 256, 18, 18), (82944, 324, 18, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_6[grid(331776)](
            buf13, primals_13, buf14, 331776, 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, 256, 16, 16), (65536, 256, 16, 1))
        buf16 = empty_strided_cuda((4, 256, 18, 18), (82944, 324, 18, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_6[grid(331776)](
            buf15, primals_15, buf16, 331776, XBLOCK=512, num_warps=8,
            num_stages=1)
        buf17 = extern_kernels.convolution(buf16, primals_16, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 256, 16, 16), (65536, 256, 16, 1))
        buf18 = empty_strided_cuda((4, 256, 18, 18), (82944, 324, 18, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_6[grid(331776)](
            buf17, primals_17, buf18, 331776, XBLOCK=512, num_warps=8,
            num_stages=1)
        buf19 = extern_kernels.convolution(buf18, primals_18, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf19, (4, 128, 16, 16), (32768, 256, 16, 1))
        buf20 = empty_strided_cuda((32,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_7[grid(32)](buf20, 32,
            XBLOCK=32, num_warps=1, num_stages=1)
        buf21 = empty_strided_cuda((4, 128, 34, 34), (147968, 1156, 34, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_8[grid
            (591872)](buf20, buf19, primals_19, buf21, 591872, XBLOCK=1024,
            num_warps=4, num_stages=1)
        buf22 = extern_kernels.convolution(buf21, primals_20, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf22, (4, 128, 32, 32), (131072, 1024, 32, 1))
        buf23 = empty_strided_cuda((4, 128, 34, 34), (147968, 1156, 34, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_9[grid(591872)](
            buf22, primals_21, buf23, 591872, XBLOCK=1024, num_warps=4,
            num_stages=1)
        buf24 = extern_kernels.convolution(buf23, primals_22, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf24, (4, 64, 32, 32), (65536, 1024, 32, 1))
        buf25 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused_arange_10[grid(64)](buf25, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf26 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_11[grid(64)](buf26, 64,
            XBLOCK=64, num_warps=1, num_stages=1)
        buf27 = empty_strided_cuda((4, 64, 66, 66), (278784, 4356, 66, 1),
            torch.float32)
        triton_poi_fused__unsafe_index_convolution_reflection_pad2d_relu_12[
            grid(1115136)](buf26, buf24, primals_23, buf27, 1115136, XBLOCK
            =512, num_warps=8, num_stages=1)
        buf28 = extern_kernels.convolution(buf27, primals_24, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf28, (4, 64, 64, 64), (262144, 4096, 64, 1))
        buf29 = empty_strided_cuda((4, 64, 66, 66), (278784, 4356, 66, 1),
            torch.float32)
        triton_poi_fused_convolution_reflection_pad2d_relu_13[grid(1115136)](
            buf28, primals_25, buf29, 1115136, XBLOCK=1024, num_warps=4,
            num_stages=1)
        buf30 = extern_kernels.convolution(buf29, primals_26, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf30, (4, 3, 64, 64), (12288, 4096, 64, 1))
        buf31 = buf30
        del buf30
        buf32 = empty_strided_cuda((4, 3, 64, 64), (12288, 4096, 64, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_14[grid(49152)](
            buf31, primals_27, buf32, 49152, XBLOCK=512, num_warps=4,
            num_stages=1)
        del primals_27
        buf33 = empty_strided_cuda((4, 64, 64, 64), (262144, 4096, 64, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_15[grid(1048576)](
            buf28, primals_25, buf33, 1048576, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf28
        del primals_25
        buf34 = empty_strided_cuda((4, 64, 32, 32), (65536, 1024, 32, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_16[grid(262144)](
            buf24, primals_23, buf34, 262144, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf24
        del primals_23
        buf35 = empty_strided_cuda((4, 128, 32, 32), (131072, 1024, 32, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_17[grid(524288)](
            buf22, primals_21, buf35, 524288, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf22
        del primals_21
        buf36 = empty_strided_cuda((4, 128, 16, 16), (32768, 256, 16, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_18[grid(131072)](
            buf19, primals_19, buf36, 131072, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf19
        del primals_19
        buf37 = empty_strided_cuda((4, 256, 16, 16), (65536, 256, 16, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_19[grid(262144)](
            buf17, primals_17, buf37, 262144, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf17
        del primals_17
        buf38 = empty_strided_cuda((4, 256, 16, 16), (65536, 256, 16, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_19[grid(262144)](
            buf15, primals_15, buf38, 262144, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf15
        del primals_15
        buf39 = empty_strided_cuda((4, 256, 16, 16), (65536, 256, 16, 1),
            torch.bool)
        triton_poi_fused_convolution_relu_threshold_backward_19[grid(262144)](
            buf13, primals_13, buf39, 262144, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf13
        del primals_13
        buf40 = empty_strided_cuda((4, 256, 8, 8), (16384, 64, 8, 1), torch
            .bool)
        triton_poi_fused_convolution_relu_threshold_backward_20[grid(65536)](
            buf10, primals_11, buf40, 65536, XBLOCK=512, num_warps=4,
            num_stages=1)
        del buf10
        del primals_11
        buf41 = empty_strided_cuda((4, 512, 8, 8), (32768, 64, 8, 1), torch
            .bool)
        triton_poi_fused_convolution_relu_threshold_backward_21[grid(131072)](
            buf8, primals_9, buf41, 131072, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf8
        del primals_9
        buf42 = empty_strided_cuda((4, 512, 8, 8), (32768, 64, 8, 1), torch
            .bool)
        triton_poi_fused_convolution_relu_threshold_backward_21[grid(131072)](
            buf6, primals_7, buf42, 131072, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf6
        del primals_7
        buf43 = empty_strided_cuda((4, 512, 8, 8), (32768, 64, 8, 1), torch
            .bool)
        triton_poi_fused_convolution_relu_threshold_backward_21[grid(131072)](
            buf4, primals_5, buf43, 131072, XBLOCK=1024, num_warps=4,
            num_stages=1)
        del buf4
        del primals_5
        buf44 = empty_strided_cuda((4, 512, 4, 4), (8192, 16, 4, 1), torch.bool
            )
        triton_poi_fused_convolution_relu_threshold_backward_22[grid(32768)](
            buf1, primals_3, buf44, 32768, XBLOCK=128, num_warps=4,
            num_stages=1)
        del buf1
        del primals_3
    return (buf31, primals_2, primals_4, primals_6, primals_8, primals_10,
        primals_12, primals_14, primals_16, primals_18, primals_20,
        primals_22, primals_24, primals_26, buf0, buf2, buf3, buf5, buf7,
        buf9, buf11, buf12, buf14, buf16, buf18, buf20, buf21, buf23, buf25,
        buf26, buf27, buf29, buf32, buf33, buf34, buf35, buf36, buf37,
        buf38, buf39, buf40, buf41, buf42, buf43, buf44)


class Decoder5New(nn.Module):

    def __init__(self, model=None, fixed=False):
        super(Decoder5New, self).__init__()
        self.fixed = fixed
        self.conv51 = nn.Conv2d(512, 512, 3, 1, 0)
        self.conv44 = nn.Conv2d(512, 512, 3, 1, 0)
        self.conv43 = nn.Conv2d(512, 512, 3, 1, 0)
        self.conv42 = nn.Conv2d(512, 512, 3, 1, 0)
        self.conv41 = nn.Conv2d(512, 256, 3, 1, 0)
        self.conv34 = nn.Conv2d(256, 256, 3, 1, 0)
        self.conv33 = nn.Conv2d(256, 256, 3, 1, 0)
        self.conv32 = nn.Conv2d(256, 256, 3, 1, 0)
        self.conv31 = nn.Conv2d(256, 128, 3, 1, 0)
        self.conv22 = nn.Conv2d(128, 128, 3, 1, 0)
        self.conv21 = nn.Conv2d(128, 64, 3, 1, 0)
        self.conv12 = nn.Conv2d(64, 64, 3, 1, 0)
        self.conv11 = nn.Conv2d(64, 3, 3, 1, 0)
        self.relu = nn.ReLU(inplace=True)
        self.unpool = nn.UpsamplingNearest2d(scale_factor=2)
        self.pad = nn.ReflectionPad2d((1, 1, 1, 1))
        if model:
            self.load_state_dict(torch.load(model, map_location=lambda
                storage, location: storage))
        if fixed:
            for param in self.parameters():
                param.requires_grad = False

    def forward(self, input_0):
        primals_2 = self.conv51.weight
        primals_3 = self.conv51.bias
        primals_4 = self.conv44.weight
        primals_5 = self.conv44.bias
        primals_6 = self.conv43.weight
        primals_7 = self.conv43.bias
        primals_8 = self.conv42.weight
        primals_9 = self.conv42.bias
        primals_10 = self.conv41.weight
        primals_11 = self.conv41.bias
        primals_12 = self.conv34.weight
        primals_13 = self.conv34.bias
        primals_14 = self.conv33.weight
        primals_15 = self.conv33.bias
        primals_16 = self.conv32.weight
        primals_17 = self.conv32.bias
        primals_18 = self.conv31.weight
        primals_19 = self.conv31.bias
        primals_20 = self.conv22.weight
        primals_21 = self.conv22.bias
        primals_22 = self.conv21.weight
        primals_23 = self.conv21.bias
        primals_24 = self.conv12.weight
        primals_25 = self.conv12.bias
        primals_26 = self.conv11.weight
        primals_27 = self.conv11.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,
            primals_20, primals_21, primals_22, primals_23, primals_24,
            primals_25, primals_26, primals_27])
        return output[0]


Measured latency_ms: 0.252771